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