summaryrefslogtreecommitdiff
path: root/recipes/uclibc/uclibc-git/thumb-asm-swi.patch
blob: d09e40b7a3c1b542b0a049d0190ab7d9a88684d2 (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
154
# 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/libc/sysdeps/linux/arm/orig/clone.S uClibc/libc/sysdeps/linux/arm/clone.S
--- uClibc/libc/sysdeps/linux/arm/clone.S.orig	2006-01-19 19:36:36.754757577 -0800
+++ uClibc/libc/sysdeps/linux/arm/clone.S	2006-01-19 19:42:59.885757030 -0800
@@ -31,7 +31,7 @@
 .text
 .global clone
 .type clone,%function
-.align 4
+.align 2
 clone:
 	@ sanity check args
 	cmp	r0, #0
@@ -49,7 +49,7 @@ clone:
 	@ 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/libc/sysdeps/linux/arm/orig/vfork.S uClibc/libc/sysdeps/linux/arm/vfork.S
--- uClibc/libc/sysdeps/linux/arm/vfork.S.orig	2006-01-19 19:36:36.754757577 -0800
+++ uClibc/libc/sysdeps/linux/arm/vfork.S	2006-01-19 19:43:47.709756961 -0800
@@ -18,12 +18,12 @@
 .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
@@ -38,7 +38,7 @@ vfork:
 #endif
 
 	/* If we don't have vfork, use fork.  */
-	swi     __NR_fork
+	swi     (__NR_fork | 0x900000)
 	cmn     r0, #4096
 
 	/* Syscall worked.  Return to child/parent */