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).
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
19 .type __longjmp,%function
23 mov ip, r0 /* save jmp_buf pointer */
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
31 .type _setjmp,%function
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
43 .type setjmp,%function
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
55 .type __clone,%function
64 @ new sp is already in r1
66 + swi (__NR_clone | 0x900000)
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
76 .type mmap64,%function
80 stmfd sp!, {r4, r5, lr}
84 bne .Linval @ check for overflow
87 + swi (__NR_mmap2 | 0x900000)
89 ldmccfd sp!, {r4, r5, pc}
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
97 .type __sigsetjmp,%function
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
108 .global __default_sa_restorer
109 .type __default_sa_restorer,%function
112 __default_sa_restorer:
114 + swi (__NR_sigreturn | 0x900000)
117 #ifdef __NR_rt_sigreturn
119 .global __default_rt_sa_restorer
120 .type __default_rt_sa_restorer,%function
123 __default_rt_sa_restorer:
124 - swi __NR_rt_sigreturn
125 + swi (__NR_rt_sigreturn | 0x900000)
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
134 .type vfork,%function
141 + swi (__NR_vfork | 0x900000)
143 #if defined(__THUMB_INTERWORK__)
148 /* If we don't have vfork, use fork. */
150 + swi (__NR_fork | 0x900000)
153 /* Syscal worked. Return to child/parent */