pre-2.1.132-4..
[davej-history.git] / arch / ppc / kernel / misc.S
blob383015cf636705e11a2b0df39c95fd7b0ceeda34
1 /*
2  * This file contains miscellaneous low-level functions.
3  *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4  *
5  * Largely rewritten by Cort Dougan (cort@cs.nmt.edu)
6  * and Paul Mackerras.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version
11  * 2 of the License, or (at your option) any later version.
12  *
13  */
15 #include <linux/config.h>
16 #include <linux/sys.h>
17 #include <asm/unistd.h>
18 #include <asm/errno.h>
19 #include <asm/processor.h>
20 #include "ppc_asm.tmpl"
21 #include "ppc_defs.h"
23 #ifndef CONFIG_8xx
24 /* This instruction is not implemented on the PPC 601 or 603 */
25 #define tlbia \
26         li      r4,128; \
27         mtspr   CTR,r4; \
28         li      r4,0; \
29 0:      tlbie   r4; \
30         addi    r4,r4,0x1000; \
31         bdnz    0b
32 #endif  
33         .text
36  * Returns (address we're running at) - (address we were linked at)
37  * for use before the text and data are mapped to KERNELBASE.
38  */
39 _GLOBAL(reloc_offset)
40         mflr    r0
41         bl      1f
42 1:      mflr    r3
43         lis     r4,1b@ha
44         addi    r4,r4,1b@l
45         subf    r3,r4,r3
46         mtlr    r0
47         blr
50  * Disable interrupts
51  *      rc = _disable_interrupts()
52  */
53 _GLOBAL(_disable_interrupts)
54 _GLOBAL(__cli)
55 _GLOBAL(_hard_cli)
56         mfmsr   r0              /* Get current interrupt state */
57         rlwinm  r3,r0,16+1,32-1,31      /* Extract old value of 'EE' */
58         li      r4,0            /* Need [unsigned] value of MSR_EE */
59         ori     r4,r4,MSR_EE    /* Set to turn off bit */
60         andc    r0,r0,r4        /* Clears bit in (r4) */
61         sync                    /* Some chip revs have problems here... */
62         mtmsr   r0              /* Update machine state */
63         blr                     /* Done */
66  * Enable interrupts
67  *      _enable_interrupts(int state)
68  * turns on interrupts if state = 1.
69  */
70 _GLOBAL(_enable_interrupts)
71         cmpi    0,r3,0          /* turning them on? */
72         beqlr                   /* nothing to do if state == 0 */
73 _GLOBAL(__sti)
74 _GLOBAL(_hard_sti)
75         lis     r4,n_lost_interrupts@ha
76         lwz     r4,n_lost_interrupts@l(r4)
77         mfmsr   r3              /* Get current state */
78         ori     r3,r3,MSR_EE    /* Turn on 'EE' bit */
79         cmpi    0,r4,0          /* lost interrupts to process first? */
80         bne-    do_lost_interrupts
81         sync                    /* Some chip revs have problems here... */
82         mtmsr   r3              /* Update machine state */
83         blr
86  * We were about to enable interrupts but we have to simulate
87  * some interrupts that were lost by enable_irq first.
88  */
89         .globl do_lost_interrupts
90 do_lost_interrupts:
91         stwu    r1,-16(r1)
92         mflr    r0
93         stw     r0,20(r1)
94         stw     r3,8(r1)
95 1:      bl      fake_interrupt
96         lis     r4,n_lost_interrupts@ha
97         lwz     r4,n_lost_interrupts@l(r4)
98         cmpi    0,r4,0
99         bne-    1b
100         lwz     r3,8(r1)
101         sync
102         mtmsr   r3
103         lwz     r0,20(r1)
104         mtlr    r0
105         addi    r1,r1,16
106         blr
109  * Flush MMU TLB
110  */
111 _GLOBAL(_tlbia)
112         tlbia
113         blr     
116  * Flush MMU TLB for a particular address
117  */
118 _GLOBAL(_tlbie)
119         tlbie   r3
120         blr
122  * Atomic [test&set] exchange
124  *      void *xchg_u32(void *ptr, unsigned long val)
125  * Changes the memory location '*ptr' to be val and returns
126  * the previous value stored there.
127  */
128 _GLOBAL(xchg_u32)
129         mr      r5,r3           /* Save pointer */
130 10:     lwarx   r3,0,r5         /* Fetch old value & reserve */
131         stwcx.  r4,0,r5         /* Update with new value */
132         bne-    10b             /* Retry if "reservation" (i.e. lock) lost */
133         blr
136  * Atomic add/sub/inc/dec operations
138  * void atomic_add(int c, int *v)
139  * void atomic_sub(int c, int *v)
140  * void atomic_inc(int *v)
141  * void atomic_dec(int *v)
142  * int atomic_dec_and_test(int *v)
143  * int atomic_inc_return(int *v)
144  * int atomic_dec_return(int *v)
145  * void atomic_clear_mask(atomic_t mask, atomic_t *addr)
146  * void atomic_set_mask(atomic_t mask, atomic_t *addr);
147  */
148 _GLOBAL(atomic_add)
149 10:     lwarx   r5,0,r4         /* Fetch old value & reserve */
150         add     r5,r5,r3        /* Perform 'add' operation */
151         stwcx.  r5,0,r4         /* Update with new value */
152         bne-    10b             /* Retry if "reservation" (i.e. lock) lost */
153         blr
154 _GLOBAL(atomic_add_return)
155 10:     lwarx   r5,0,r4         /* Fetch old value & reserve */
156         add     r5,r5,r3        /* Perform 'add' operation */
157         stwcx.  r5,0,r4         /* Update with new value */
158         bne-    10b             /* Retry if "reservation" (i.e. lock) lost */
159         mr      r3,r5
160         blr
161 _GLOBAL(atomic_sub)
162 10:     lwarx   r5,0,r4         /* Fetch old value & reserve */
163         sub     r5,r5,r3        /* Perform 'add' operation */
164         stwcx.  r5,0,r4         /* Update with new value */
165         bne-    10b             /* Retry if "reservation" (i.e. lock) lost */
166         blr
167 _GLOBAL(atomic_inc)
168 10:     lwarx   r5,0,r3         /* Fetch old value & reserve */
169         addi    r5,r5,1         /* Perform 'add' operation */
170         stwcx.  r5,0,r3         /* Update with new value */
171         bne-    10b             /* Retry if "reservation" (i.e. lock) lost */
172         blr
173 _GLOBAL(atomic_inc_return)
174 10:     lwarx   r5,0,r3         /* Fetch old value & reserve */
175         addi    r5,r5,1         /* Perform 'add' operation */
176         stwcx.  r5,0,r3         /* Update with new value */
177         bne-    10b             /* Retry if "reservation" (i.e. lock) lost */
178         mr      r3,r5           /* Return new value */
179         blr
180 _GLOBAL(atomic_dec)
181 10:     lwarx   r5,0,r3         /* Fetch old value & reserve */
182         subi    r5,r5,1         /* Perform 'add' operation */
183         stwcx.  r5,0,r3         /* Update with new value */
184         bne-    10b             /* Retry if "reservation" (i.e. lock) lost */
185         blr
186 _GLOBAL(atomic_dec_return)
187 10:     lwarx   r5,0,r3         /* Fetch old value & reserve */
188         subi    r5,r5,1         /* Perform 'add' operation */
189         stwcx.  r5,0,r3         /* Update with new value */
190         bne-    10b             /* Retry if "reservation" (i.e. lock) lost */
191         mr      r3,r5           /* Return new value */
192         blr
193 _GLOBAL(atomic_dec_and_test)
194 10:     lwarx   r5,0,r3         /* Fetch old value & reserve */
195         subi    r5,r5,1         /* Perform 'add' operation */
196         stwcx.  r5,0,r3         /* Update with new value */
197         bne-    10b             /* Retry if "reservation" (i.e. lock) lost */
198         cmpi    0,r5,0          /* Return 'true' IFF 0 */
199         li      r3,1
200         beqlr
201         li      r3,0
202         blr
203 _GLOBAL(atomic_clear_mask)
204 10:     lwarx   r5,0,r4
205         andc    r5,r5,r3
206         stwcx.  r5,0,r4
207         bne-    10b
208         blr
209 _GLOBAL(atomic_set_mask)
210 10:     lwarx   r5,0,r4
211         or      r5,r5,r3
212         stwcx.  r5,0,r4
213         bne-    10b
214         blr
217  * I/O string operations
219  * insb(port, buf, len)
220  * outsb(port, buf, len)
221  * insw(port, buf, len)
222  * outsw(port, buf, len)
223  * insl(port, buf, len)
224  * outsl(port, buf, len)
225  * insw_ns(port, buf, len)
226  * outsw_ns(port, buf, len)
227  * insl_ns(port, buf, len)
228  * outsl_ns(port, buf, len)
230  * The *_ns versions don't do byte-swapping.
231  */
232 _GLOBAL(_insb)
233         mtctr   r5
234         subi    r4,r4,1
235 00:     lbz     r5,0(r3)
236         eieio
237         stbu    r5,1(r4)
238         bdnz    00b
239         blr
241 _GLOBAL(_outsb)
242         mtctr   r5
243         subi    r4,r4,1
244 00:     lbzu    r5,1(r4)
245         stb     r5,0(r3)
246         eieio
247         bdnz    00b
248         blr     
250 _GLOBAL(_insw)
251         mtctr   r5
252         subi    r4,r4,2
253 00:     lhbrx   r5,0,r3
254         eieio
255         sthu    r5,2(r4)
256         bdnz    00b
257         blr
259 _GLOBAL(_outsw)
260         mtctr   r5
261         subi    r4,r4,2
262 00:     lhzu    r5,2(r4)
263         eieio
264         sthbrx  r5,0,r3 
265         bdnz    00b
266         blr     
268 _GLOBAL(_insl)
269         mtctr   r5
270         subi    r4,r4,4
271 00:     lwbrx   r5,0,r3
272         eieio
273         stwu    r5,4(r4)
274         bdnz    00b
275         blr
277 _GLOBAL(_outsl)
278         mtctr   r5
279         subi    r4,r4,4
280 00:     lwzu    r5,4(r4)
281         stwbrx  r5,0,r3
282         eieio
283         bdnz    00b
284         blr     
286 _GLOBAL(ide_insw)
287 _GLOBAL(_insw_ns)
288         mtctr   r5
289         subi    r4,r4,2
290 00:     lhz     r5,0(r3)
291         eieio
292         sthu    r5,2(r4)
293         bdnz    00b
294         blr
296 _GLOBAL(ide_outsw)
297 _GLOBAL(_outsw_ns)
298         mtctr   r5
299         subi    r4,r4,2
300 00:     lhzu    r5,2(r4)
301         sth     r5,0(r3)
302         eieio
303         bdnz    00b
304         blr     
306 _GLOBAL(_insl_ns)
307         mtctr   r5
308         subi    r4,r4,4
309 00:     lwz     r5,0(r3)
310         eieio
311         stwu    r5,4(r4)
312         bdnz    00b
313         blr
315 _GLOBAL(_outsl_ns)
316         mtctr   r5
317         subi    r4,r4,4
318 00:     lwzu    r5,4(r4)
319         stw     r5,0(r3)
320         eieio
321         bdnz    00b
322         blr     
325  * Extended precision shifts
327  * R3/R4 has 64 bit value
328  * R5    has shift count
329  * result in R3/R4
331  *  ashrdi3:     XXXYYY/ZZZAAA -> SSSXXX/YYYZZZ
332  *  ashldi3:     XXXYYY/ZZZAAA -> YYYZZZ/AAA000
333  */
334 _GLOBAL(__ashrdi3)
335         li      r6,32
336         sub     r6,r6,r5
337         slw     r7,r3,r6        /* isolate YYY */
338         srw     r4,r4,r5        /* isolate ZZZ */
339         or      r4,r4,r7        /* YYYZZZ */
340         sraw    r3,r3,r5        /* SSSXXX */
341         blr
342         
343 _GLOBAL(__ashldi3)
344         li      r6,32
345         sub     r6,r6,r5
346         srw     r7,r4,r6        /* isolate ZZZ */
347         slw     r4,r4,r5        /* AAA000 */
348         slw     r3,r3,r5        /* YYY--- */
349         or      r3,r3,r7        /* YYYZZZ */
350         blr
352 _GLOBAL(abs)
353         cmpi    0,r3,0
354         bge     10f
355         neg     r3,r3
356 10:     blr
358 _GLOBAL(_get_SP)
359         mr      r3,r1           /* Close enough */
360         blr
362 _GLOBAL(_get_THRM1)
363         mfspr   r3,THRM1
364         blr
366 _GLOBAL(_get_THRM2)
367         mfspr   r3,THRM2
368         blr
370 _GLOBAL(_get_THRM3)
371         mfspr   r3,THRM3
372         blr
373                 
374 _GLOBAL(_set_THRM1)
375         mtspr   THRM1,r3
376         blr
378 _GLOBAL(_set_THRM2)
379         mtspr   THRM2,r3
380         blr
382 _GLOBAL(_set_THRM3)
383         mtspr   THRM3,r3
384         blr
385         
386 _GLOBAL(_get_PVR)
387         mfspr   r3,PVR
388         blr
390         L2CR functions
391         Copyright Â© 1997-1998 by PowerLogix R & D, Inc.
392         
393         This program is free software; you can redistribute it and/or modify
394         it under the terms of the GNU General Public License as published by
395         the Free Software Foundation; either version 2 of the License, or
396         (at your option) any later version.
397         
398         This program is distributed in the hope that it will be useful,
399         but WITHOUT ANY WARRANTY; without even the implied warranty of
400         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
401         GNU General Public License for more details.
402         
403         You should have received a copy of the GNU General Public License
404         along with this program; if not, write to the Free Software
405         Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
408         Thur, Dec. 12, 1998.
409         - First public release, contributed by PowerLogix.
410         
411         Author: Terry Greeniaus (tgree@phys.ualberta.ca)
412         Please e-mail updates to this file to me, thanks!
415 _GLOBAL(_set_L2CR)
416         /* Usage:
417         
418                 When setting the L2CR register, you must do a few special things.  If you are enabling the
419                 cache, you must perform a global invalidate.  If you are disabling the cache, you must
420                 flush the cache contents first.  This routine takes care of doing these things.  When first
421                 enabling the cache, make sure you pass in the L2CR you want, as well as passing in the
422                 global invalidate bit set.  A global invalidate will only be performed if the L2I bit is set
423                 in applyThis.  When enabling the cache, you should also set the L2E bit in applyThis.  If you
424                 want to modify the L2CR contents after the cache has been enabled, the recommended
425                 procedure is to first call __setL2CR(0) to disable the cache and then call it again with
426                 the new values for L2CR.  Examples:
427         
428                         _setL2CR(0)                     -       disables the cache
429                         _setL2CR(0xB3A04000)            -       enables my G3 upgrade card:
430                                                         -       L2E set to turn on the cache
431                                                         -       L2SIZ set to 1MB
432                                                         -       L2CLK set to 1:1
433                                                         -       L2RAM set to pipelined syncronous late-write
434                                                         -       L2I set to perform a global invalidation
435                                                         -       L2OH set to 0.5 nS
436                                                         -       L2DF set because this upgrade card requires it
437         
438                 A similar call should work for your card.  You need to know the correct setting for your
439                 card and then place them in the fields I have outlined above.  Other fields support optional
440                 features, such as L2DO which caches only data, or L2TS which causes cache pushes from
441                 the L1 cache to go to the L2 cache instead of to main memory.
442         */
443         
444         /* Make sure this is a 750 chip */
445         mfspr   r4,PVR
446         rlwinm  r4,r4,16,16,31
447         cmplwi  r4,0x0008
448         beq     thisIs750
449         li      r3,-1
450         blr
451         
452 thisIs750:
453         /* Get the current enable bit of the L2CR into r4 */
454         mfspr   r4,L2CR
455         rlwinm  r4,r4,0,0,0
456         
457         /* See if we want to perform a global inval this time. */
458         rlwinm  r6,r3,0,10,10           /* r6 contains the new invalidate bit */
459         rlwinm. r5,r3,0,0,0             /* r5 contains the new enable bit */
460         rlwinm  r3,r3,0,11,9            /* Turn off the invalidate bit */
461         rlwinm  r3,r3,0,1,31            /* Turn off the enable bit */
462         or      r3,r3,r4                /* Keep the enable bit the same as it was for now. */
463         bne     dontDisableCache        /* Only disable the cache if L2CRApply has the enable bit off */
465 disableCache:
466         /* Disable the cache.  First, we turn off data relocation. */
467         mfmsr   r7
468         rlwinm  r4,r7,0,28,26           /* Turn off DR bit */
469         rlwinm  r4,r4,0,17,15           /* Turn off EE bit - an external exception while we are flushing
470                                            the cache is fatal (comment this line and see!) */
471         sync
472         mtmsr   r4
473         sync
474         
475         /*
476                 Now, read the first 2MB of memory to put new data in the cache.
477                 (Actually we only need the size of the L2 cache plus
478                 the size of the L1 cache, but 2MB will cover everything just to be safe).
479         */
480         lis     r4,0x0001
481         mtctr   r4
482         li      r4,0
483 loadLoop:
484         lwzx    r0,r0,r4
485         addi    r4,r4,0x0020            /* Go to start of next cache line */
486         bdnz    loadLoop
487         
488         /* Now, flush the first 2MB of memory */
489         lis     r4,0x0001
490         mtctr   r4
491         li      r4,0
492         sync
493 flushLoop:
494         dcbf    r0,r4
495         addi    r4,r4,0x0020    /* Go to start of next cache line */
496         bdnz    flushLoop
497         
498         /* Turn off the L2CR enable bit. */
499         rlwinm  r3,r3,0,1,31
500         
501         /* Reenable data relocation. */
502         sync
503         mtmsr   r7
504         sync
505         
506 dontDisableCache:
507         /* Set up the L2CR configuration bits */
508         sync
509         mtspr   L2CR,r3
510         sync
511         cmplwi  r6,0
512         beq     noInval
513         
514         /* Perform a global invalidation */
515         oris    r3,r3,0x0020
516         sync
517         mtspr   1017,r3
518         sync
519 invalCompleteLoop:                      /* Wait for the invalidation to complete */
520         mfspr   r3,1017
521         rlwinm. r4,r3,0,31,31
522         bne     invalCompleteLoop
523         
524         rlwinm  r3,r3,0,11,9;           /* Turn off the L2I bit */
525         sync
526         mtspr   L2CR,r3
527         sync
528         
529 noInval:
530         /* See if we need to enable the cache */
531         cmplwi  r5,0
532         beqlr
533         
534 enableCache:
535         /* Enable the cache */
536         oris    r3,r3,0x8000
537         mtspr   L2CR,r3
538         sync
539         blr
541 _GLOBAL(_get_L2CR)
542         /* Make sure this is a 750 chip */
543         mfspr   r3,PVR
544         rlwinm  r3,r3,16,16,31
545         cmplwi  r3,0x0008
546         li      r3,0
547         bnelr
548         
549         /* Return the L2CR contents */
550         mfspr   r3,L2CR
551         blr
553 /* --- End of PowerLogix code ---
554  */
557 _GLOBAL(_get_L2CR)
558         mfspr   r3,L2CR
559         blr
561 _GLOBAL(_set_L2CR)
562         mtspr   L2CR,r3
563         blr
564                 
568  * These are used in the alignment trap handler when emulating
569  * single-precision loads and stores.
570  * We restore and save the fpscr so the task gets the same result
571  * and exceptions as if the cpu had performed the load or store.
572  */
573 _GLOBAL(cvt_fd)
574 cvt_fd:
575         lfd     0,-4(r5)        /* load up fpscr value */
576         mtfsf   0xff,0
577         lfs     0,0(r3)
578         stfd    0,0(r4)
579         mffs    0               /* save new fpscr value */
580         stfd    0,-4(r5)
581         blr
583 _GLOBAL(cvt_df)
584 cvt_df:
585         lfd     0,-4(r5)        /* load up fpscr value */
586         mtfsf   0xff,0
587         lfd     0,0(r3)
588         stfs    0,0(r4)
589         mffs    0               /* save new fpscr value */
590         stfd    0,-4(r5)
591         blr
594  * Fetch the current SR register
595  *   get_SR(int index)
596  */
597 _GLOBAL(get_SR)
598         mfsrin  r4,r3
599         mr      r3,r4
600         blr
603  * Create a kernel thread
604  *   __kernel_thread(flags, fn, arg)
605  */
606 _GLOBAL(__kernel_thread)
607         li      r0,__NR_clone
608         sc
609         cmpi    0,r3,0          /* parent or child? */
610         bnelr                   /* return if parent */
611         mtlr    r4              /* fn addr in lr */
612         mr      r3,r5           /* load arg and call fn */
613 #if 0/*def __SMP__*/
614         /* drop scheduler_lock since schedule() called us */
615         lis     r4,scheduler_lock@ha
616         li      r5,0
617         stw     r5,scheduler_lock@l+4(r4)       /* owner_pc */
618         stw     r5,scheduler_lock@l+8(r4)       /* owner_cpu */
619         stw     r5,scheduler_lock@l(r4)
620         sync
621         isync
622 #endif /* __SMP__ */
623         blrl
624         li      r0,__NR_exit    /* exit after child exits */
625         li      r3,0
626         sc
628 #define SYSCALL(name) \
629 _GLOBAL(name) \
630         li      r0,__NR_##name; \
631         sc; \
632         bnslr; \
633         lis     r4,errno@ha; \
634         stw     r3,errno@l(r4); \
635         li      r3,-1; \
636         blr
638 #define __NR__exit __NR_exit
640 SYSCALL(idle)
641 SYSCALL(sync)
642 SYSCALL(setsid)
643 SYSCALL(write)
644 SYSCALL(dup)
645 SYSCALL(execve)
646 SYSCALL(open)
647 SYSCALL(close)
648 SYSCALL(waitpid)
649 SYSCALL(fork)
650 SYSCALL(delete_module)
651 SYSCALL(_exit)
652 SYSCALL(lseek)
653 SYSCALL(read)
655 /* Why isn't this a) automatic, b) written in 'C'? */   
656         .data
657         .align 4
658         .globl  sys_call_table
659 sys_call_table:
660         .long sys_ni_syscall    /* 0  -  old "setup()" system call */
661         .long sys_exit
662         .long sys_fork
663         .long sys_read
664         .long sys_write
665         .long sys_open          /* 5 */
666         .long sys_close
667         .long sys_waitpid
668         .long sys_creat
669         .long sys_link
670         .long sys_unlink        /* 10 */
671         .long sys_execve
672         .long sys_chdir
673         .long sys_time
674         .long sys_mknod
675         .long sys_chmod         /* 15 */
676         .long sys_lchown
677         .long sys_ni_syscall                    /* old break syscall holder */
678         .long sys_stat
679         .long sys_lseek
680         .long sys_getpid        /* 20 */
681         .long sys_mount
682         .long sys_oldumount
683         .long sys_setuid
684         .long sys_getuid
685         .long sys_stime         /* 25 */
686         .long sys_ptrace
687         .long sys_alarm
688         .long sys_fstat
689         .long sys_pause
690         .long sys_utime         /* 30 */
691         .long sys_ni_syscall                    /* old stty syscall holder */
692         .long sys_ni_syscall                    /* old gtty syscall holder */
693         .long sys_access
694         .long sys_nice
695         .long sys_ni_syscall    /* 35 */        /* old ftime syscall holder */
696         .long sys_sync
697         .long sys_kill
698         .long sys_rename
699         .long sys_mkdir
700         .long sys_rmdir         /* 40 */
701         .long sys_dup
702         .long sys_pipe
703         .long sys_times
704         .long sys_ni_syscall                    /* old prof syscall holder */
705         .long sys_brk           /* 45 */
706         .long sys_setgid
707         .long sys_getgid
708         .long sys_signal
709         .long sys_geteuid
710         .long sys_getegid       /* 50 */
711         .long sys_acct
712         .long sys_umount                        /* recycled never used phys() */
713         .long sys_ni_syscall                    /* old lock syscall holder */
714         .long sys_ioctl
715         .long sys_fcntl         /* 55 */
716         .long sys_ni_syscall                    /* old mpx syscall holder */
717         .long sys_setpgid
718         .long sys_ni_syscall                    /* old ulimit syscall holder */
719         .long sys_olduname
720         .long sys_umask         /* 60 */
721         .long sys_chroot
722         .long sys_ustat
723         .long sys_dup2
724         .long sys_getppid
725         .long sys_getpgrp       /* 65 */
726         .long sys_setsid
727         .long sys_sigaction
728         .long sys_sgetmask
729         .long sys_ssetmask
730         .long sys_setreuid      /* 70 */
731         .long sys_setregid
732         .long sys_sigsuspend
733         .long sys_sigpending
734         .long sys_sethostname
735         .long sys_setrlimit     /* 75 */
736         .long sys_getrlimit
737         .long sys_getrusage
738         .long sys_gettimeofday
739         .long sys_settimeofday
740         .long sys_getgroups     /* 80 */
741         .long sys_setgroups
742         .long ppc_select
743         .long sys_symlink
744         .long sys_lstat
745         .long sys_readlink      /* 85 */
746         .long sys_uselib
747         .long sys_swapon
748         .long sys_reboot
749         .long old_readdir
750         .long sys_mmap          /* 90 */
751         .long sys_munmap
752         .long sys_truncate
753         .long sys_ftruncate
754         .long sys_fchmod
755         .long sys_fchown        /* 95 */
756         .long sys_getpriority
757         .long sys_setpriority
758         .long sys_ni_syscall                    /* old profil syscall holder */
759         .long sys_statfs
760         .long sys_fstatfs       /* 100 */
761         .long sys_ioperm
762         .long sys_socketcall
763         .long sys_syslog
764         .long sys_setitimer
765         .long sys_getitimer     /* 105 */
766         .long sys_newstat
767         .long sys_newlstat
768         .long sys_newfstat
769         .long sys_uname
770         .long sys_iopl          /* 110 */
771         .long sys_vhangup
772         .long sys_idle
773         .long sys_vm86
774         .long sys_wait4
775         .long sys_swapoff       /* 115 */
776         .long sys_sysinfo
777         .long sys_ipc
778         .long sys_fsync
779         .long sys_sigreturn
780         .long sys_clone         /* 120 */
781         .long sys_setdomainname
782         .long sys_newuname
783         .long sys_modify_ldt
784         .long sys_adjtimex
785         .long sys_mprotect      /* 125 */
786         .long sys_sigprocmask
787         .long sys_create_module
788         .long sys_init_module
789         .long sys_delete_module
790         .long sys_get_kernel_syms       /* 130 */
791         .long sys_quotactl
792         .long sys_getpgid
793         .long sys_fchdir
794         .long sys_bdflush
795         .long sys_sysfs         /* 135 */
796         .long sys_personality
797         .long sys_ni_syscall    /* for afs_syscall */
798         .long sys_setfsuid
799         .long sys_setfsgid
800         .long sys_llseek        /* 140 */
801         .long sys_getdents
802         .long ppc_select
803         .long sys_flock
804         .long sys_msync
805         .long sys_readv         /* 145 */
806         .long sys_writev
807         .long sys_getsid
808         .long sys_fdatasync
809         .long sys_sysctl
810         .long sys_mlock         /* 150 */
811         .long sys_munlock
812         .long sys_mlockall
813         .long sys_munlockall
814         .long sys_sched_setparam
815         .long sys_sched_getparam        /* 155 */
816         .long sys_sched_setscheduler
817         .long sys_sched_getscheduler
818         .long sys_sched_yield
819         .long sys_sched_get_priority_max
820         .long sys_sched_get_priority_min  /* 160 */
821         .long sys_sched_rr_get_interval
822         .long sys_nanosleep
823         .long sys_mremap
824         .long sys_setresuid
825         .long sys_getresuid     /* 165 */
826         .long sys_query_module
827         .long sys_poll
828         .long sys_nfsservctl
829         .long sys_setresgid
830         .long sys_getresgid     /* 170 */
831         .long sys_prctl
832         .long sys_rt_sigreturn
833         .long sys_rt_sigaction
834         .long sys_rt_sigprocmask        
835         .long sys_rt_sigpending /* 175 */
836         .long sys_rt_sigtimedwait
837         .long sys_rt_sigqueueinfo
838         .long sys_rt_sigsuspend
839         .long sys_pread
840         .long sys_pwrite        /* 180 */
841         .long sys_chown
842         .long sys_getcwd
843         .long sys_capget
844         .long sys_capset
845         .long sys_sigaltstack   /* 185 */
846         .long sys_sendfile
847         .long sys_ni_syscall            /* streams1 */
848         .long sys_ni_syscall            /* streams2 */
849         .space (NR_syscalls-183)*4