From: Hannes Reinecke <hare@suse.de>
To: linux-hotplug@vger.kernel.org
Subject: IA64 update for klibc-0.148
Date: Thu, 15 Jul 2004 09:35:29 +0000 [thread overview]
Message-ID: <40F64FE1.6020406@suse.de> (raw)
[-- 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;
next reply other threads:[~2004-07-15 9:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-15 9:35 Hannes Reinecke [this message]
2004-07-15 16:35 ` [klibc] IA64 update for klibc-0.148 H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40F64FE1.6020406@suse.de \
--to=hare@suse.de \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.