Commit 1cd3bc1c authored by Al Viro's avatar Al Viro Committed by Linus Torvalds

[PATCH] uml: cross-build support : mk_ptregs

mk_ptregs converted.  Nothing new here, it's the same situation as with
mk_user_constants.
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8d0b9dc9
...@@ -196,7 +196,7 @@ $(ARCH_DIR)/kernel/skas/util/mk_ptregs: $(ARCH_DIR)/kernel/skas/util FORCE ; ...@@ -196,7 +196,7 @@ $(ARCH_DIR)/kernel/skas/util/mk_ptregs: $(ARCH_DIR)/kernel/skas/util FORCE ;
$(ARCH_DIR)/util: scripts_basic $(SYS_DIR)/sc.h FORCE $(ARCH_DIR)/util: scripts_basic $(SYS_DIR)/sc.h FORCE
$(Q)$(MAKE) $(build)=$@ $(Q)$(MAKE) $(build)=$@
$(ARCH_DIR)/kernel/skas/util: scripts_basic FORCE $(ARCH_DIR)/kernel/skas/util: scripts_basic $(ARCH_DIR)/user-offsets.h FORCE
$(Q)$(MAKE) $(build)=$@ $(Q)$(MAKE) $(build)=$@
$(ARCH_DIR)/os-$(OS)/util: scripts_basic FORCE $(ARCH_DIR)/os-$(OS)/util: scripts_basic FORCE
......
...@@ -2,3 +2,4 @@ hostprogs-y := mk_ptregs ...@@ -2,3 +2,4 @@ hostprogs-y := mk_ptregs
always := $(hostprogs-y) always := $(hostprogs-y)
mk_ptregs-objs := mk_ptregs-$(SUBARCH).o mk_ptregs-objs := mk_ptregs-$(SUBARCH).o
HOSTCFLAGS_mk_ptregs-$(SUBARCH).o := -I$(objtree)/arch/um
#include <stdio.h> #include <stdio.h>
#include <asm/ptrace.h> #include <user-offsets.h>
#include <asm/user.h>
#define PRINT_REG(name, val) printf("#define HOST_%s %d\n", (name), (val)) #define SHOW(name) printf("#define %s %d\n", #name, name)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
...@@ -12,28 +11,27 @@ int main(int argc, char **argv) ...@@ -12,28 +11,27 @@ int main(int argc, char **argv)
printf("#ifndef __SKAS_PT_REGS_\n"); printf("#ifndef __SKAS_PT_REGS_\n");
printf("#define __SKAS_PT_REGS_\n"); printf("#define __SKAS_PT_REGS_\n");
printf("\n"); printf("\n");
printf("#define HOST_FRAME_SIZE %d\n", FRAME_SIZE); SHOW(HOST_FRAME_SIZE);
printf("#define HOST_FP_SIZE %d\n", SHOW(HOST_FP_SIZE);
sizeof(struct user_i387_struct) / sizeof(unsigned long)); SHOW(HOST_XFP_SIZE);
printf("#define HOST_XFP_SIZE %d\n",
sizeof(struct user_fxsr_struct) / sizeof(unsigned long)); SHOW(HOST_IP);
SHOW(HOST_SP);
SHOW(HOST_EFLAGS);
SHOW(HOST_EAX);
SHOW(HOST_EBX);
SHOW(HOST_ECX);
SHOW(HOST_EDX);
SHOW(HOST_ESI);
SHOW(HOST_EDI);
SHOW(HOST_EBP);
SHOW(HOST_CS);
SHOW(HOST_SS);
SHOW(HOST_DS);
SHOW(HOST_FS);
SHOW(HOST_ES);
SHOW(HOST_GS);
PRINT_REG("IP", EIP);
PRINT_REG("SP", UESP);
PRINT_REG("EFLAGS", EFL);
PRINT_REG("EAX", EAX);
PRINT_REG("EBX", EBX);
PRINT_REG("ECX", ECX);
PRINT_REG("EDX", EDX);
PRINT_REG("ESI", ESI);
PRINT_REG("EDI", EDI);
PRINT_REG("EBP", EBP);
PRINT_REG("CS", CS);
PRINT_REG("SS", SS);
PRINT_REG("DS", DS);
PRINT_REG("FS", FS);
PRINT_REG("ES", ES);
PRINT_REG("GS", GS);
printf("\n"); printf("\n");
printf("#endif\n"); printf("#endif\n");
return(0); return(0);
......
...@@ -5,11 +5,10 @@ ...@@ -5,11 +5,10 @@
*/ */
#include <stdio.h> #include <stdio.h>
#define __FRAME_OFFSETS #include <user-offsets.h>
#include <asm/ptrace.h>
#define PRINT_REG(name, val) \ #define SHOW(name) \
printf("#define HOST_%s (%d / sizeof(unsigned long))\n", (name), (val)) printf("#define %s (%d / sizeof(unsigned long))\n", #name, name)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
...@@ -18,36 +17,35 @@ int main(int argc, char **argv) ...@@ -18,36 +17,35 @@ int main(int argc, char **argv)
printf("\n"); printf("\n");
printf("#ifndef __SKAS_PT_REGS_\n"); printf("#ifndef __SKAS_PT_REGS_\n");
printf("#define __SKAS_PT_REGS_\n"); printf("#define __SKAS_PT_REGS_\n");
printf("#define HOST_FRAME_SIZE (%d / sizeof(unsigned long))\n", SHOW(HOST_FRAME_SIZE);
FRAME_SIZE); SHOW(HOST_RBX);
PRINT_REG("RBX", RBX); SHOW(HOST_RCX);
PRINT_REG("RCX", RCX); SHOW(HOST_RDI);
PRINT_REG("RDI", RDI); SHOW(HOST_RSI);
PRINT_REG("RSI", RSI); SHOW(HOST_RDX);
PRINT_REG("RDX", RDX); SHOW(HOST_RBP);
PRINT_REG("RBP", RBP); SHOW(HOST_RAX);
PRINT_REG("RAX", RAX); SHOW(HOST_R8);
PRINT_REG("R8", R8); SHOW(HOST_R9);
PRINT_REG("R9", R9); SHOW(HOST_R10);
PRINT_REG("R10", R10); SHOW(HOST_R11);
PRINT_REG("R11", R11); SHOW(HOST_R12);
PRINT_REG("R12", R12); SHOW(HOST_R13);
PRINT_REG("R13", R13); SHOW(HOST_R14);
PRINT_REG("R14", R14); SHOW(HOST_R15);
PRINT_REG("R15", R15); SHOW(HOST_ORIG_RAX);
PRINT_REG("ORIG_RAX", ORIG_RAX); SHOW(HOST_CS);
PRINT_REG("CS", CS); SHOW(HOST_SS);
PRINT_REG("SS", SS); SHOW(HOST_EFLAGS);
PRINT_REG("EFLAGS", EFLAGS);
#if 0 #if 0
PRINT_REG("FS", FS); SHOW(HOST_FS);
PRINT_REG("GS", GS); SHOW(HOST_GS);
PRINT_REG("DS", DS); SHOW(HOST_DS);
PRINT_REG("ES", ES); SHOW(HOST_ES);
#endif #endif
PRINT_REG("IP", RIP); SHOW(HOST_IP);
PRINT_REG("SP", RSP); SHOW(HOST_SP);
printf("#define HOST_FP_SIZE 0\n"); printf("#define HOST_FP_SIZE 0\n");
printf("#define HOST_XFP_SIZE 0\n"); printf("#define HOST_XFP_SIZE 0\n");
printf("\n"); printf("\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment