Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262724AbVEAVdn (ORCPT ); Sun, 1 May 2005 17:33:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262699AbVEAVcl (ORCPT ); Sun, 1 May 2005 17:32:41 -0400 Received: from lakshmi.addtoit.com ([198.99.130.6]:32019 "EHLO lakshmi.solana.com") by vger.kernel.org with ESMTP id S262700AbVEAVSk (ORCPT ); Sun, 1 May 2005 17:18:40 -0400 Message-Id: <200505012112.j41LCRPW016412@ccure.user-mode-linux.org> X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.0.4 To: torvalds@osdl.org cc: akpm@osdl.org, linux-kernel@vger.kernel.org, viro@parcelfarce.linux.theplanet.co.uk Subject: [PATCH 6/22] UML - Cross-build support : mk_thread Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 01 May 2005 17:12:27 -0400 From: Jeff Dike Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8356 Lines: 233 >From Al Viro: mk_thread converted Signed-off-by: Al Viro Signed-off-by: Jeff Dike diff -urN RC12-rc3-uml-kernel-offsets/arch/um/Makefile-i386 RC12-rc3-uml-thread/arch/um/Makefile-i386 --- RC12-rc3-uml-kernel-offsets/arch/um/Makefile-i386 Wed Apr 27 18:18:08 2005 +++ RC12-rc3-uml-thread/arch/um/Makefile-i386 Wed Apr 27 18:13:27 2005 @@ -35,7 +35,7 @@ $(SYS_UTIL_DIR)/mk_sc: scripts_basic $(ARCH_DIR)/user-offsets.h FORCE $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR) $@ -$(SYS_UTIL_DIR)/mk_thread: scripts_basic $(ARCH_SYMLINKS) $(GEN_HEADERS) FORCE +$(SYS_UTIL_DIR)/mk_thread: scripts_basic $(ARCH_DIR)/kernel-offsets.h FORCE $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR) $@ $(SYS_UTIL_DIR): scripts_basic include/asm FORCE diff -urN RC12-rc3-uml-kernel-offsets/arch/um/Makefile-x86_64 RC12-rc3-uml-thread/arch/um/Makefile-x86_64 --- RC12-rc3-uml-kernel-offsets/arch/um/Makefile-x86_64 Wed Apr 27 18:18:08 2005 +++ RC12-rc3-uml-thread/arch/um/Makefile-x86_64 Wed Apr 27 18:13:27 2005 @@ -26,7 +26,7 @@ $(SYS_UTIL_DIR)/mk_sc: scripts_basic $(ARCH_DIR)/user-offsets.h FORCE $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR) $@ -$(SYS_UTIL_DIR)/mk_thread: scripts_basic $(ARCH_SYMLINKS) $(GEN_HEADERS) FORCE +$(SYS_UTIL_DIR)/mk_thread: scripts_basic $(GEN_HEADERS) $(ARCH_DIR)/kernel-offsets.h FORCE $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR) $@ CLEAN_FILES += $(SYS_HEADERS) diff -urN RC12-rc3-uml-kernel-offsets/arch/um/sys-i386/util/Makefile RC12-rc3-uml-thread/arch/um/sys-i386/util/Makefile --- RC12-rc3-uml-kernel-offsets/arch/um/sys-i386/util/Makefile Wed Apr 27 17:07:26 2005 +++ RC12-rc3-uml-thread/arch/um/sys-i386/util/Makefile Wed Apr 27 17:07:29 2005 @@ -1,9 +1,5 @@ - hostprogs-y := mk_sc mk_thread always := $(hostprogs-y) -mk_thread-objs := mk_thread_kern.o mk_thread_user.o - -HOSTCFLAGS_mk_thread_kern.o := $(CFLAGS) $(CPPFLAGS) -HOSTCFLAGS_mk_thread_user.o := $(USER_CFLAGS) HOSTCFLAGS_mk_sc.o := -I$(objtree)/arch/um +HOSTCFLAGS_mk_thread.o := -I$(objtree)/arch/um diff -urN RC12-rc3-uml-kernel-offsets/arch/um/sys-i386/util/mk_thread.c RC12-rc3-uml-thread/arch/um/sys-i386/util/mk_thread.c --- RC12-rc3-uml-kernel-offsets/arch/um/sys-i386/util/mk_thread.c Wed Dec 31 19:00:00 1969 +++ RC12-rc3-uml-thread/arch/um/sys-i386/util/mk_thread.c Wed Apr 27 17:07:29 2005 @@ -0,0 +1,22 @@ +#include +#include + +int main(int argc, char **argv) +{ + printf("/*\n"); + printf(" * Generated by mk_thread\n"); + printf(" */\n"); + printf("\n"); + printf("#ifndef __UM_THREAD_H\n"); + printf("#define __UM_THREAD_H\n"); + printf("\n"); + printf("#define TASK_DEBUGREGS(task) ((unsigned long *) " + "&(((char *) (task))[%d]))\n", TASK_DEBUGREGS); +#ifdef TASK_EXTERN_PID + printf("#define TASK_EXTERN_PID(task) *((int *) &(((char *) (task))[%d]))\n", + TASK_EXTERN_PID); +#endif + printf("\n"); + printf("#endif\n"); + return(0); +} diff -urN RC12-rc3-uml-kernel-offsets/arch/um/sys-i386/util/mk_thread_kern.c RC12-rc3-uml-thread/arch/um/sys-i386/util/mk_thread_kern.c --- RC12-rc3-uml-kernel-offsets/arch/um/sys-i386/util/mk_thread_kern.c Wed Feb 4 10:49:17 2004 +++ RC12-rc3-uml-thread/arch/um/sys-i386/util/mk_thread_kern.c Wed Dec 31 19:00:00 1969 @@ -1,22 +0,0 @@ -#include "linux/config.h" -#include "linux/stddef.h" -#include "linux/sched.h" - -extern void print_head(void); -extern void print_constant_ptr(char *name, int value); -extern void print_constant(char *name, char *type, int value); -extern void print_tail(void); - -#define THREAD_OFFSET(field) offsetof(struct task_struct, thread.field) - -int main(int argc, char **argv) -{ - print_head(); - print_constant_ptr("TASK_DEBUGREGS", THREAD_OFFSET(arch.debugregs)); -#ifdef CONFIG_MODE_TT - print_constant("TASK_EXTERN_PID", "int", THREAD_OFFSET(mode.tt.extern_pid)); -#endif - print_tail(); - return(0); -} - diff -urN RC12-rc3-uml-kernel-offsets/arch/um/sys-i386/util/mk_thread_user.c RC12-rc3-uml-thread/arch/um/sys-i386/util/mk_thread_user.c --- RC12-rc3-uml-kernel-offsets/arch/um/sys-i386/util/mk_thread_user.c Wed Feb 4 10:35:02 2004 +++ RC12-rc3-uml-thread/arch/um/sys-i386/util/mk_thread_user.c Wed Dec 31 19:00:00 1969 @@ -1,30 +0,0 @@ -#include - -void print_head(void) -{ - printf("/*\n"); - printf(" * Generated by mk_thread\n"); - printf(" */\n"); - printf("\n"); - printf("#ifndef __UM_THREAD_H\n"); - printf("#define __UM_THREAD_H\n"); - printf("\n"); -} - -void print_constant_ptr(char *name, int value) -{ - printf("#define %s(task) ((unsigned long *) " - "&(((char *) (task))[%d]))\n", name, value); -} - -void print_constant(char *name, char *type, int value) -{ - printf("#define %s(task) *((%s *) &(((char *) (task))[%d]))\n", name, type, - value); -} - -void print_tail(void) -{ - printf("\n"); - printf("#endif\n"); -} diff -urN RC12-rc3-uml-kernel-offsets/arch/um/sys-x86_64/util/Makefile RC12-rc3-uml-thread/arch/um/sys-x86_64/util/Makefile --- RC12-rc3-uml-kernel-offsets/arch/um/sys-x86_64/util/Makefile Wed Apr 27 17:07:26 2005 +++ RC12-rc3-uml-thread/arch/um/sys-x86_64/util/Makefile Wed Apr 27 17:07:29 2005 @@ -4,8 +4,5 @@ hostprogs-y := mk_sc mk_thread always := $(hostprogs-y) -mk_thread-objs := mk_thread_kern.o mk_thread_user.o - -HOSTCFLAGS_mk_thread_kern.o := $(CFLAGS) $(CPPFLAGS) -HOSTCFLAGS_mk_thread_user.o := $(USER_CFLAGS) HOSTCFLAGS_mk_sc.o := -I$(objtree)/arch/um +HOSTCFLAGS_mk_thread.o := -I$(objtree)/arch/um diff -urN RC12-rc3-uml-kernel-offsets/arch/um/sys-x86_64/util/mk_thread.c RC12-rc3-uml-thread/arch/um/sys-x86_64/util/mk_thread.c --- RC12-rc3-uml-kernel-offsets/arch/um/sys-x86_64/util/mk_thread.c Wed Dec 31 19:00:00 1969 +++ RC12-rc3-uml-thread/arch/um/sys-x86_64/util/mk_thread.c Wed Apr 27 17:07:29 2005 @@ -0,0 +1,20 @@ +#include +#include + +int main(int argc, char **argv) +{ + printf("/*\n"); + printf(" * Generated by mk_thread\n"); + printf(" */\n"); + printf("\n"); + printf("#ifndef __UM_THREAD_H\n"); + printf("#define __UM_THREAD_H\n"); + printf("\n"); +#ifdef TASK_EXTERN_PID + printf("#define TASK_EXTERN_PID(task) *((int *) &(((char *) (task))[%d]))\n", + TASK_EXTERN_PID); +#endif + printf("\n"); + printf("#endif\n"); + return(0); +} diff -urN RC12-rc3-uml-kernel-offsets/arch/um/sys-x86_64/util/mk_thread_kern.c RC12-rc3-uml-thread/arch/um/sys-x86_64/util/mk_thread_kern.c --- RC12-rc3-uml-kernel-offsets/arch/um/sys-x86_64/util/mk_thread_kern.c Fri Mar 11 15:54:46 2005 +++ RC12-rc3-uml-thread/arch/um/sys-x86_64/util/mk_thread_kern.c Wed Dec 31 19:00:00 1969 @@ -1,21 +0,0 @@ -#include "linux/config.h" -#include "linux/stddef.h" -#include "linux/sched.h" - -extern void print_head(void); -extern void print_constant_ptr(char *name, int value); -extern void print_constant(char *name, char *type, int value); -extern void print_tail(void); - -#define THREAD_OFFSET(field) offsetof(struct task_struct, thread.field) - -int main(int argc, char **argv) -{ - print_head(); -#ifdef CONFIG_MODE_TT - print_constant("TASK_EXTERN_PID", "int", THREAD_OFFSET(mode.tt.extern_pid)); -#endif - print_tail(); - return(0); -} - diff -urN RC12-rc3-uml-kernel-offsets/arch/um/sys-x86_64/util/mk_thread_user.c RC12-rc3-uml-thread/arch/um/sys-x86_64/util/mk_thread_user.c --- RC12-rc3-uml-kernel-offsets/arch/um/sys-x86_64/util/mk_thread_user.c Fri Mar 11 15:54:46 2005 +++ RC12-rc3-uml-thread/arch/um/sys-x86_64/util/mk_thread_user.c Wed Dec 31 19:00:00 1969 @@ -1,30 +0,0 @@ -#include - -void print_head(void) -{ - printf("/*\n"); - printf(" * Generated by mk_thread\n"); - printf(" */\n"); - printf("\n"); - printf("#ifndef __UM_THREAD_H\n"); - printf("#define __UM_THREAD_H\n"); - printf("\n"); -} - -void print_constant_ptr(char *name, int value) -{ - printf("#define %s(task) ((unsigned long *) " - "&(((char *) (task))[%d]))\n", name, value); -} - -void print_constant(char *name, char *type, int value) -{ - printf("#define %s(task) *((%s *) &(((char *) (task))[%d]))\n", name, type, - value); -} - -void print_tail(void) -{ - printf("\n"); - printf("#endif\n"); -} - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/