Patches for x86-64

Alex Kiernan alex.kiernan at thus.net
Thu Apr 15 08:39:21 UTC 2004


I don't know if these are strictly correct (x86-64 kernel hacking is
new territory for me), but they seem to work. I was actually working
with the tux patch in the current FC-devel RPM, rather than the
unbundled patch, but since this is all base kernel support, I expect
that its the same for both.

diff -ur kernel-2.6.5.redhat/linux-2.6.5/arch/x86_64/kernel/x8664_ksyms.c kernel-2.6.5/linux-2.6.5/arch/x86_64/kernel/x8664_ksyms.c
--- kernel-2.6.5.redhat/linux-2.6.5/arch/x86_64/kernel/x8664_ksyms.c	2004-04-11 18:53:12.000000000 +0100
+++ kernel-2.6.5/linux-2.6.5/arch/x86_64/kernel/x8664_ksyms.c	2004-04-13 04:51:20.506994864 +0100
@@ -30,6 +30,7 @@
 #include <asm/pgalloc.h>
 #include <asm/nmi.h>
 #include <asm/kdebug.h>
+#define __KERNEL_SYSCALLS__
 #include <asm/unistd.h>
 #include <asm/delay.h>
 #include <asm/tlbflush.h>
@@ -226,3 +227,8 @@
 
 EXPORT_SYMBOL(memcpy_toio);
 EXPORT_SYMBOL(memcpy_fromio);
+
+EXPORT_SYMBOL(execve);
+EXPORT_SYMBOL(sys_write);
+EXPORT_SYMBOL(sys_chroot);
+EXPORT_SYMBOL(sys_chdir);
diff -ur kernel-2.6.5.redhat/linux-2.6.5/include/asm-x86_64/unistd.h kernel-2.6.5/linux-2.6.5/include/asm-x86_64/unistd.h
--- kernel-2.6.5.redhat/linux-2.6.5/include/asm-x86_64/unistd.h	2004-04-04 04:37:36.000000000 +0100
+++ kernel-2.6.5/linux-2.6.5/include/asm-x86_64/unistd.h	2004-04-12 16:13:34.000000000 +0100
@@ -424,7 +424,13 @@
 __SYSCALL(__NR_afs_syscall, sys_ni_syscall)
 
 #define __NR_tuxcall      		184 /* reserved for tux */
+#ifdef CONFIG_TUX
+__SYSCALL(__NR_tuxcall, __sys_tux)
+#elif defined(CONFIG_TUX_MODULE)
+__SYSCALL(__NR_tuxcall, sys_tux)
+#else
 __SYSCALL(__NR_tuxcall, sys_ni_syscall)
+#endif
 
 #define __NR_security			185
 __SYSCALL(__NR_security, sys_ni_syscall)
@@ -542,6 +548,7 @@
 
 #define __syscall_clobber "r11","rcx","memory" 
 
+#ifndef __KERNEL_SYSCALLS_NO_ERRNO__
 #define __syscall_return(type, res) \
 do { \
 	if ((unsigned long)(res) >= (unsigned long)(-127)) { \
@@ -550,6 +557,9 @@
 	} \
 	return (type) (res); \
 } while (0)
+#else
+# define __syscall_return(type, res) return (type) (res)
+#endif
 
 #ifndef __KERNEL_SYSCALLS__
 
@@ -696,6 +706,16 @@
 	return sys_wait4(pid, wait_stat, flags, NULL);
 }
 
+static inline long chroot(const char *filename)
+{
+	return sys_chroot(filename);
+}
+
+static inline long chdir(const char *filename)
+{
+	return sys_chdir(filename);
+}
+
 extern long sys_mmap(unsigned long addr, unsigned long len,
 			unsigned long prot, unsigned long flags,
 			unsigned long fd, unsigned long off);


-- 
Alex Kiernan, Principal Engineer, Development, THUS plc





More information about the tux-list mailing list