* IA64 update for klibc-0.148
@ 2004-07-15 9:35 Hannes Reinecke
2004-07-15 16:35 ` [klibc] " H. Peter Anvin
0 siblings, 1 reply; 2+ messages in thread
From: Hannes Reinecke @ 2004-07-15 9:35 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 424 bytes --]
Hi all,
these two patches
- update the ia64 port of klibc and
- adds the missing perl scripts for syscall stub generation on ia64
So with it the new klibc should be finally working on ia64.
Kudos go to schwab@suse.de for the ia64 asm hackery.
Cheers,
Hannes
--
Dr. Hannes Reinecke hare@suse.de
SuSE Linux AG S390 & zSeries
Maxfeldstraße 5 +49 911 74053 688
90409 Nürnberg http://www.suse.de
[-- Attachment #2: klibc-0.115-ia64.patch --]
[-- Type: text/x-patch, Size: 4287 bytes --]
--- klibc-0.115/klibc/arch/ia64/vfork.S.orig 2004-03-19 14:19:08.890806347 +0100
+++ klibc-0.115/klibc/arch/ia64/vfork.S 2004-03-19 14:20:23.000000000 +0100
@@ -27,8 +27,8 @@
mov out0=CLONE_VM|CLONE_VFORK|SIGCHLD
mov out1=0
;;
- __IA64_BREAK // Do the syscall
-
+ break 0x100000 // Do the syscall
+ ;;
addl r15=0,r1
cmp.eq p7,p6 = -1,r10
;;
--- klibc-0.115/klibc/arch/ia64/pipe.c.orig 2004-03-19 14:19:13.227660639 +0100
+++ klibc-0.115/klibc/arch/ia64/pipe.c 2004-03-19 15:09:45.201472497 +0100
@@ -27,7 +27,7 @@
long _retval;
__asm __volatile (__IA64_BREAK
: "=r" (_r8), "=r" (_r10), "=r" (_r15),
- "=r" (_out0)
+ "=r" (_out0), "=r" (_r9)
: "2" (_r15), "3" (_out0)
: "memory" ASM_CLOBBERS);
if (_r10 == -1) {
--- klibc-0.115/klibc/arch/ia64/include/klibc/archsys.h.orig 2004-03-19 16:03:23.961172547 +0100
+++ klibc-0.115/klibc/arch/ia64/include/klibc/archsys.h 2004-03-19 16:03:54.000000000 +0100
@@ -26,7 +26,7 @@
errno = (_retval); \
_retval = -1; \
} \
- return _retval; \
+ return (type)_retval; \
}
#define _syscall1(type,name,type1,arg1) \
@@ -48,7 +48,7 @@
errno = (_retval); \
_retval = -1; \
} \
- return _retval; \
+ return (type)_retval; \
}
#define _syscall2(type,name,type1,arg1,type2,arg2) \
@@ -70,7 +70,7 @@
errno = (_retval); \
_retval = -1; \
} \
- return _retval; \
+ return (type)_retval; \
}
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
@@ -92,7 +92,7 @@
errno = (_retval); \
_retval = -1; \
} \
- return _retval; \
+ return (type)_retval; \
}
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
@@ -114,7 +114,7 @@
errno = (_retval); \
_retval = -1; \
} \
- return _retval; \
+ return (type)_retval; \
}
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
@@ -136,7 +136,7 @@
errno = (_retval); \
_retval = -1; \
} \
- return _retval; \
+ return (type)_retval; \
}
#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \
@@ -158,7 +158,7 @@
errno = (_retval); \
_retval = -1; \
} \
- return _retval; \
+ return (type)_retval; \
}
[-- Attachment #3: klibc-0.148.ia64.patch --]
[-- Type: text/x-patch, Size: 1592 bytes --]
--- klibc-0.148/klibc/arch/ia64/Makefile.inc
+++ klibc-0.148/klibc/arch/ia64/Makefile.inc
@@ -11,6 +11,7 @@
arch/$(ARCH)/vfork.o \
arch/$(ARCH)/setjmp.o \
arch/$(ARCH)/pipe.o \
+ arch/$(ARCH)/syscall.o \
libgcc/__divdi3.o \
libgcc/__divsi3.o \
libgcc/__udivdi3.o \
--- klibc-0.148/klibc/arch/ia64/syscall.S
+++ klibc-0.148/klibc/arch/ia64/syscall.S
@@ -0,0 +1,19 @@
+#
+# arch/ia64/syscall.S
+#
+
+#include <asm/unistd.h>
+
+ .text
+ .align 32
+ .proc __syscall_error
+ .globl __syscall_error
+__syscall_error:
+ addl r2 = @ltoffx(errno),gp
+ ld8.mov r3 = [r2],errno
+ ;;
+ st4 [r3] = r8
+ mov r8 = -1
+ br.ret.sptk.many b0
+ .size __syscall_error, .-__syscall_error
+ .endp __syscall_error
--- klibc-0.148/klibc/arch/ia64/sysstub.ph
+++ klibc-0.148/klibc/arch/ia64/sysstub.ph
@@ -0,0 +1,29 @@
+# -*- perl -*-
+#
+# arch/ia64/sysstub.ph
+#
+# Script to generate system call stubs
+#
+
+sub make_sysstub($$$$@) {
+ my($fname, $type, $sname, $stype, @args) = @_;
+
+ open(OUT, '>', "syscalls/${fname}.S");
+ print OUT "#include <asm/unistd.h>\n";
+ print OUT "\n";
+ print OUT "\t.text\n";
+ print OUT "\t.align 32\n";
+ print OUT "\t.proc ${fname}\n";
+ print OUT "\t.globl ${fname}\n";
+ print OUT "${fname}:\n";
+ print OUT "\tmov\tr15 = __NR_${sname}\n";
+ print OUT "\tbreak __BREAK_SYSCALL\n";
+ print OUT "\tcmp.eq p6,p0 = -1,r10\n";
+ print OUT "(p6)\tbr.few __syscall_error\n";
+ print OUT "\tbr.ret.sptk.many b0\n";
+ print OUT "\t.size\t${fname},.-${fname}\n";
+ print OUT "\t.endp\t${fname}\n";
+ close(OUT);
+}
+
+1;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-07-15 16:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-15 9:35 IA64 update for klibc-0.148 Hannes Reinecke
2004-07-15 16:35 ` [klibc] " H. Peter Anvin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).