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