]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/uclibc/uclibc-0.9.28/thumb-asm-swi.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / uclibc / uclibc-0.9.28 / thumb-asm-swi.patch
1 # WARNING: nasty hack.  Because sysnum.h produces thumb syscall
2 # numbers when compiled in thumb mode the arm assembler (which is arm
3 # even in thumb mode) needs to write the OS syscall base back into
4 # the swi calls.  This is done here just by orring in the correct
5 # value.  This is a hack - it might be better to add a define to
6 # sysnum.h to force it to output arm (not thumb) values on demand -
7 # but this hack is fairly safe (rmk would have to change the syscall
8 # base, this seems unlikely).
9 #
10 # The patch also fixes up the .align directives to '2' (i.e. a multiple
11 # of 4) not '4' (a multiple of 16 - apparently an error since it seems
12 # to be unnecessary, there is no advantage here in cache line alignment).
13 diff -u uClibc-0.9.28/libc/sysdeps/linux/arm/orig/__longjmp.S uClibc-0.9.28/libc/sysdeps/linux/arm/__longjmp.S
14 --- uClibc-0.9.28/libc/sysdeps/linux/arm/orig/__longjmp.S       2005-09-18 18:41:36.870986621 -0700
15 +++ uClibc-0.9.28/libc/sysdeps/linux/arm/__longjmp.S    2005-09-18 19:01:26.741860474 -0700
16 @@ -25,7 +25,7 @@
17  
18  .global __longjmp
19  .type __longjmp,%function
20 -.align 4
21 +.align 2
22  __longjmp:
23         mov     ip, r0          /* save jmp_buf pointer */
24         
25 diff -u uClibc-0.9.28/libc/sysdeps/linux/arm/orig/bsd-_setjmp.S uClibc-0.9.28/libc/sysdeps/linux/arm/bsd-_setjmp.S
26 --- uClibc-0.9.28/libc/sysdeps/linux/arm/orig/bsd-_setjmp.S     2005-09-18 18:41:36.870986621 -0700
27 +++ uClibc-0.9.28/libc/sysdeps/linux/arm/bsd-_setjmp.S  2005-09-18 19:01:31.982190228 -0700
28 @@ -27,7 +27,7 @@
29  
30  .global _setjmp
31  .type _setjmp,%function
32 -.align 4
33 +.align 2
34  _setjmp:
35         mov     r1, #0
36  #ifdef __PIC__
37 diff -u uClibc-0.9.28/libc/sysdeps/linux/arm/orig/bsd-setjmp.S uClibc-0.9.28/libc/sysdeps/linux/arm/bsd-setjmp.S
38 --- uClibc-0.9.28/libc/sysdeps/linux/arm/orig/bsd-setjmp.S      2005-09-18 18:41:36.870986621 -0700
39 +++ uClibc-0.9.28/libc/sysdeps/linux/arm/bsd-setjmp.S   2005-09-18 19:01:40.166705247 -0700
40 @@ -27,7 +27,7 @@
41  
42  .global setjmp
43  .type setjmp,%function
44 -.align 4
45 +.align 2
46  setjmp:
47         mov     r1, #1
48  #ifdef __PIC__
49 diff -u uClibc-0.9.28/libc/sysdeps/linux/arm/orig/clone.S uClibc-0.9.28/libc/sysdeps/linux/arm/clone.S
50 --- uClibc-0.9.28/libc/sysdeps/linux/arm/orig/clone.S   2005-09-18 18:41:36.870986621 -0700
51 +++ uClibc-0.9.28/libc/sysdeps/linux/arm/clone.S        2005-09-18 19:01:45.427036258 -0700
52 @@ -30,7 +30,7 @@
53  .text
54  .global __clone
55  .type __clone,%function
56 -.align 4
57 +.align 2
58  __clone:
59         @ sanity check args
60         cmp     r0, #0
61 @@ -48,7 +48,7 @@
62         @ get flags
63         mov     r0, r2
64         @ new sp is already in r1
65 -       swi     __NR_clone
66 +       swi     (__NR_clone | 0x900000)
67         movs    a1, a1
68         blt     __error
69  #if defined(__THUMB_INTERWORK__)
70 diff -u uClibc-0.9.28/libc/sysdeps/linux/arm/orig/mmap64.S uClibc-0.9.28/libc/sysdeps/linux/arm/mmap64.S
71 --- uClibc-0.9.28/libc/sysdeps/linux/arm/orig/mmap64.S  2005-09-18 18:41:36.874986873 -0700
72 +++ uClibc-0.9.28/libc/sysdeps/linux/arm/mmap64.S       2005-09-18 19:02:03.692185612 -0700
73 @@ -27,7 +27,7 @@
74  .text
75  .global mmap64
76  .type mmap64,%function
77 -.align 4
78 +.align 2
79  mmap64:
80         stmfd   sp!, {r4, r5, lr}
81         ldr     r5, [sp, $16]
82 @@ -40,7 +40,7 @@
83         movs    ip, ip, lsr $12
84         bne     .Linval                 @ check for overflow
85         mov     ip, r0
86 -       swi     __NR_mmap2
87 +       swi     (__NR_mmap2 | 0x900000)
88         cmn     r0, $4096
89         ldmccfd sp!, {r4, r5, pc}
90         cmn     r0, $ENOSYS
91 diff -u uClibc-0.9.28/libc/sysdeps/linux/arm/orig/setjmp.S uClibc-0.9.28/libc/sysdeps/linux/arm/setjmp.S
92 --- uClibc-0.9.28/libc/sysdeps/linux/arm/orig/setjmp.S  2005-09-18 18:41:36.874986873 -0700
93 +++ uClibc-0.9.28/libc/sysdeps/linux/arm/setjmp.S       2005-09-18 19:02:08.956516875 -0700
94 @@ -24,7 +24,7 @@
95  
96  .global __sigsetjmp
97  .type __sigsetjmp,%function
98 -.align 4
99 +.align 2
100  __sigsetjmp:
101         /* Save registers */
102  #if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__
103 diff -u uClibc-0.9.28/libc/sysdeps/linux/arm/orig/sigrestorer.S uClibc-0.9.28/libc/sysdeps/linux/arm/sigrestorer.S
104 --- uClibc-0.9.28/libc/sysdeps/linux/arm/orig/sigrestorer.S     2005-09-18 18:41:36.874986873 -0700
105 +++ uClibc-0.9.28/libc/sysdeps/linux/arm/sigrestorer.S  2005-09-18 19:02:18.041088531 -0700
106 @@ -24,17 +24,17 @@
107  
108  .global __default_sa_restorer
109  .type __default_sa_restorer,%function
110 -.align 4
111 +.align 2
112  __default_sa_restorer:
113 -       swi     __NR_sigreturn
114 +       swi     (__NR_sigreturn | 0x900000)
115  
116  
117  #ifdef __NR_rt_sigreturn
118  
119  .global __default_rt_sa_restorer
120  .type __default_rt_sa_restorer,%function
121 -.align 4
122 +.align 2
123  __default_rt_sa_restorer:
124 -       swi     __NR_rt_sigreturn
125 +       swi     (__NR_rt_sigreturn | 0x900000)
126  
127  #endif
128 diff -u uClibc-0.9.28/libc/sysdeps/linux/arm/orig/vfork.S uClibc-0.9.28/libc/sysdeps/linux/arm/vfork.S
129 --- uClibc-0.9.28/libc/sysdeps/linux/arm/orig/vfork.S   2005-09-18 18:41:36.874986873 -0700
130 +++ uClibc-0.9.28/libc/sysdeps/linux/arm/vfork.S        2005-09-18 19:02:23.561435905 -0700
131 @@ -28,11 +28,11 @@
132  .text
133  .global vfork
134  .type vfork,%function
135 -.align 4
136 +.align 2
137  vfork:
138  
139  #ifdef __NR_vfork
140 -       swi     __NR_vfork
141 +       swi     (__NR_vfork | 0x900000)
142         cmn     r0, #4096
143  #if defined(__THUMB_INTERWORK__)
144         bxcc    lr
145 @@ -47,7 +47,7 @@
146  #endif
147  
148         /* If we don't have vfork, use fork.  */
149 -       swi     __NR_fork
150 +       swi     (__NR_fork | 0x900000)
151         cmn     r0, #4096
152  
153         /* Syscal worked.  Return to child/parent */