Magellan Linux

Contents of /trunk/mkinitrd-magellan/klibc/usr/klibc/arch/arm/syscall.S

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (show annotations) (download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 9 months ago) by niro
File size: 961 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd

1 /*
2 * arch/arm/syscall.S
3 *
4 * System call common handling
5 */
6
7 .type __syscall_common,#function
8 .globl __syscall_common
9 #ifndef __thumb__
10 /* ARM version - this is executed after the swi, unless
11 we are compiled in EABI mode */
12
13 .balign 4
14 __syscall_common:
15 #ifdef __ARM_EABI__
16 ldr r4, [sp,#16]
17 ldr r5, [sp,#20]
18 ldr r7, [lr]
19 swi 0
20 #endif
21 cmn r0, #4096
22 rsbcs r2, r0, #0
23 ldrcs r3, 1f
24 mvncs r0, #0
25 strcs r2, [r3]
26 #ifdef __ARM_EABI__
27 ldmfd sp!,{r4,r5,r7,pc}
28 #else
29 ldmfd sp!,{r4,r5,pc}
30 #endif
31
32 .balign 4
33 1:
34 .word errno
35
36 #else
37 /* Thumb version - must still load r4 and r5 and run swi */
38
39 .thumb_func
40 .balign 2
41 __syscall_common:
42 mov r7, lr
43 ldr r4, [sp,#16]
44 sub r7, #1 /* Remove the Thumb bit */
45 ldr r5, [sp,#20]
46 ldrh r7, [r7]
47 swi 0
48 ldr r1, 2f
49 cmp r0, r1
50 bcc 1f
51 ldr r1, 3f
52 neg r2, r0
53 mov r0, #1
54 str r2, [r1]
55 neg r0, r0
56 1:
57 pop {r4,r5,r7,pc}
58
59 .balign 4
60 2:
61 .word -4095
62 3:
63 .word errno
64
65 #endif