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