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