a59c0408a18dc367f8b9ff8a0762ee6891f49270
[linux-2.6.git] / arch / ppc64 / kernel / misc.S
1 /*
2  *  arch/ppc/kernel/misc.S
3  *
4  *  
5  *
6  * This file contains miscellaneous low-level functions.
7  *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
8  *
9  * Largely rewritten by Cort Dougan (cort@cs.nmt.edu)
10  * and Paul Mackerras.
11  * Adapted for iSeries by Mike Corrigan (mikejc@us.ibm.com)
12  * PPC64 updates by Dave Engebretsen (engebret@us.ibm.com) 
13  * 
14  * This program is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU General Public License
16  * as published by the Free Software Foundation; either version
17  * 2 of the License, or (at your option) any later version.
18  *
19  */
20
21 #include <linux/config.h>
22 #include <linux/sys.h>
23 #include <asm/unistd.h>
24 #include <asm/errno.h>
25 #include <asm/processor.h>
26 #include <asm/page.h>
27 #include <asm/cache.h>
28 #include <asm/ppc_asm.h>
29 #include <asm/offsets.h>
30 #include <asm/cputable.h>
31
32         .text
33
34 /*
35  * Returns (address we're running at) - (address we were linked at)
36  * for use before the text and data are mapped to KERNELBASE.
37  */
38
39 _GLOBAL(reloc_offset)
40         mflr    r0
41         bl      1f
42 1:      mflr    r3
43         LOADADDR(r4,1b)
44         sub     r3,r4,r3
45         mtlr    r0
46         blr
47
48 _GLOBAL(get_msr)
49         mfmsr   r3
50         blr
51
52 _GLOBAL(get_dar)
53         mfdar   r3
54         blr
55
56 _GLOBAL(get_srr0)
57         mfsrr0  r3
58         blr
59
60 _GLOBAL(get_srr1)
61         mfsrr1  r3
62         blr
63         
64 _GLOBAL(get_sp)
65         mr      r3,r1
66         blr
67                 
68 #ifdef CONFIG_PPC_ISERIES
69 /* unsigned long local_save_flags(void) */
70 _GLOBAL(local_get_flags)
71         lbz     r3,PACAPROCENABLED(r13)
72         blr
73
74 /* unsigned long local_irq_disable(void) */
75 _GLOBAL(local_irq_disable)
76         lbz     r3,PACAPROCENABLED(r13)
77         li      r4,0
78         stb     r4,PACAPROCENABLED(r13)
79         blr                     /* Done */
80
81 /* void local_irq_restore(unsigned long flags) */       
82 _GLOBAL(local_irq_restore)
83         lbz     r5,PACAPROCENABLED(r13)
84          /* Check if things are setup the way we want _already_. */
85         cmpw    0,r3,r5
86         beqlr
87         /* are we enabling interrupts? */
88         cmpi    0,r3,0
89         stb     r3,PACAPROCENABLED(r13)
90         beqlr
91         /* Check pending interrupts */
92         /*   A decrementer, IPI or PMC interrupt may have occurred
93          *   while we were in the hypervisor (which enables) */
94         CHECKANYINT(r4,r5)
95         beqlr
96
97         /* 
98          * Handle pending interrupts in interrupt context
99          */
100         li      r0,0x5555
101         sc
102         blr
103 #endif /* CONFIG_PPC_ISERIES */
104
105 /*
106  * Flush instruction cache.
107  */
108 _GLOBAL(flush_instruction_cache)
109
110 /*
111  * This is called by kgdb code
112  * and should probably go away
113  * to be replaced by invalidating
114  * the cache lines that are actually
115  * modified
116  */
117         /* use invalidate-all bit in HID0
118          *  - is this consistent across all 64-bit cpus?  -- paulus */
119         mfspr   r3,HID0
120         ori     r3,r3,HID0_ICFI
121         mtspr   HID0,r3
122         sync
123         isync
124         blr
125
126 /*
127  * Write any modified data cache blocks out to memory
128  * and invalidate the corresponding instruction cache blocks.
129  *
130  * flush_icache_range(unsigned long start, unsigned long stop)
131  *
132  *   flush all bytes from start through stop-1 inclusive
133  */
134
135 _GLOBAL(__flush_icache_range)
136
137 /*
138  * Flush the data cache to memory 
139  * 
140  * Different systems have different cache line sizes
141  * and in some cases i-cache and d-cache line sizes differ from
142  * each other.
143  */
144         LOADADDR(r10,naca)              /* Get Naca address */
145         ld      r10,0(r10)
146         LOADADDR(r11,systemcfg)         /* Get systemcfg address */
147         ld      r11,0(r11)
148         lwz     r7,DCACHEL1LINESIZE(r11)/* Get cache line size */
149         addi    r5,r7,-1
150         andc    r6,r3,r5                /* round low to line bdy */
151         subf    r8,r6,r4                /* compute length */
152         add     r8,r8,r5                /* ensure we get enough */
153         lwz     r9,DCACHEL1LOGLINESIZE(r10)     /* Get log-2 of cache line size */
154         srw.    r8,r8,r9                /* compute line count */
155         beqlr                           /* nothing to do? */
156         mtctr   r8
157 1:      dcbst   0,r6
158         add     r6,r6,r7
159         bdnz    1b
160         sync
161
162 /* Now invalidate the instruction cache */
163         
164         lwz     r7,ICACHEL1LINESIZE(r11)        /* Get Icache line size */
165         addi    r5,r7,-1
166         andc    r6,r3,r5                /* round low to line bdy */
167         subf    r8,r6,r4                /* compute length */
168         add     r8,r8,r5
169         lwz     r9,ICACHEL1LOGLINESIZE(r10)     /* Get log-2 of Icache line size */
170         srw.    r8,r8,r9                /* compute line count */
171         beqlr                           /* nothing to do? */
172         mtctr   r8
173 2:      icbi    0,r6
174         add     r6,r6,r7
175         bdnz    2b
176         isync
177         blr
178         
179 /*
180  * Like above, but only do the D-cache.
181  *
182  * flush_dcache_range(unsigned long start, unsigned long stop)
183  *
184  *    flush all bytes from start to stop-1 inclusive
185  */
186 _GLOBAL(flush_dcache_range)
187
188 /*
189  * Flush the data cache to memory 
190  * 
191  * Different systems have different cache line sizes
192  */
193         LOADADDR(r10,naca)              /* Get Naca address */
194         ld      r10,0(r10)
195         LOADADDR(r11,systemcfg)         /* Get systemcfg address */
196         ld      r11,0(r11)
197         lwz     r7,DCACHEL1LINESIZE(r11)        /* Get dcache line size */
198         addi    r5,r7,-1
199         andc    r6,r3,r5                /* round low to line bdy */
200         subf    r8,r6,r4                /* compute length */
201         add     r8,r8,r5                /* ensure we get enough */
202         lwz     r9,DCACHEL1LOGLINESIZE(r10)     /* Get log-2 of dcache line size */
203         srw.    r8,r8,r9                /* compute line count */
204         beqlr                           /* nothing to do? */
205         mtctr   r8
206 0:      dcbst   0,r6
207         add     r6,r6,r7
208         bdnz    0b
209         sync
210         blr
211
212 /*
213  * Like above, but works on non-mapped physical addresses.
214  * Use only for non-LPAR setups ! It also assumes real mode
215  * is cacheable. Used for flushing out the DART before using
216  * it as uncacheable memory 
217  *
218  * flush_dcache_phys_range(unsigned long start, unsigned long stop)
219  *
220  *    flush all bytes from start to stop-1 inclusive
221  */
222 _GLOBAL(flush_dcache_phys_range)
223         LOADADDR(r10,naca)              /* Get Naca address */
224         ld      r10,0(r10)
225         LOADADDR(r11,systemcfg)         /* Get systemcfg address */
226         ld      r11,0(r11)
227         lwz     r7,DCACHEL1LINESIZE(r11)        /* Get dcache line size */
228         addi    r5,r7,-1
229         andc    r6,r3,r5                /* round low to line bdy */
230         subf    r8,r6,r4                /* compute length */
231         add     r8,r8,r5                /* ensure we get enough */
232         lwz     r9,DCACHEL1LOGLINESIZE(r10)     /* Get log-2 of dcache line size */
233         srw.    r8,r8,r9                /* compute line count */
234         beqlr                           /* nothing to do? */
235         mfmsr   r5                      /* Disable MMU Data Relocation */
236         ori     r0,r5,MSR_DR
237         xori    r0,r0,MSR_DR
238         sync
239         mtmsr   r0
240         sync
241         isync
242         mtctr   r8
243 0:      dcbst   0,r6
244         add     r6,r6,r7
245         bdnz    0b
246         sync
247         isync
248         mtmsr   r5                      /* Re-enable MMU Data Relocation */
249         sync
250         isync
251         blr
252
253
254 /*
255  * Flush a particular page from the data cache to RAM.
256  * Note: this is necessary because the instruction cache does *not*
257  * snoop from the data cache.
258  *
259  *      void __flush_dcache_icache(void *page)
260  */
261 _GLOBAL(__flush_dcache_icache)
262 /*
263  * Flush the data cache to memory 
264  * 
265  * Different systems have different cache line sizes
266  */
267
268 /* Flush the dcache */
269         LOADADDR(r7,naca)
270         ld      r7,0(r7)
271         LOADADDR(r8,systemcfg)                  /* Get systemcfg address */
272         ld      r8,0(r8)
273         clrrdi  r3,r3,12                    /* Page align */
274         lwz     r4,DCACHEL1LINESPERPAGE(r7)     /* Get # dcache lines per page */
275         lwz     r5,DCACHEL1LINESIZE(r8)         /* Get dcache line size */
276         mr      r6,r3
277         mtctr   r4
278 0:      dcbst   0,r6
279         add     r6,r6,r5
280         bdnz    0b
281         sync
282
283 /* Now invalidate the icache */ 
284
285         lwz     r4,ICACHEL1LINESPERPAGE(r7)     /* Get # icache lines per page */
286         lwz     r5,ICACHEL1LINESIZE(r8)         /* Get icache line size */
287         mtctr   r4
288 1:      icbi    0,r3
289         add     r3,r3,r5
290         bdnz    1b
291         isync
292         blr
293         
294 /*
295  * I/O string operations
296  *
297  * insb(port, buf, len)
298  * outsb(port, buf, len)
299  * insw(port, buf, len)
300  * outsw(port, buf, len)
301  * insl(port, buf, len)
302  * outsl(port, buf, len)
303  * insw_ns(port, buf, len)
304  * outsw_ns(port, buf, len)
305  * insl_ns(port, buf, len)
306  * outsl_ns(port, buf, len)
307  *
308  * The *_ns versions don't do byte-swapping.
309  */
310 _GLOBAL(_insb)
311         cmpwi   0,r5,0
312         mtctr   r5
313         subi    r4,r4,1
314         blelr-
315 00:     lbz     r5,0(r3)
316         eieio
317         stbu    r5,1(r4)
318         bdnz    00b
319         blr
320
321 _GLOBAL(_outsb)
322         cmpwi   0,r5,0
323         mtctr   r5
324         subi    r4,r4,1
325         blelr-
326 00:     lbzu    r5,1(r4)
327         stb     r5,0(r3)
328         eieio
329         bdnz    00b
330         blr     
331
332 _GLOBAL(_insw)
333         cmpwi   0,r5,0
334         mtctr   r5
335         subi    r4,r4,2
336         blelr-
337 00:     lhbrx   r5,0,r3
338         eieio
339         sthu    r5,2(r4)
340         bdnz    00b
341         blr
342
343 _GLOBAL(_outsw)
344         cmpwi   0,r5,0
345         mtctr   r5
346         subi    r4,r4,2
347         blelr-
348 00:     lhzu    r5,2(r4)
349         eieio
350         sthbrx  r5,0,r3 
351         bdnz    00b
352         blr     
353
354 _GLOBAL(_insl)
355         cmpwi   0,r5,0
356         mtctr   r5
357         subi    r4,r4,4
358         blelr-
359 00:     lwbrx   r5,0,r3
360         eieio
361         stwu    r5,4(r4)
362         bdnz    00b
363         blr
364
365 _GLOBAL(_outsl)
366         cmpwi   0,r5,0
367         mtctr   r5
368         subi    r4,r4,4
369         blelr-
370 00:     lwzu    r5,4(r4)
371         stwbrx  r5,0,r3
372         eieio
373         bdnz    00b
374         blr     
375
376 /* _GLOBAL(ide_insw) now in drivers/ide/ide-iops.c */
377 _GLOBAL(_insw_ns)
378         cmpwi   0,r5,0
379         mtctr   r5
380         subi    r4,r4,2
381         blelr-
382 00:     lhz     r5,0(r3)
383         eieio
384         sthu    r5,2(r4)
385         bdnz    00b
386         blr
387
388 /* _GLOBAL(ide_outsw) now in drivers/ide/ide-iops.c */
389 _GLOBAL(_outsw_ns)
390         cmpwi   0,r5,0
391         mtctr   r5
392         subi    r4,r4,2
393         blelr-
394 00:     lhzu    r5,2(r4)
395         sth     r5,0(r3)
396         eieio
397         bdnz    00b
398         blr     
399
400 _GLOBAL(_insl_ns)
401         cmpwi   0,r5,0
402         mtctr   r5
403         subi    r4,r4,4
404         blelr-
405 00:     lwz     r5,0(r3)
406         eieio
407         stwu    r5,4(r4)
408         bdnz    00b
409         blr
410
411 _GLOBAL(_outsl_ns)
412         cmpwi   0,r5,0
413         mtctr   r5
414         subi    r4,r4,4
415         blelr-
416 00:     lwzu    r5,4(r4)
417         stw     r5,0(r3)
418         eieio
419         bdnz    00b
420         blr     
421
422 _GLOBAL(abs)
423         cmpi    0,r3,0
424         bge     10f
425         neg     r3,r3
426 10:     blr
427
428 _GLOBAL(_get_PVR)
429         mfspr   r3,PVR
430         blr
431
432 _GLOBAL(_get_PIR)
433         mfspr   r3,PIR
434         blr
435
436 _GLOBAL(_get_HID0)
437         mfspr   r3,HID0
438         blr
439
440 _GLOBAL(cvt_fd)
441         lfd     0,0(r5)         /* load up fpscr value */
442         mtfsf   0xff,0
443         lfs     0,0(r3)
444         stfd    0,0(r4)
445         mffs    0               /* save new fpscr value */
446         stfd    0,0(r5)
447         blr
448
449 _GLOBAL(cvt_df)
450         lfd     0,0(r5)         /* load up fpscr value */
451         mtfsf   0xff,0
452         lfd     0,0(r3)
453         stfs    0,0(r4)
454         mffs    0               /* save new fpscr value */
455         stfd    0,0(r5)
456         blr
457
458 /*
459  * identify_cpu and calls setup_cpu
460  * In:  r3 = base of the cpu_specs array
461  *      r4 = address of cur_cpu_spec
462  *      r5 = relocation offset
463  */
464 _GLOBAL(identify_cpu)
465         mfpvr   r7
466 1:
467         lwz     r8,CPU_SPEC_PVR_MASK(r3)
468         and     r8,r8,r7
469         lwz     r9,CPU_SPEC_PVR_VALUE(r3)
470         cmplw   0,r9,r8
471         beq     1f
472         addi    r3,r3,CPU_SPEC_ENTRY_SIZE
473         b       1b
474 1:
475         add     r0,r3,r5
476         std     r0,0(r4)
477         ld      r4,CPU_SPEC_SETUP(r3)
478         sub     r4,r4,r5
479         ld      r4,0(r4)
480         sub     r4,r4,r5
481         mtctr   r4
482         /* Calling convention for cpu setup is r3=offset, r4=cur_cpu_spec */
483         mr      r4,r3
484         mr      r3,r5
485         bctr
486
487 /*
488  * do_cpu_ftr_fixups - goes through the list of CPU feature fixups
489  * and writes nop's over sections of code that don't apply for this cpu.
490  * r3 = data offset (not changed)
491  */
492 _GLOBAL(do_cpu_ftr_fixups)
493         /* Get CPU 0 features */
494         LOADADDR(r6,cur_cpu_spec)
495         sub     r6,r6,r3
496         ld      r4,0(r6)
497         sub     r4,r4,r3
498         ld      r4,CPU_SPEC_FEATURES(r4)
499         /* Get the fixup table */
500         LOADADDR(r6,__start___ftr_fixup)
501         sub     r6,r6,r3
502         LOADADDR(r7,__stop___ftr_fixup)
503         sub     r7,r7,r3
504         /* Do the fixup */
505 1:      cmpld   r6,r7
506         bgelr
507         addi    r6,r6,32
508         ld      r8,-32(r6)      /* mask */
509         and     r8,r8,r4
510         ld      r9,-24(r6)      /* value */
511         cmpld   r8,r9
512         beq     1b
513         ld      r8,-16(r6)      /* section begin */
514         ld      r9,-8(r6)       /* section end */
515         subf.   r9,r8,r9
516         beq     1b
517         /* write nops over the section of code */
518         /* todo: if large section, add a branch at the start of it */
519         srwi    r9,r9,2
520         mtctr   r9
521         sub     r8,r8,r3
522         lis     r0,0x60000000@h /* nop */
523 3:      stw     r0,0(r8)
524         andi.   r10,r4,CPU_FTR_SPLIT_ID_CACHE@l
525         beq     2f
526         dcbst   0,r8            /* suboptimal, but simpler */
527         sync
528         icbi    0,r8
529 2:      addi    r8,r8,4
530         bdnz    3b
531         sync                    /* additional sync needed on g4 */
532         isync
533         b       1b
534
535
536 /*
537  * Create a kernel thread
538  *   kernel_thread(fn, arg, flags)
539  */
540 _GLOBAL(kernel_thread)
541         std     r29,-24(r1)
542         std     r30,-16(r1)
543         stdu    r1,-STACK_FRAME_OVERHEAD(r1)
544         mr      r29,r3
545         mr      r30,r4
546         ori     r3,r5,CLONE_VM  /* flags */
547         oris    r3,r3,(CLONE_UNTRACED>>16)
548         li      r4,0            /* new sp (unused) */
549         li      r0,__NR_clone
550         sc
551         cmpi    0,r3,0          /* parent or child? */
552         bne     1f              /* return if parent */
553         li      r0,0
554         stdu    r0,-STACK_FRAME_OVERHEAD(r1)
555         ld      r2,8(r29)
556         ld      r29,0(r29)
557         mtlr    r29              /* fn addr in lr */
558         mr      r3,r30          /* load arg and call fn */
559         blrl
560         li      r0,__NR_exit    /* exit after child exits */
561         li      r3,0
562         sc
563 1:      addi    r1,r1,STACK_FRAME_OVERHEAD      
564         ld      r29,-24(r1)
565         ld      r30,-16(r1)
566         blr
567
568 #ifdef CONFIG_PPC_ISERIES       /* hack hack hack */
569 #define ppc_rtas        sys_ni_syscall
570 #endif
571
572 /* Why isn't this a) automatic, b) written in 'C'? */   
573         .balign 8
574 _GLOBAL(sys_call_table32)
575         .llong .sys_restart_syscall     /* 0 */
576         .llong .sys_exit
577         .llong .sys_fork
578         .llong .sys_read
579         .llong .sys_write
580         .llong .sys32_open              /* 5 */
581         .llong .sys_close
582         .llong .sys32_waitpid
583         .llong .sys32_creat
584         .llong .sys_link
585         .llong .sys_unlink              /* 10 */
586         .llong .sys32_execve
587         .llong .sys_chdir
588         .llong .sys32_time
589         .llong .sys_mknod
590         .llong .sys_chmod               /* 15 */
591         .llong .sys_lchown
592         .llong .sys_ni_syscall          /* old break syscall */
593         .llong .sys_ni_syscall          /* old stat syscall */
594         .llong .ppc32_lseek
595         .llong .sys_getpid              /* 20 */
596         .llong .compat_sys_mount
597         .llong .sys_oldumount
598         .llong .sys_setuid
599         .llong .sys_getuid
600         .llong .ppc64_sys32_stime       /* 25 */
601         .llong .sys32_ptrace
602         .llong .sys_alarm
603         .llong .sys_ni_syscall          /* old fstat syscall */
604         .llong .sys32_pause
605         .llong .compat_sys_utime                /* 30 */
606         .llong .sys_ni_syscall          /* old stty syscall */
607         .llong .sys_ni_syscall          /* old gtty syscall */
608         .llong .sys32_access
609         .llong .sys32_nice
610         .llong .sys_ni_syscall          /* 35 - old ftime syscall */
611         .llong .sys_sync
612         .llong .sys32_kill
613         .llong .sys_rename
614         .llong .sys32_mkdir
615         .llong .sys_rmdir               /* 40 */
616         .llong .sys_dup
617         .llong .sys_pipe
618         .llong .compat_sys_times
619         .llong .sys_ni_syscall          /* old prof syscall */
620         .llong .sys_brk                 /* 45 */
621         .llong .sys_setgid
622         .llong .sys_getgid
623         .llong .sys_signal
624         .llong .sys_geteuid
625         .llong .sys_getegid             /* 50 */
626         .llong .sys_acct
627         .llong .sys_umount
628         .llong .sys_ni_syscall          /* old lock syscall */
629         .llong .compat_sys_ioctl
630         .llong .compat_sys_fcntl                /* 55 */
631         .llong .sys_ni_syscall          /* old mpx syscall */
632         .llong .sys32_setpgid
633         .llong .sys_ni_syscall          /* old ulimit syscall */
634         .llong .sys32_olduname
635         .llong .sys32_umask             /* 60 */
636         .llong .sys_chroot
637         .llong .sys_ustat
638         .llong .sys_dup2
639         .llong .sys_getppid
640         .llong .sys_getpgrp             /* 65 */
641         .llong .sys_setsid
642         .llong .sys32_sigaction
643         .llong .sys_sgetmask
644         .llong .sys32_ssetmask
645         .llong .sys_setreuid            /* 70 */
646         .llong .sys_setregid
647         .llong .sys32_sigsuspend
648         .llong .compat_sys_sigpending
649         .llong .sys32_sethostname
650         .llong .compat_sys_setrlimit            /* 75 */
651         .llong .compat_sys_old_getrlimit
652         .llong .compat_sys_getrusage
653         .llong .sys32_gettimeofday
654         .llong .sys32_settimeofday
655         .llong .sys32_getgroups         /* 80 */
656         .llong .sys32_setgroups
657         .llong .sys_ni_syscall          /* old select syscall */
658         .llong .sys_symlink
659         .llong .sys_ni_syscall          /* old lstat syscall */
660         .llong .sys32_readlink          /* 85 */
661         .llong .sys_uselib
662         .llong .sys_swapon
663         .llong .sys_reboot
664         .llong .old32_readdir
665         .llong .sys_mmap                /* 90 */
666         .llong .sys_munmap
667         .llong .sys_truncate
668         .llong .sys_ftruncate
669         .llong .sys_fchmod
670         .llong .sys_fchown              /* 95 */
671         .llong .sys32_getpriority
672         .llong .sys32_setpriority
673         .llong .sys_ni_syscall          /* old profil syscall */
674         .llong .compat_sys_statfs
675         .llong .compat_sys_fstatfs              /* 100 */
676         .llong .sys_ni_syscall          /* old ioperm syscall */
677         .llong .compat_sys_socketcall
678         .llong .sys32_syslog
679         .llong .compat_sys_setitimer
680         .llong .compat_sys_getitimer            /* 105 */
681         .llong .compat_sys_newstat
682         .llong .compat_sys_newlstat
683         .llong .compat_sys_newfstat
684         .llong .sys_uname
685         .llong .sys_ni_syscall          /* 110 old iopl syscall */
686         .llong .sys_vhangup
687         .llong .sys_ni_syscall          /* old idle syscall */
688         .llong .sys_ni_syscall          /* old vm86 syscall */
689         .llong .compat_sys_wait4
690         .llong .sys_swapoff             /* 115 */
691         .llong .sys32_sysinfo
692         .llong .sys32_ipc
693         .llong .sys_fsync
694         .llong .ppc32_sigreturn
695         .llong .sys_clone               /* 120 */
696         .llong .sys32_setdomainname
697         .llong .ppc64_newuname
698         .llong .sys_ni_syscall          /* old modify_ldt syscall */
699         .llong .sys32_adjtimex
700         .llong .sys_mprotect            /* 125 */
701         .llong .compat_sys_sigprocmask
702         .llong .sys_ni_syscall          /* old create_module syscall */
703         .llong .sys_init_module
704         .llong .sys_delete_module
705         .llong .sys_ni_syscall          /* 130 old get_kernel_syms syscall */
706         .llong .sys_quotactl
707         .llong .sys32_getpgid
708         .llong .sys_fchdir
709         .llong .sys_bdflush
710         .llong .sys32_sysfs             /* 135 */
711         .llong .ppc64_personality
712         .llong .sys_ni_syscall          /* for afs_syscall */
713         .llong .sys_setfsuid
714         .llong .sys_setfsgid
715         .llong .sys_llseek              /* 140 */
716         .llong .sys32_getdents
717         .llong .ppc32_select
718         .llong .sys_flock
719         .llong .sys_msync
720         .llong .sys32_readv             /* 145 */
721         .llong .sys32_writev
722         .llong .sys32_getsid
723         .llong .sys_fdatasync
724         .llong .sys32_sysctl
725         .llong .sys_mlock               /* 150 */
726         .llong .sys_munlock
727         .llong .sys_mlockall
728         .llong .sys_munlockall
729         .llong .sys32_sched_setparam
730         .llong .sys32_sched_getparam    /* 155 */
731         .llong .sys32_sched_setscheduler
732         .llong .sys32_sched_getscheduler
733         .llong .sys_sched_yield
734         .llong .sys32_sched_get_priority_max
735         .llong .sys32_sched_get_priority_min  /* 160 */
736         .llong .sys32_sched_rr_get_interval
737         .llong .compat_sys_nanosleep
738         .llong .sys_mremap
739         .llong .sys_setresuid
740         .llong .sys_getresuid           /* 165 */
741         .llong .sys_ni_syscall          /* old query_module syscall */
742         .llong .sys_poll
743         .llong .sys32_nfsservctl
744         .llong .sys_setresgid
745         .llong .sys_getresgid           /* 170 */
746         .llong .sys32_prctl
747         .llong .ppc32_rt_sigreturn
748         .llong .sys32_rt_sigaction
749         .llong .sys32_rt_sigprocmask
750         .llong .sys32_rt_sigpending     /* 175 */
751         .llong .sys32_rt_sigtimedwait
752         .llong .sys32_rt_sigqueueinfo
753         .llong .sys32_rt_sigsuspend
754         .llong .sys32_pread64
755         .llong .sys32_pwrite64          /* 180 */
756         .llong .sys_chown
757         .llong .sys_getcwd
758         .llong .sys_capget
759         .llong .sys_capset
760         .llong .sys32_sigaltstack       /* 185 */
761         .llong .sys32_sendfile
762         .llong .sys_ni_syscall          /* reserved for streams1 */
763         .llong .sys_ni_syscall          /* reserved for streams2 */
764         .llong .sys_vfork
765         .llong .compat_sys_getrlimit            /* 190 */
766         .llong .sys32_readahead
767         .llong .sys32_mmap2
768         .llong .sys32_truncate64
769         .llong .sys32_ftruncate64
770         .llong .sys_stat64              /* 195 */
771         .llong .sys_lstat64
772         .llong .sys_fstat64
773         .llong .sys32_pciconfig_read
774         .llong .sys32_pciconfig_write
775         .llong .sys32_pciconfig_iobase  /* 200 - pciconfig_iobase */
776         .llong .sys_ni_syscall          /* reserved for MacOnLinux */
777         .llong .sys_getdents64
778         .llong .sys_pivot_root
779         .llong .compat_sys_fcntl64
780         .llong .sys_madvise             /* 205 */
781         .llong .sys_mincore
782         .llong .sys_gettid
783         .llong .sys_tkill
784         .llong .sys_setxattr
785         .llong .sys_lsetxattr           /* 210 */
786         .llong .sys_fsetxattr
787         .llong .sys_getxattr
788         .llong .sys_lgetxattr
789         .llong .sys_fgetxattr
790         .llong .sys_listxattr           /* 215 */
791         .llong .sys_llistxattr
792         .llong .sys_flistxattr
793         .llong .sys_removexattr
794         .llong .sys_lremovexattr
795         .llong .sys_fremovexattr        /* 220 */
796         .llong .compat_sys_futex
797         .llong .compat_sys_sched_setaffinity
798         .llong .compat_sys_sched_getaffinity
799         .llong .sys_ni_syscall
800         .llong .sys_ni_syscall          /* 225 - reserved for tux */
801         .llong .sys32_sendfile64
802         .llong .compat_sys_io_setup
803         .llong .sys_io_destroy
804         .llong .compat_sys_io_getevents
805         .llong .compat_sys_io_submit
806         .llong .sys_io_cancel
807         .llong .sys_set_tid_address
808         .llong .ppc32_fadvise64
809         .llong .sys_exit_group
810         .llong .ppc32_lookup_dcookie    /* 235 */
811         .llong .sys_epoll_create
812         .llong .sys_epoll_ctl
813         .llong .sys_epoll_wait
814         .llong .sys_remap_file_pages
815         .llong .ppc32_timer_create      /* 240 */
816         .llong .compat_timer_settime
817         .llong .compat_timer_gettime
818         .llong .sys_timer_getoverrun
819         .llong .sys_timer_delete
820         .llong .compat_clock_settime    /* 245 */
821         .llong .compat_clock_gettime
822         .llong .compat_clock_getres
823         .llong .compat_clock_nanosleep
824         .llong .ppc32_swapcontext
825         .llong .sys32_tgkill            /* 250 */
826         .llong .sys32_utimes
827         .llong .compat_statfs64
828         .llong .compat_fstatfs64
829         .llong .ppc32_fadvise64_64      /* 32bit only fadvise64_64 */
830         .llong .ppc_rtas                /* 255 */
831         .llong .sys_ni_syscall          /* 256 reserved for sys_debug_setcontext */
832         .llong .sys_ni_syscall          /* 257 reserved for vserver */
833         .llong .sys_ni_syscall          /* 258 reserved for new sys_remap_file_pages */
834         .llong .sys_ni_syscall          /* 259 reserved for new sys_mbind */
835         .llong .sys_ni_syscall          /* 260 reserved for new sys_get_mempolicy */
836         .llong .sys_ni_syscall          /* 261 reserved for new sys_set_mempolicy */
837         .llong .compat_sys_mq_open
838         .llong .sys_mq_unlink
839         .llong .compat_sys_mq_timedsend
840         .llong .compat_sys_mq_timedreceive /* 265 */
841         .llong .compat_sys_mq_notify
842         .llong .compat_sys_mq_getsetattr
843
844         .balign 8
845 _GLOBAL(sys_call_table)
846         .llong .sys_restart_syscall     /* 0 */
847         .llong .sys_exit
848         .llong .sys_fork
849         .llong .sys_read
850         .llong .sys_write
851         .llong .sys_open                /* 5 */
852         .llong .sys_close
853         .llong .sys_waitpid
854         .llong .sys_creat
855         .llong .sys_link
856         .llong .sys_unlink              /* 10 */
857         .llong .sys_execve
858         .llong .sys_chdir
859         .llong .sys64_time
860         .llong .sys_mknod
861         .llong .sys_chmod               /* 15 */
862         .llong .sys_lchown
863         .llong .sys_ni_syscall          /* old break syscall */
864         .llong .sys_ni_syscall          /* old stat syscall */
865         .llong .sys_lseek
866         .llong .sys_getpid              /* 20 */
867         .llong .sys_mount
868         .llong .sys_ni_syscall          /* old umount syscall */
869         .llong .sys_setuid
870         .llong .sys_getuid
871         .llong .ppc64_sys_stime         /* 25 */
872         .llong .sys_ptrace
873         .llong .sys_alarm
874         .llong .sys_ni_syscall          /* old fstat syscall */
875         .llong .sys_pause
876         .llong .sys_utime               /* 30 */
877         .llong .sys_ni_syscall          /* old stty syscall */
878         .llong .sys_ni_syscall          /* old gtty syscall */
879         .llong .sys_access
880         .llong .sys_nice
881         .llong .sys_ni_syscall          /* 35 - old ftime syscall */
882         .llong .sys_sync
883         .llong .sys_kill
884         .llong .sys_rename
885         .llong .sys_mkdir
886         .llong .sys_rmdir               /* 40 */
887         .llong .sys_dup
888         .llong .sys_pipe
889         .llong .sys_times
890         .llong .sys_ni_syscall          /* old prof syscall */
891         .llong .sys_brk                 /* 45 */
892         .llong .sys_setgid
893         .llong .sys_getgid
894         .llong .sys_signal
895         .llong .sys_geteuid
896         .llong .sys_getegid             /* 50 */
897         .llong .sys_acct
898         .llong .sys_umount
899         .llong .sys_ni_syscall          /* old lock syscall */
900         .llong .sys_ioctl
901         .llong .sys_fcntl               /* 55 */
902         .llong .sys_ni_syscall          /* old mpx syscall */
903         .llong .sys_setpgid
904         .llong .sys_ni_syscall          /* old ulimit syscall */
905         .llong .sys_ni_syscall          /* old uname syscall */
906         .llong .sys_umask               /* 60 */
907         .llong .sys_chroot
908         .llong .sys_ustat
909         .llong .sys_dup2
910         .llong .sys_getppid
911         .llong .sys_getpgrp             /* 65 */
912         .llong .sys_setsid
913         .llong .sys_ni_syscall
914         .llong .sys_sgetmask
915         .llong .sys_ssetmask
916         .llong .sys_setreuid            /* 70 */
917         .llong .sys_setregid
918         .llong .sys_ni_syscall
919         .llong .sys_ni_syscall
920         .llong .sys_sethostname
921         .llong .sys_setrlimit           /* 75 */
922         .llong .sys_ni_syscall          /* old getrlimit syscall */
923         .llong .sys_getrusage
924         .llong .sys_gettimeofday
925         .llong .sys_settimeofday
926         .llong .sys_getgroups           /* 80 */
927         .llong .sys_setgroups
928         .llong .sys_ni_syscall          /* old select syscall */
929         .llong .sys_symlink
930         .llong .sys_ni_syscall          /* old lstat syscall */
931         .llong .sys_readlink            /* 85 */
932         .llong .sys_uselib
933         .llong .sys_swapon
934         .llong .sys_reboot
935         .llong .sys_ni_syscall          /* old readdir syscall */
936         .llong .sys_mmap                /* 90 */
937         .llong .sys_munmap
938         .llong .sys_truncate
939         .llong .sys_ftruncate
940         .llong .sys_fchmod
941         .llong .sys_fchown              /* 95 */
942         .llong .sys_getpriority
943         .llong .sys_setpriority
944         .llong .sys_ni_syscall          /* old profil syscall holder */
945         .llong .sys_statfs
946         .llong .sys_fstatfs             /* 100 */
947         .llong .sys_ni_syscall          /* old ioperm syscall */
948         .llong .sys_socketcall
949         .llong .sys_syslog
950         .llong .sys_setitimer
951         .llong .sys_getitimer           /* 105 */
952         .llong .sys_newstat
953         .llong .sys_newlstat
954         .llong .sys_newfstat
955         .llong .sys_ni_syscall          /* old uname syscall */
956         .llong .sys_ni_syscall          /* 110 old iopl syscall */
957         .llong .sys_vhangup
958         .llong .sys_ni_syscall          /* old idle syscall */
959         .llong .sys_ni_syscall          /* old vm86 syscall */
960         .llong .sys_wait4
961         .llong .sys_swapoff             /* 115 */
962         .llong .sys_sysinfo
963         .llong .sys_ipc
964         .llong .sys_fsync
965         .llong .sys_ni_syscall
966         .llong .sys_clone               /* 120 */
967         .llong .sys_setdomainname
968         .llong .ppc64_newuname
969         .llong .sys_ni_syscall          /* old modify_ldt syscall */
970         .llong .sys_adjtimex
971         .llong .sys_mprotect            /* 125 */
972         .llong .sys_ni_syscall
973         .llong .sys_ni_syscall          /* old create_module syscall */
974         .llong .sys_init_module
975         .llong .sys_delete_module
976         .llong .sys_ni_syscall          /* 130 old get_kernel_syms syscall */
977         .llong .sys_quotactl
978         .llong .sys_getpgid
979         .llong .sys_fchdir
980         .llong .sys_bdflush
981         .llong .sys_sysfs               /* 135 */
982         .llong .ppc64_personality
983         .llong .sys_ni_syscall          /* for afs_syscall */
984         .llong .sys_setfsuid
985         .llong .sys_setfsgid
986         .llong .sys_llseek              /* 140 */
987         .llong .sys_getdents
988         .llong .sys_select
989         .llong .sys_flock
990         .llong .sys_msync
991         .llong .sys_readv               /* 145 */
992         .llong .sys_writev
993         .llong .sys_getsid
994         .llong .sys_fdatasync
995         .llong .sys_sysctl
996         .llong .sys_mlock               /* 150 */
997         .llong .sys_munlock
998         .llong .sys_mlockall
999         .llong .sys_munlockall
1000         .llong .sys_sched_setparam
1001         .llong .sys_sched_getparam      /* 155 */
1002         .llong .sys_sched_setscheduler
1003         .llong .sys_sched_getscheduler
1004         .llong .sys_sched_yield
1005         .llong .sys_sched_get_priority_max
1006         .llong .sys_sched_get_priority_min  /* 160 */
1007         .llong .sys_sched_rr_get_interval
1008         .llong .sys_nanosleep
1009         .llong .sys_mremap
1010         .llong .sys_setresuid
1011         .llong .sys_getresuid           /* 165 */
1012         .llong .sys_ni_syscall          /* old query_module syscall */
1013         .llong .sys_poll
1014         .llong .sys_nfsservctl
1015         .llong .sys_setresgid
1016         .llong .sys_getresgid           /* 170 */
1017         .llong .sys_prctl
1018         .llong .ppc64_rt_sigreturn
1019         .llong .sys_rt_sigaction
1020         .llong .sys_rt_sigprocmask      
1021         .llong .sys_rt_sigpending       /* 175 */
1022         .llong .sys_rt_sigtimedwait
1023         .llong .sys_rt_sigqueueinfo
1024         .llong .sys_rt_sigsuspend
1025         .llong .sys_pread64
1026         .llong .sys_pwrite64            /* 180 */
1027         .llong .sys_chown
1028         .llong .sys_getcwd
1029         .llong .sys_capget
1030         .llong .sys_capset
1031         .llong .sys_sigaltstack         /* 185 */
1032         .llong .sys_sendfile
1033         .llong .sys_ni_syscall          /* reserved for streams1 */
1034         .llong .sys_ni_syscall          /* reserved for streams2 */
1035         .llong .sys_vfork
1036         .llong .sys_getrlimit           /* 190 */
1037         .llong .sys_readahead
1038         .llong .sys_ni_syscall          /* 32bit only mmap2 */
1039         .llong .sys_ni_syscall          /* 32bit only truncate64 */
1040         .llong .sys_ni_syscall          /* 32bit only ftruncate64 */
1041         .llong .sys_ni_syscall          /* 195 - 32bit only stat64 */
1042         .llong .sys_ni_syscall          /* 32bit only lstat64 */
1043         .llong .sys_ni_syscall          /* 32bit only fstat64 */
1044         .llong .sys_ni_syscall          /* 32bit only pciconfig_read */
1045         .llong .sys_ni_syscall          /* 32bit only pciconfig_write */
1046         .llong .sys_ni_syscall          /* 32bit only pciconfig_iobase */
1047         .llong .sys_ni_syscall          /* reserved for MacOnLinux */
1048         .llong .sys_getdents64
1049         .llong .sys_pivot_root
1050         .llong .sys_ni_syscall          /* 32bit only fcntl64 */
1051         .llong .sys_madvise             /* 205 */
1052         .llong .sys_mincore
1053         .llong .sys_gettid
1054         .llong .sys_tkill
1055         .llong .sys_setxattr
1056         .llong .sys_lsetxattr           /* 210 */
1057         .llong .sys_fsetxattr
1058         .llong .sys_getxattr
1059         .llong .sys_lgetxattr
1060         .llong .sys_fgetxattr
1061         .llong .sys_listxattr           /* 215 */
1062         .llong .sys_llistxattr
1063         .llong .sys_flistxattr
1064         .llong .sys_removexattr
1065         .llong .sys_lremovexattr
1066         .llong .sys_fremovexattr        /* 220 */
1067         .llong .sys_futex
1068         .llong .sys_sched_setaffinity
1069         .llong .sys_sched_getaffinity
1070         .llong .sys_ni_syscall
1071         .llong .sys_ni_syscall          /* 225 - reserved for tux */
1072         .llong .sys_ni_syscall          /* 32bit only sendfile64 */
1073         .llong .sys_io_setup
1074         .llong .sys_io_destroy
1075         .llong .sys_io_getevents
1076         .llong .sys_io_submit           /* 230 */
1077         .llong .sys_io_cancel
1078         .llong .sys_set_tid_address
1079         .llong .sys_fadvise64
1080         .llong .sys_exit_group
1081         .llong .sys_lookup_dcookie      /* 235 */
1082         .llong .sys_epoll_create
1083         .llong .sys_epoll_ctl
1084         .llong .sys_epoll_wait
1085         .llong .sys_remap_file_pages
1086         .llong .sys_timer_create        /* 240 */
1087         .llong .sys_timer_settime
1088         .llong .sys_timer_gettime
1089         .llong .sys_timer_getoverrun
1090         .llong .sys_timer_delete
1091         .llong .sys_clock_settime       /* 245 */
1092         .llong .sys_clock_gettime
1093         .llong .sys_clock_getres
1094         .llong .sys_clock_nanosleep
1095         .llong .ppc64_swapcontext
1096         .llong .sys_tgkill              /* 250 */
1097         .llong .sys_utimes
1098         .llong .sys_statfs64
1099         .llong .sys_fstatfs64
1100         .llong .sys_ni_syscall          /* 32bit only fadvise64_64 */
1101         .llong .ppc_rtas                /* 255 */
1102         .llong .sys_ni_syscall          /* 256 reserved for sys_debug_setcontext */
1103         .llong .sys_ni_syscall          /* 257 reserved for vserver */
1104         .llong .sys_ni_syscall          /* 258 reserved for new sys_remap_file_pages */
1105         .llong .sys_ni_syscall          /* 259 reserved for new sys_mbind */
1106         .llong .sys_ni_syscall          /* 260 reserved for new sys_get_mempolicy */
1107         .llong .sys_ni_syscall          /* 261 reserved for new sys_set_mempolicy */
1108         .llong .sys_mq_open
1109         .llong .sys_mq_unlink
1110         .llong .sys_mq_timedsend
1111         .llong .sys_mq_timedreceive     /* 265 */
1112         .llong .sys_mq_notify
1113         .llong .sys_mq_getsetattr