~ubuntu-branches/ubuntu/hardy/klibc/hardy-updates

« back to all changes in this revision

Viewing changes to debian/patches/klibc-parisc.diff

  • Committer: Bazaar Package Importer
  • Author(s): Jeff Bailey
  • Date: 2006-01-04 20:24:52 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060104202452-ec4v3n829rymukuv
Tags: 1.1.15-0ubuntu1
* New upstream version.

* Patch to fix compilation on parisc64 kernels.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
diff --git a/klibc/arch/parisc/Makefile.inc b/klibc/arch/parisc/Makefile.inc
2
 
index 980a543..4fddf5f 100644
3
 
--- a/klibc/arch/parisc/Makefile.inc
4
 
+++ b/klibc/arch/parisc/Makefile.inc
5
 
@@ -14,6 +14,3 @@ ARCHOBJS = \
6
 
 ARCHOOBJS = $(patsubst %o,%.lo,%(ARCHOBJS))
7
 
 
8
 
 archclean:
9
 
-
10
 
-arch/$(ARCH)/syscall.o: arch/$(ARCH)/syscall.c
11
 
-       $(CC) $(CFLAGS) -ffixed-r20 -c -o $@ $<
12
 
diff --git a/klibc/arch/parisc/syscall.S b/klibc/arch/parisc/syscall.S
13
 
new file mode 100644
14
 
index 0000000..2554404
15
 
--- /dev/null
16
 
+++ b/klibc/arch/parisc/syscall.S
17
 
@@ -0,0 +1,38 @@
18
 
+/*
19
 
+ * arch/parisc/syscall.S
20
 
+ * 
21
 
+ * %r20 contains the system call number, %r2 contains whence we came
22
 
+ *
23
 
+ */
24
 
+
25
 
+       .text
26
 
+       .align 4
27
 
+       .globl  __syscall_common
28
 
+       .type   __syscall_common,@function
29
 
+__syscall_common:
30
 
+       stw             %rp,-0x14(%sp)  
31
 
+       stw,ma          %r4,0x40(%sp)
32
 
+
33
 
+       ldw             -0x74(%sp),%r22         ; %arg4
34
 
+       ldw             -0x78(%sp),%r21         ; %arg5
35
 
+
36
 
+       copy            %r4,%r19
37
 
+       ble             0x100(%sr2, %r0)        ; jump to gateway page
38
 
+       nop
39
 
+       copy            %r19,%r4
40
 
+
41
 
+       ldi             -0x1000,%r19
42
 
+       sub             %r0,%ret0,%r22          ; %r22 = -%ret0
43
 
+       cmpb,>>=,n      %r19,%ret0,1f           ; if %r19 >= -4095UL
44
 
+       ldi             -1,%ret0                ; nullified on taken forward
45
 
+
46
 
+       /* store %r22 to errno... somehow */
47
 
+       ldil            L%errno,%r1
48
 
+       ldo             R%errno(%r1),%r1
49
 
+       stw             %r22,0(%r1)
50
 
+1:
51
 
+       ldw             -0x54(%sp),%rp
52
 
+       bv              %r0(%r2)                ; jump back
53
 
+       ldw,mb          -0x40(%sp),%r4
54
 
+
55
 
+       .size __syscall_common,.-__syscall_common
56
 
diff --git a/klibc/arch/parisc/syscall.c b/klibc/arch/parisc/syscall.c
57
 
deleted file mode 100644
58
 
index 99ef5fe..0000000
59
 
--- a/klibc/arch/parisc/syscall.c
60
 
+++ /dev/null
61
 
@@ -1,29 +0,0 @@
62
 
-/*
63
 
- * arch/parisc/syscall.c
64
 
- *
65
 
- * This function is called from a stub with %r20 already set up.
66
 
- * Compile this function with -ffixed-r20 so that it doesn't clobber
67
 
- * this register by mistake.
68
 
- */
69
 
-
70
 
-#include <klibc/compiler.h>
71
 
-#include <errno.h>
72
 
-
73
 
-long __syscall_common(long a0, long a1, long a2, long a3, long a4, long a5)
74
 
-{
75
 
-  register unsigned long rv asm ("r28");
76
 
-
77
 
-  asm volatile("\tble 0x100(%%sr2, %%r0)\n"
78
 
-              : "=r" (rv)
79
 
-              : "r" (a0), "r" (a1), "r" (a2), "r" (a3), "r" (a4), "r" (a5)
80
 
-              : "%r1", "%r2", "%r29", "%r31");
81
 
-
82
 
-  if ( __unlikely(rv >= -4095UL) ) {
83
 
-    errno = -rv;
84
 
-    return -1L;
85
 
-  } else {
86
 
-    return (long)rv;
87
 
-  }
88
 
-}
89
 
-
90
 
-