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