Contents of /trunk/mkinitrd-magellan/klibc/usr/klibc/arch/arm/vfork.S
Parent Directory | Revision Log
Revision 1297 -
(show annotations)
(download)
Fri May 27 15:12:11 2011 UTC (13 years ago) by niro
File size: 723 byte(s)
Fri May 27 15:12:11 2011 UTC (13 years ago) by niro
File size: 723 byte(s)
-updated to klibc-1.5.22 with mntproc definitions patch included
1 | /* |
2 | * arch/arm/vfork.S |
3 | * |
4 | * vfork - nasty system call which must not use the stack. |
5 | */ |
6 | |
7 | #include <klibc/asmmacros.h> |
8 | #include <asm/unistd.h> |
9 | |
10 | .type vfork,#function |
11 | .globl vfork |
12 | #ifndef __thumb__ |
13 | |
14 | .balign 4 |
15 | vfork: |
16 | #ifdef __ARM_EABI__ |
17 | mov r3, r7 |
18 | mov r7, # __NR_vfork |
19 | swi 0 |
20 | mov r7, r3 |
21 | #else |
22 | swi # __NR_vfork |
23 | #endif |
24 | cmn r0, #4096 |
25 | rsbcs r2, r0, #0 |
26 | ldrcs r3, 1f |
27 | mvncs r0, #0 |
28 | strcs r2, [r3] |
29 | BX(lr) |
30 | |
31 | .balign 4 |
32 | 1: |
33 | .word errno |
34 | |
35 | #else |
36 | |
37 | .thumb_func |
38 | .balign 2 |
39 | vfork: |
40 | mov r3, r7 |
41 | mov r7, # __NR_vfork |
42 | swi 0 |
43 | mov r7, r3 |
44 | ldr r1, 2f |
45 | cmp r0, r1 |
46 | bcc 1f |
47 | ldr r1, 3f |
48 | neg r2, r0 |
49 | mov r0, #1 |
50 | str r2, [r1] |
51 | neg r0, r0 |
52 | 1: |
53 | BX(lr) |
54 | |
55 | .balign 4 |
56 | 2: |
57 | .word -4095 |
58 | 3: |
59 | .word errno |
60 | |
61 | #endif |