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