summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/alpha
diff options
context:
space:
mode:
authorGwenolé Beauchesne <gbeauchesne@mandriva.org>2003-06-04 18:31:57 +0000
committerGwenolé Beauchesne <gbeauchesne@mandriva.org>2003-06-04 18:31:57 +0000
commit09e967c2d732783b2579e4e120cd9b608404cb00 (patch)
tree8d2783a6a7e33608c6012efd6a88b8f5694df81d /mdk-stage1/dietlibc/alpha
parent18fcff49d3c836697d3b75a3d01d31c700e69974 (diff)
downloaddrakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar
drakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar.gz
drakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar.bz2
drakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar.xz
drakx-09e967c2d732783b2579e4e120cd9b608404cb00.zip
Merge from R9_0-AMD64, most notably:
- AMD64 support to insmod-busybox, minilibc, et al. - Sync with insmod-modutils 2.4.19 something but everyone should use dietlibc nowadays - Factor out compilation and prefix with $(DIET) for dietlibc builds - 64-bit & varargs fixes
Diffstat (limited to 'mdk-stage1/dietlibc/alpha')
-rw-r--r--mdk-stage1/dietlibc/alpha/Makefile.add2
-rw-r--r--mdk-stage1/dietlibc/alpha/__longjmp.S9
-rw-r--r--mdk-stage1/dietlibc/alpha/clone.S2
-rw-r--r--mdk-stage1/dietlibc/alpha/setjmp.S31
-rw-r--r--mdk-stage1/dietlibc/alpha/start.S20
-rw-r--r--mdk-stage1/dietlibc/alpha/unified.S12
6 files changed, 34 insertions, 42 deletions
diff --git a/mdk-stage1/dietlibc/alpha/Makefile.add b/mdk-stage1/dietlibc/alpha/Makefile.add
index 10ff0faef..68b10b43c 100644
--- a/mdk-stage1/dietlibc/alpha/Makefile.add
+++ b/mdk-stage1/dietlibc/alpha/Makefile.add
@@ -2,4 +2,4 @@
CFLAGS+=-Os -Iinclude -fomit-frame-pointer -fstrict-aliasing
VPATH:=alpha:syscalls.s:$(VPATH)
-LIBOBJ+=$(patsubst %,$(OBJDIR)/%,divq.o divl.o remq.o reml.o seteuid.o __time.o)
+LIBOBJ+=$(patsubst %,$(OBJDIR)/%,divq.o divl.o remq.o reml.o __time.o __alarm.o)
diff --git a/mdk-stage1/dietlibc/alpha/__longjmp.S b/mdk-stage1/dietlibc/alpha/__longjmp.S
index d86d76717..31e374d0f 100644
--- a/mdk-stage1/dietlibc/alpha/__longjmp.S
+++ b/mdk-stage1/dietlibc/alpha/__longjmp.S
@@ -1,11 +1,10 @@
-#ifdef __alpha__
-
#include <setjmp.h>
.text
.align 2
.global __longjmp
+.type __longjmp,@function
__longjmp:
mov $17, $0 /* a1 -> v0 */
@@ -18,7 +17,7 @@ __longjmp:
ldq $26, (JB_PC*8) ($16) /* ra */
ldq $fp, (JB_FP*8) ($16) /* fp */
- ldq $1, (JB_SP*8) ($16) /* sp */
+ ldq $sp, (JB_SP*8) ($16) /* sp */
ldt $f2, (JB_F2*8) ($16) /* f2 */
ldt $f3, (JB_F3*8) ($16) /* f3 */
@@ -30,9 +29,5 @@ __longjmp:
ldt $f9, (JB_F9*8) ($16) /* f9 */
cmoveq $0, 0x1, $0
- mov $1, $sp
ret $31, ($26), 1
-
-
-#endif
diff --git a/mdk-stage1/dietlibc/alpha/clone.S b/mdk-stage1/dietlibc/alpha/clone.S
index b7e32d707..28e61a8bc 100644
--- a/mdk-stage1/dietlibc/alpha/clone.S
+++ b/mdk-stage1/dietlibc/alpha/clone.S
@@ -1,5 +1,5 @@
#include "syscalls.h"
-#include <asm/errno.h>
+#include <errno.h>
.text
.align 2
diff --git a/mdk-stage1/dietlibc/alpha/setjmp.S b/mdk-stage1/dietlibc/alpha/setjmp.S
index 3768056be..04bfd3d94 100644
--- a/mdk-stage1/dietlibc/alpha/setjmp.S
+++ b/mdk-stage1/dietlibc/alpha/setjmp.S
@@ -1,15 +1,16 @@
#include <setjmp.h>
.text
+.weak setjmp
+.type setjmp,@function
+setjmp:
+.weak __setjmp
+.type __setjmp,@function
+__setjmp:
+ mov 0, $17
.global __sigsetjmp
+.type __sigsetjmp,@function
__sigsetjmp:
- ldgp $gp, 0($gp)
-
- mov $sp, $1
- lda $sp, -16($sp)
-
- stq $26, 0($sp) /* save ra */
-
stq $9, (JB_S0*8) ($16) /* s0 */
stq $10, (JB_S1*8) ($16) /* s1 */
stq $11, (JB_S2*8) ($16) /* s2 */
@@ -19,7 +20,7 @@ __sigsetjmp:
stq $26, (JB_PC*8) ($16) /* ra */
stq $fp, (JB_FP*8) ($16) /* fp */
- stq $1, (JB_SP*8) ($16) /* sp */
+ stq $sp, (JB_SP*8) ($16) /* sp */
stt $f2, (JB_F2*8) ($16) /* f2 */
stt $f3, (JB_F3*8) ($16) /* f3 */
@@ -30,17 +31,5 @@ __sigsetjmp:
stt $f8, (JB_F8*8) ($16) /* f8 */
stt $f9, (JB_F9*8) ($16) /* f9 */
- br $26, __sigjmp_save /* call __sigjmp_save */
+ br $31, __sigjmp_save /* jmp __sigjmp_save */
- ldq $26, 0($sp) /* restore ra */
-
- lda $sp, 16($sp)
- ret $31, ($26), 1 /* back to caller */
-
-.weak setjmp
-setjmp:
-.weak __setjmp
-__setjmp:
- ldgp $gp, 0($gp)
- mov 0, $17
- br __sigsetjmp
diff --git a/mdk-stage1/dietlibc/alpha/start.S b/mdk-stage1/dietlibc/alpha/start.S
index 00b8e950d..850ce2420 100644
--- a/mdk-stage1/dietlibc/alpha/start.S
+++ b/mdk-stage1/dietlibc/alpha/start.S
@@ -1,7 +1,3 @@
-#include "start.h"
-
-#ifdef __alpha__
-
.text
.align 2
.set noreorder
@@ -17,19 +13,21 @@ _start:
ldgp $gp, 0($gp)
/* prepare to call main */
- ldl $16, 0($sp) /* argc */
+ ldl $16, 0($sp) /* argc / a0 */
- lda $17, 8($sp) /* argv */
+ lda $17, 8($sp) /* argv / a1 */
- addq $16, 1, $18 /* argp */
+ addq $16, 1, $18 /* argp / a2 */
s8addq $18, $17, $18 /* (8*(argc+1))+argv -> argp */
stq $18, environ
- mov $0, $21 /* mov v0(dynload) to a5 */
-
+#ifdef WANT_DYNAMIC
+/* in v0 ($0) is the ld.so _fini pointer */
+ mov $0, $19 /* mov v0(dynload) to a3 */
+ jsr $26, dyn_start
+#else
jsr $26, main
+#endif
mov $0, $16
jsr $26, exit /* YES, CALL! for threads and atexit ! (+4 byte) */
-
-#endif
diff --git a/mdk-stage1/dietlibc/alpha/unified.S b/mdk-stage1/dietlibc/alpha/unified.S
index 02a1c9bcd..506bf7387 100644
--- a/mdk-stage1/dietlibc/alpha/unified.S
+++ b/mdk-stage1/dietlibc/alpha/unified.S
@@ -1,15 +1,25 @@
#include <dietfeatures.h>
+#include "syscalls.h"
+.weak exit
+exit:
+.global _exit
+_exit:
+ lda $0, __NR_exit
.global __unified_syscall
__unified_syscall:
callsys
bne $19, .Lerror
+
+/* here we go and "reuse" the return for weak-void functions */
+#include "dietuglyweaks.h"
+
ret $31, ($26), 0x01
.Lerror:
.global error_unified_syscall
error_unified_syscall:
-#ifdef WANT_THREAD_SAVE
+#ifdef WANT_THREAD_SAFE
lda $sp, -16($sp) /* alloc 2 qwords on stack */
stq $26, 0($sp) /* save ra to stack */
stq $0, 8($sp) /* save v0 to stack */