aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2004-06-07 08:43:00 +0000
committerH. Peter Anvin <hpa@zytor.com>2004-06-07 08:43:00 +0000
commit53b7c91cf73ba75160fc30e363daecbc87adeda3 (patch)
treee6fc2fad8eddfa05521dfe08c5bdfe396b059b1c
parent6a2d7ce26a0f67971b6526d02abe1f90b20bee62 (diff)
downloadklibc-53b7c91cf73ba75160fc30e363daecbc87adeda3.tar.gz
Make alpha actually work.klibc-0.121
-rw-r--r--klibc/README2
-rw-r--r--klibc/arch/alpha/Makefile.inc4
-rw-r--r--klibc/arch/alpha/crt0.S10
-rw-r--r--klibc/arch/alpha/setjmp.S32
-rw-r--r--klibc/arch/alpha/syscall.S3
-rw-r--r--klibc/arch/alpha/sysdual.S3
-rw-r--r--klibc/arch/alpha/sysstub.ph5
7 files changed, 30 insertions, 29 deletions
diff --git a/klibc/README b/klibc/README
index 2d79bc5552ff6..7ba0ae9f4174d 100644
--- a/klibc/README
+++ b/klibc/README
@@ -34,7 +34,7 @@ b) If you're cross-compiling, change ARCH in the main MCONFIG file to
The following is the last known status of various architectures:
- alpha: Untested
+ alpha: Working static, shared untested
arm-thumb: Probably working
arm26: Not yet ported
arm: Working
diff --git a/klibc/arch/alpha/Makefile.inc b/klibc/arch/alpha/Makefile.inc
index 89f5ecb07ed5f..62fce9dc28098 100644
--- a/klibc/arch/alpha/Makefile.inc
+++ b/klibc/arch/alpha/Makefile.inc
@@ -11,7 +11,7 @@
DIVCFLAGS = $(REQFLAGS) \
-O3 -fomit-frame-pointer -fcall-saved-1 -fcall-saved-2 \
-fcall-saved-3 -fcall-saved-4 -fcall-saved-5 -fcall-saved-6 \
- -fcall-saved-7 -fcall-saved-8 -fcall-saved-15 -fcall-saved-16 \
+ -fcall-saved-7 -fcall-saved-8 -ffixed-15 -fcall-saved-16 \
-fcall-saved-17 -fcall-saved-18 -fcall-saved-19 -fcall-saved-20 \
-fcall-saved-21 -fcall-saved-22 -ffixed-23 -fcall-saved-24 \
-ffixed-25 -ffixed-27
@@ -28,7 +28,7 @@ ARCHOBJS = \
arch/$(ARCH)/pipe.o \
arch/$(ARCH)/setjmp.o \
arch/$(ARCH)/syscall.o \
- arch/$(ARCH)/sysdual.o \
+ arch/$(ARCH)/sysdual.o
ARCHSOOBJS = $(patsubst %.o,%.lo,$(ARCHOBJS))
diff --git a/klibc/arch/alpha/crt0.S b/klibc/arch/alpha/crt0.S
index 6c2958117d5c2..79f4334587d51 100644
--- a/klibc/arch/alpha/crt0.S
+++ b/klibc/arch/alpha/crt0.S
@@ -3,10 +3,10 @@
#
.text
- .type __start,@function
- .ent __start, 0
- .globl __start
-__start:
+ .type _start,@function
+ .ent _start, 0
+ .globl _start
+_start:
.frame $30, 0, $26, 0
mov $31, $15
br $29, 1f
@@ -18,4 +18,4 @@ __start:
jsr $26, __libc_init
- .size __start,.-__start
+ .size _start,.-_start
diff --git a/klibc/arch/alpha/setjmp.S b/klibc/arch/alpha/setjmp.S
index e1ad642539b5e..5d915f2dbea8a 100644
--- a/klibc/arch/alpha/setjmp.S
+++ b/klibc/arch/alpha/setjmp.S
@@ -31,14 +31,14 @@ setjmp:
stq ra, 56(a0)
stq gp, 64(a0)
stq sp, 72(a0)
- stt f2, 80(a0)
- stt f3, 88(a0)
- stt f4, 96(a0)
- stt f5, 104(a0)
- stt f6, 112(a0)
- stt f7, 120(a0)
- stt f8, 128(a0)
- stt f9, 136(a0)
+ stt $f2, 80(a0)
+ stt $f3, 88(a0)
+ stt $f4, 96(a0)
+ stt $f5, 104(a0)
+ stt $f6, 112(a0)
+ stt $f7, 120(a0)
+ stt $f8, 128(a0)
+ stt $f9, 136(a0)
ret zero,(ra),1
.size setjmp,.-setjmp
@@ -59,14 +59,14 @@ longjmp:
ldq ra, 56(a0)
ldq gp, 64(a0)
ldq sp, 72(a0)
- ldt f2, 80(a0)
- ldt f3, 88(a0)
- ldt f4, 96(a0)
- ldt f5, 104(a0)
- ldt f6, 112(a0)
- ldt f7, 120(a0)
- ldt f8, 128(a0)
- ldt f9, 136(a0)
+ ldt $f2, 80(a0)
+ ldt $f3, 88(a0)
+ ldt $f4, 96(a0)
+ ldt $f5, 104(a0)
+ ldt $f6, 112(a0)
+ ldt $f7, 120(a0)
+ ldt $f8, 128(a0)
+ ldt $f9, 136(a0)
/* We're bound to get a mispredict here, but at least give us
a chance to get the return stack back in sync... */
ret zero,(ra),1
diff --git a/klibc/arch/alpha/syscall.S b/klibc/arch/alpha/syscall.S
index 95dcbed49f210..0c87414b1ad1c 100644
--- a/klibc/arch/alpha/syscall.S
+++ b/klibc/arch/alpha/syscall.S
@@ -13,6 +13,9 @@ __syscall_common:
.frame sp,0,ra,0
callsys
beq a3, 1f
+ br pv, 2f # pv <- pc
+2:
+ ldgp gp, 0(pv)
lda a1, errno
lda v0, -1(zero)
stl a3, 0(a1)
diff --git a/klibc/arch/alpha/sysdual.S b/klibc/arch/alpha/sysdual.S
index 4ffbf7601ab43..c00db88960647 100644
--- a/klibc/arch/alpha/sysdual.S
+++ b/klibc/arch/alpha/sysdual.S
@@ -20,6 +20,9 @@ __syscall_dual1:
callsys
mov v0, a4
beq a3, 1f
+ br pv, 2f # pv <- pc
+2:
+ ldgp gp, 0(pv)
lda a1, errno
lda v0, -1(zero)
stl a3, 0(a1)
diff --git a/klibc/arch/alpha/sysstub.ph b/klibc/arch/alpha/sysstub.ph
index d1dc8275f2154..a24b6c07dc81b 100644
--- a/klibc/arch/alpha/sysstub.ph
+++ b/klibc/arch/alpha/sysstub.ph
@@ -12,10 +12,6 @@
# A few system calls are dual-return with the second return value in
# r20 (a4).
-# In order to find errno, we need the gp, which is computed from the
-# pv register. This is two instructions, so the total length of the
-# stub is 4x4 = 16 bytes.
-
sub make_sysstub($$$$@) {
my($fname, $type, $sname, $stype, @args) = @_;
@@ -31,7 +27,6 @@ sub make_sysstub($$$$@) {
print OUT "\t.ent\t${fname}, 0\n"; # What is this?
print OUT "\t.globl ${fname}\n";
print OUT "${fname}:\n";
- print OUT "\tldgp\tgp,0(pv)\n";
print OUT "\tlda\tv0, __NR_${sname}(zero)\n";
print OUT "\tbr __syscall_${stype}\n";
print OUT "\t.size\t${fname},.-${fname}\n";