diff -Naur -X dontdiff linux-2.4.18-origum/Makefile linux-2.4.18-sparc64um/Makefile --- linux-2.4.18-origum/Makefile 2002-09-12 19:00:35.000000000 -0500 +++ linux-2.4.18-sparc64um/Makefile 2002-09-13 11:33:48.000000000 -0500 @@ -27,7 +27,7 @@ HOSTCC = gcc HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -CROSS_COMPILE = +CROSS_COMPILE = sparc64-linux- # # Include the make variables (CC, etc...) diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/Makefile linux-2.4.18-sparc64um/arch/um/Makefile --- linux-2.4.18-origum/arch/um/Makefile 2002-09-12 19:00:35.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/Makefile 2002-09-13 14:02:27.000000000 -0500 @@ -3,6 +3,7 @@ include arch/$(ARCH)/Makefile-$(SUBARCH) EXTRAVERSION := $(EXTRAVERSION)-22um +EXTRAVERSION := $(EXTRAVERSION)-sparc64-1 include/linux/version.h: arch/$(ARCH)/Makefile # Recalculate MODLIB to reflect the EXTRAVERSION changes (via KERNELRELEASE) @@ -60,12 +61,9 @@ LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc $(ARCH_DIR)/link.ld: $(ARCH_DIR)/link.ld.in - m4 -DSTART=$$(($(START_ADDR) - $(NESTING) * 0x10000000)) \ - -DSUBARCH=$(SUBARCH) -DELF_SUBARCH=$(ELF_SUBARCH) $< > $@ + m4 -DSTART=$$(($(START_ADDR) - $(NESTING) * 0x10000000)) -DSUBARCH=$(SUBARCH) -DELF_SUBARCH=$(ELF_SUBARCH) $< > $@ -SYMLINK_HEADERS = include/asm-um/archparam.h include/asm-um/system.h \ - include/asm-um/sigcontext.h include/asm-um/processor.h \ - include/asm-um/ptrace.h include/asm-um/arch-signal.h +SYMLINK_HEADERS = include/asm-um/archparam.h include/asm-um/system.h include/asm-um/sigcontext.h include/asm-um/processor.h include/asm-um/ptrace.h include/asm-um/checksum.h ARCH_SYMLINKS = include/asm-um/arch arch/um/include/sysdep $(SYMLINK_HEADERS) @@ -74,8 +72,8 @@ linux: $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS) $(ARCH_DIR)/main.o \ vmlinux $(ARCH_DIR)/link.ld mv vmlinux vmlinux.o - $(CC) -Wl,-T,$(ARCH_DIR)/link.ld $(LINK_PROFILE) $(LINK_WRAPS) \ - -o linux -static $(ARCH_DIR)/main.o vmlinux.o -L/usr/lib -lutil + $(CC) $(CFLAGS) $(ARCH_CFLAGS) -Wl,-T,$(ARCH_DIR)/link.ld $(LINK_PROFILE) $(LINK_WRAPS) \ + -o linux -static $(ARCH_DIR)/main.o vmlinux.o -L/usr/lib/gcc-lib/sparc-linux/3.0.4/64 -L/usr/lib64 -lutil USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) USER_CFLAGS := $(patsubst -Derrno=kernel_errno,,$(USER_CFLAGS)) diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/Makefile-sparc64 linux-2.4.18-sparc64um/arch/um/Makefile-sparc64 --- linux-2.4.18-origum/arch/um/Makefile-sparc64 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/Makefile-sparc64 2002-09-15 12:54:36.000000000 -0500 @@ -0,0 +1,25 @@ +ifeq ($(CONFIG_HOST_2G_2G), y) +START_ADDR = 0x60000000 +else +START_ADDR = 0xa0000000 +endif + +LD := $(LD) -m elf64_sparc +AS := $(AS) -64 --undeclared-regs + +ARCH_CFLAGS = -U__$(SUBARCH)__ -U$(SUBARCH) -m64 -pipe \ + -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 \ + -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare \ + -Wa,--undeclared-regs + +ELF_SUBARCH = elf64-sparc + +SYS_HEADERS = $(ARCH_DIR)/include/sysdep-sparc64/sc.h + +$(ARCH_DIR)/include/sysdep-sparc64/sc.h : $(ARCH_DIR)/sys-sparc64/util/mk_sc + $(ARCH_DIR)/sys-sparc64/util/mk_sc > $@ + +$(ARCH_DIR)/sys-sparc64/util/mk_sc : $(ARCH_DIR)/sys-sparc64/util/mk_sc.c + $(MAKE) -C $(ARCH_DIR)/sys-sparc64/util all + +sysclean : diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/include/sysdep-sparc64/frame.h linux-2.4.18-sparc64um/arch/um/include/sysdep-sparc64/frame.h --- linux-2.4.18-origum/arch/um/include/sysdep-sparc64/frame.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/include/sysdep-sparc64/frame.h 2002-09-12 21:12:08.000000000 -0500 @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#ifndef __FRAME_SPARC64_H +#define __FRAME_SPARC64_H + +struct arch_frame_data_raw { + unsigned long sc_end; +}; + +struct arch_frame_data { + int fpstate_size; +}; + +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ + + + + + diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/include/sysdep-sparc64/frame_kern.h linux-2.4.18-sparc64um/arch/um/include/sysdep-sparc64/frame_kern.h --- linux-2.4.18-origum/arch/um/include/sysdep-sparc64/frame_kern.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/include/sysdep-sparc64/frame_kern.h 2002-09-12 21:12:08.000000000 -0500 @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) + * Copyright (C) 2002 Shanti Katta (katta@csee.wvu.edu) + * Licensed under the GPL + */ + +#ifndef __FRAME_KERN_SPARC64_H +#define __FRAME_KERN_SPARC64_H + +/* This is called from sys_sigreturn. It takes the sp at the point of the +* sigreturn system call and returns the address of the sigcontext struct +* on the stack. +*/ + +static inline void *sp_to_sc(unsigned long sp) +{ + return((void *) sp); +} + +static inline void *sp_to_rt_sc(unsigned long sp) +{ + unsigned long sc; + + sc = sp - signal_frame_si.sp_index + signal_frame_si.len - 4; + return((void *) sc); +} + +static inline void *sp_to_mask(unsigned long sp) +{ + unsigned long mask; + + mask = sp - signal_frame_sc.sp_index + signal_frame_sc.len - 8; + return((void *) mask); +} + +extern int sc_size(void *data); + +static inline void *sp_to_rt_mask(unsigned long sp) +{ + unsigned long mask; + + mask = sp - signal_frame_si.sp_index + signal_frame_si.len + sc_size(&signal_frame_sc.arch) - 4; + return((void *) mask); +} + +#endif diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/include/sysdep-sparc64/frame_user.h linux-2.4.18-sparc64um/arch/um/include/sysdep-sparc64/frame_user.h --- linux-2.4.18-origum/arch/um/include/sysdep-sparc64/frame_user.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/include/sysdep-sparc64/frame_user.h 2002-09-12 21:12:08.000000000 -0500 @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) + * Copyright (C) 2002 Shanti Katta (katta@csee.wvu.edu) + * Licensed under the GPL + */ + +#ifndef __FRAME_USER_I386_H +#define __FRAME_USER_I386_H + +#include +#include "sysdep/frame.h" + +/* This stuff is to calculate the size of the fp state struct at runtime +* because it has changed between 2.2 and 2.4 and it would be good for a +* UML compiled on one to work on the other. +* So, setup_arch_frame_raw fills in the arch struct with the raw data, which +* just contains the address of the end of the sigcontext. This is invoked +* from the signal handler. +* setup_arch_frame uses that data to figure out what +* arch_frame_data.fpstate_size should be. It really has no idea, since it's +* not allowed to do sizeof(struct fpstate) but it's safe to consider that it's + * everything from the end of the sigcontext up to the top of the stack. So, +* it masks off the page number to get the offset within the page and subtracts + * that from the page size, and that's how big the fpstate struct will be +* considered to be. +*/ + +static inline void setup_arch_frame_raw(struct arch_frame_data_raw *data, + struct sigcontext *sc) +{ + data->sc_end = (unsigned long) sc; + data->sc_end += sizeof(*sc); +} + +static inline void setup_arch_frame(struct arch_frame_data_raw *in, + struct arch_frame_data *out) +{ + unsigned long fpstate_start = in->sc_end; + + fpstate_start &= ~PAGE_MASK; + out->fpstate_size = PAGE_SIZE - fpstate_start; +} + +/* This figures out where on the stack the SA_RESTORER function address +* is stored. For i386, it's the signal handler return address, so it's +* located next to the frame pointer. +* This is inlined, so __builtin_frame_address(0) is correct. Otherwise, +* it would have to be __builtin_frame_address(1). +*/ + +static inline unsigned long frame_restorer(void) +{ + unsigned long *fp; + + fp = __builtin_frame_address(0); + return((unsigned long) (fp + 1)); +} + +/* Similarly, this returns the value of sp when the handler was first + * entered. This is used to calculate the proper sp when delivering + * signals. + */ + +static inline unsigned long frame_sp(void) +{ + unsigned long *fp; + + fp = __builtin_frame_address(0); + return((unsigned long) (fp + 1)); +} + +#endif diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/include/sysdep-sparc64/ptrace.h linux-2.4.18-sparc64um/arch/um/include/sysdep-sparc64/ptrace.h --- linux-2.4.18-origum/arch/um/include/sysdep-sparc64/ptrace.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/include/sysdep-sparc64/ptrace.h 2002-09-12 21:12:08.000000000 -0500 @@ -0,0 +1,206 @@ + +#ifndef __SYSDEP_SPARC64_PTRACE_H +#define __SYSDEP_SPARC64_PTRACE_H + +/* Note that only the first 16 are the realu_regs. 17-19 are hacks */ +/* to let us access things like the program counter. The defines below + set indexes up for us. +*/ + +#include "sysdep/sc.h" + +#define UM_MAX_REG (19) + +#define UREG_TSTATE 17 +#define UREG_TPC 18 +#define UREG_TNPC 19 + +struct uml_pt_regs { + unsigned long args[6]; + long syscall; + int is_user; + void *sc; +}; + +#define EMPTY_UML_PT_REGS { \ + syscall : -1, \ + args : { [0 ... 5] = 0 }, \ + is_user : 0, \ + sc : NULL } + +struct sys_pt_regs { + unsigned long u_regs[UM_MAX_REG]; + unsigned int y; + unsigned int fprs; +}; + +/*#define EMPTY_REGS { { [ 0 ... UM_MAX_REG - 1 ] = 0 } }*/ + +#define UM_REG(r, n) ((r)->regs[n]) + +/* These next two will prolly need to be fixed, but it will help compile */ +/* And since the ptrace stuff still needs to be fixed, all these could be + wrong. +*/ + +#define UPT_U_REGS[x](regs) SC_U_REGS[x]((regs)->sc) +/*#define UPT_U_REGS[1](regs) SC_U_REGS[1]((regs)->sc) +#define UPT_U_REGS[2](regs) SC_U_REGS[2]((regs)->sc) +#define UPT_U_REGS[3](regs) SC_U_REGS[3]((regs)->sc) +#define UPT_U_REGS[4](regs) SC_U_REGS[4]((regs)->sc) +#define UPT_U_REGS[5](regs) SC_U_REGS[5]((regs)->sc) +#define UPT_U_REGS[6](regs) SC_U_REGS[6]((regs)->sc) +#define UPT_U_REGS[7](regs) SC_U_REGS[7]((regs)->sc) +#define UPT_U_REGS[8](regs) SC_U_REGS[8]((regs)->sc) +#define UPT_U_REGS[9](regs) SC_U_REGS[9]((regs)->sc) +#define UPT_U_REGS[10](regs) SC_U_REGS[10]((regs)->sc) +#define UPT_U_REGS[11](regs) SC_U_REGS[11]((regs)->sc) +#define UPT_U_REGS[12](regs) SC_U_REGS[12]((regs)->sc) +#define UPT_U_REGS[13](regs) SC_U_REGS[13]((regs)->sc) +#define UPT_U_REGS[14](regs) SC_U_REGS[14]((regs)->sc) +#define UPT_U_REGS[15](regs) SC_U_REGS[15]((regs)->sc)*/ +#define UPT_TSTATE(regs) SC_TSTATE((regs)->sc) +#define UPT_FP(regs) SC_FP((regs)->sc) +#define UPT_RETPC(regs) SC_RETPC((regs)->sc) + +#define UPT_TPC(regs) SC_TPC((regs)->sc) +#define UPT_TNPC(regs) SC_TNPC((regs)->sc) + +#define UPT_IP(regs) SC_IP((regs)->sc) +#define UPT_SP(regs) SC_SP((regs)->sc) + +#define UPT_SC(regs) ((regs)->sc) + +#define UPT_REG(regs, reg) \ +({ unsigned long val; \ + switch(reg){ \ + case UREG_G0: val = UPT_U_REGS[0](regs); break; \ + case UREG_G1: val = UPT_U_REGS[1](regs); break; \ + case UREG_G2: val = UPT_U_REGS[2](regs); break; \ + case UREG_G3: val = UPT_U_REGS[3](regs); break; \ + case UREG_G4: val = UPT_U_REGS[4](regs); break; \ + case UREG_G5: val = UPT_U_REGS[5](regs); break; \ + case UREG_G6: val = UPT_U_REGS[6](regs); break; \ + case UREG_G7: val = UPT_U_REGS[7](regs); break; \ + case UREG_I0: val = UPT_U_REGS[8](regs); break; \ + case UREG_I1: val = UPT_U_REGS[9](regs); break; \ + case UREG_I2: val = UPT_U_REGS[10](regs); break; \ + case UREG_I3: val = UPT_U_REGS[11](regs); break; \ + case UREG_I4: val = UPT_U_REGS[12](regs); break; \ + case UREG_I5: val = UPT_U_REGS[13](regs); break; \ + case UREG_I6: val = UPT_U_REGS[14](regs); break; \ + case UREG_I7: val = UPT_U_REGS[15](regs); break; \ + case UREG_TPC: val = UPT_IP(regs); break; \ + case UREG_TSTATE: val = UPT_SP(regs); break; \ + case UREG_TNPC: val = UPT_TNPC(regs); break; \ + case UREG_FP: val = UPT_FP(regs); break; \ + case UREG_RETPC: val = UPT_RETPC(regs); break; \ + default: \ + panic("Bad register in UPT_REG : %d\n", reg); \ + val = -1; \ + }\ + val; \ +}) + +#define UPT_SET(regs, reg, val) \ + do { \ + switch(reg){ \ + case UREG_G0: UPT_U_REGS[0](reg) = val; break; \ + case UREG_G1: UPT_U_REGS[1](reg) = val; break; \ + case UREG_G2: UPT_U_REGS[2](reg) = val; break; \ + case UREG_G3: UPT_U_REGS[3](reg) = val; break; \ + case UREG_G4: UPT_U_REGS[4](reg) = val; break; \ + case UREG_G5: UPT_U_REGS[5](reg) = val; break; \ + case UREG_G6: UPT_U_REGS[6](reg) = val; break; \ + case UREG_G7: UPT_U_REGS[7](reg) = val; break; \ + case UREG_I0: UPT_U_REGS[8](reg) = val; break; \ + case UREG_I1: UPT_U_REGS[9](reg) = val; break; \ + case UREG_I2: UPT_U_REGS[10](reg) = val; break; \ + case UREG_I3: UPT_U_REGS[11](reg) = val; break; \ + case UREG_I4: UPT_U_REGS[12](reg) = val; break; \ + case UREG_I5: UPT_U_REGS[13](reg) = val; break; \ + case UREG_I6: UPT_U_REGS[14](reg) = val; break; \ + case UREG_I7: UPT_U_REGS[15](reg) = val; break; \ + case UREG_TPC: UPT_IP(reg) = val; break; \ + case UREG_TSTATE: UPT_SP(reg) = val; break; \ + case UREG_TNPC: UPT_TNPC(reg) = val; break; \ + case UREG_FP: UPT_FP(reg) = val; break; \ + case UREG_RETPC: UPT_RETPC(reg) = val; break; \ + default: \ + panic("Bad register in UPT_SET : %d\n", reg); \ + break; \ + } \ +} while (0) + +#define UPT_SET_SYSCALL_RETURN(regs, res) \ + SC_SET_SYSCALL_RETURN((regs)->sc, (res)) +#define UPT_RESTART_SYSCALL(regs) SC_RESTART_SYSCALL((regs)->sc) +#define UPT_ORIG_SYSCALL(regs) UPT_FP(regs) +#define UPT_SYSCALL_NR(regs) ((regs)->syscall) +#define UPT_SYSCALL_RET(regs) UPT_RETPC(regs) + +#define UM_IP(r) UM_REG(r, UREG_TPC) +#define UM_IP_OFFSET (UREG_TPC * sizeof(long)) + +#define UM_SYSCALL_NR(r) UM_REG(r, UREG_IO) +#define UM_SYSCALL_RR_OFFSET (UREG_IO * sizeof(long)) + +#define UM_SYSCALL_SP(r) UM_REG(r, UREG_TSTATE) +#define UM_SYSCALL_SP_OFFSET(r) (UREG_TSTATE * sizeof(long)) + +/* This certainly is broken. No clue (yet) what this should be */ + +#define UM_ELF_ZERO UMREG(r, 0) +#define UM_ELF_ZERO_OFFSET (0, * sizeof(long)) + +/* OK, now on i386 this is null, on PPC the stack needs moving to a 16 + byte boundary. I'll bet on SPARC64 it will want it on a 64 byte boundary. + More code to write for when the ptrace stuff gets fixed. +*/ + +#define UM_FIX_EXEC_STACK(sp) do ; while(0) + +/* This is also broken... */ + +#define UM_SYSCALL_RET(r) UM_REG(r, UREG_I7) +#define UM_SYSCALL_RET_OFFSET (UREG_I7 * sizeof(long)) + +/* This is likely broken.... */ + +#define UM_SET_SYSCALL_RETURN(r, result) UM_REG(r, UREG_I7) = (result) + +/* The args to ptrace. Again, this might well be seriously wrong */ + +#define UM_SYSCALL_ARG1(r) UM_REG(r, UREG_I0) +#define UM_SYSCALL_ARG2(r) UM_REG(r, UREG_I1) +#define UM_SYSCALL_ARG3(r) UM_REG(r, UREG_I2) +#define UM_SYSCALL_ARG4(r) UM_REG(r, UREG_I3) +#define UM_SYSCALL_ARG5(r) UM_REG(r, UREG_I4) +#define UM_SYSCALL_ARG6(r) UM_REG(0) /* This is prolly wrong */ + +#define UM_SYSCALL_ARG1_OFFSET (UREG_IO * sizeof(long)) +#define UM_SYSCALL_ARG2_OFFSET (UREG_I1 * sizeof(long)) +#define UM_SYSCALL_ARG3_OFFSET (UREG_I2 * sizeof(long)) +#define UM_SYSCALL_ARG4_OFFSET (UREG_I3 * sizeof(long)) +#define UM_SYSCALL_ARG5_OFFSET (UREG_I4 * sizeof(long)) +#define UM_SYSCALL_ARG6_OFFSET (UREG_I5 * sizeof(long)) + +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ + + + + + + + diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/include/sysdep-sparc64/ptrace_user.h linux-2.4.18-sparc64um/arch/um/include/sysdep-sparc64/ptrace_user.h --- linux-2.4.18-origum/arch/um/include/sysdep-sparc64/ptrace_user.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/include/sysdep-sparc64/ptrace_user.h 2002-09-12 21:12:08.000000000 -0500 @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) + * Copyright (C) 2002 Shanti Katta (katta@csee.wvu.edu) + * Licensed under the GPL + */ + +#ifndef __SYSDEP_SPARC64_PTRACE_USER_H__ +#define __SYSDEP_SPARC64_PTRACE_USER_H__ + +#include + +#define PT_OFFSET(r) ((r) * sizeof(long)) + +#define PT_SYSCALL_NR(regs) ((regs)[UREG_FP]) +#define PT_SYSCALL_NR_OFFSET PT_OFFSET(UREG_FP) + +#define PT_SYSCALL_ARG1_OFFSET PT_OFFSET(UREG_I0) +#define PT_SYSCALL_ARG2_OFFSET PT_OFFSET(UREG_I1) +#define PT_SYSCALL_ARG3_OFFSET PT_OFFSET(UREG_I2) +#define PT_SYSCALL_ARG4_OFFSET PT_OFFSET(UREG_I3) +#define PT_SYSCALL_ARG5_OFFSET PT_OFFSET(UREG_I4) + +#define PT_SYSCALL_RET_OFFSET PT_OFFSET(UREG_RETPC) + +#define PT_IP_OFFSET PT_OFFSET(UREG_TPC) +#define PT_IP(regs) ((regs)[UREG_TPC]) +#define PT_SP(regs) ((regs)[UREG_TSTATE]) + +#ifndef FRAME_SIZE +#define FRAME_SIZE (32) +#endif +#define FRAME_SIZE_OFFSET (22 * sizeof(unsigned long)) /* 22 stands for PTRACE_GETREGS in SPARC64 */ + +#define FP_FRAME_SIZE (32) /* Sparc64 defines 32 double-precision floating point registers */ + +#ifdef PTRACE_GETREGS +#define UM_HAVE_GETREGS +#endif + +#ifdef PTRACE_SETREGS +#define UM_HAVE_SETREGS +#endif + +#ifdef PTRACE_GETFPREGS +#define UM_HAVE_GETFPREGS +#endif + +#ifdef PTRACE_SETFPREGS +#define UM_HAVE_SETFPREGS +#endif + +#endif + + + + diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/include/sysdep-sparc64/sc.h linux-2.4.18-sparc64um/arch/um/include/sysdep-sparc64/sc.h --- linux-2.4.18-origum/arch/um/include/sysdep-sparc64/sc.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/include/sysdep-sparc64/sc.h 2002-09-12 21:12:08.000000000 -0500 @@ -0,0 +1,10 @@ +#define SC_IP(sc) *((unsigned long *) &(((char *) (sc))[264])) +#define SC_SP(sc) *((unsigned long *) &(((char *) (sc))[256])) +#define SC_FP(sc) *((unsigned long *) &(((char *) (sc))[240])) +#define SC_UREG_I0(sc) *((unsigned long *) &(((char *) (sc))[192])) +#define SC_UREG_I1(sc) *((unsigned long *) &(((char *) (sc))[200])) +#define SC_UREG_I2(sc) *((unsigned long *) &(((char *) (sc))[208])) +#define SC_UREG_I3(sc) *((unsigned long *) &(((char *) (sc))[216])) +#define SC_UREG_I4(sc) *((unsigned long *) &(((char *) (sc))[224])) +#define SC_UREG_I5(sc) *((unsigned long *) &(((char *) (sc))[232])) +#define SC_RETPC(sc) *((unsigned long *) &(((char *) (sc))[248])) diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/include/sysdep-sparc64/sigcontext.h linux-2.4.18-sparc64um/arch/um/include/sysdep-sparc64/sigcontext.h --- linux-2.4.18-origum/arch/um/include/sysdep-sparc64/sigcontext.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/include/sysdep-sparc64/sigcontext.h 2002-09-12 21:12:08.000000000 -0500 @@ -0,0 +1,47 @@ +/* + Copyright (C) 2002 Shanti Katta(katta@csee.wvu.edu) + Copyright (C) 2001 Iain Young(iain@g7iii.demon.co.uk) + Copyright (C) 2000 Jeff Dike(jdike@karaya.com) + Licensed under the GPL +*/ + +/* Again, stolen from the IA64 placekeeper. then nicked bits from + the PPC and i386 ports +*/ + +#ifndef __SYS_SIGCONTEXT_SPARC64_H +#define __SYS_SIGCONTEXT_SPARC64_H + +/*#define UM_ALLOCATE_SC(name) struct sigcontext name*/ + +#define SC_RESTART_SYSCALL(sc) (SC_IP(sc) -= 2) +#define SC_SET_SYSCALL_RETURN(sc, result) do SC_FP(sc) = (result) ; while(0) + +#define SC_FAULT_ADDR(sc) SC_UREG_I1(sc) +#define SC_FAULT_WRITE(sc) (SC_UREG_I2(sc) & 2) + +#define SC_START_SYSCALL(sc) do ; while(0) + +/*#define SC_IP(sc) ((sc)->eip) +#define SC_SP(sc) ((sc)->esp_at_signal)*/ + +#define SEGV_IS_FIXABLE(sc) ((SC_UREG_I3(sc) == 13) || (SC_UREG_I3(sc) == 14)) + +static inline void sc_to_regs(struct uml_pt_regs *regs, struct sigcontext *sc, unsigned long syscall) +{ + regs->syscall = syscall; + regs->args[0] = SC_UREG_I0(sc); + regs->args[1] = SC_UREG_I1(sc); + regs->args[2] = SC_UREG_I2(sc); + regs->args[3] = SC_UREG_I3(sc); + regs->args[4] = SC_UREG_I4(sc); + regs->args[5] = SC_UREG_I5(sc); +} + +extern unsigned long *sc_sigmask(void *sc_ptr); +extern int sc_get_fpregs(unsigned long buf, void *sc_ptr); + +#endif + + + diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/include/sysdep-sparc64/syscalls.h linux-2.4.18-sparc64um/arch/um/include/sysdep-sparc64/syscalls.h --- linux-2.4.18-origum/arch/um/include/sysdep-sparc64/syscalls.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/include/sysdep-sparc64/syscalls.h 2002-09-12 21:12:08.000000000 -0500 @@ -0,0 +1,201 @@ +/* + * Copyright (C) 2000 Jeff Dike (jdike@karaya.com) + * Copyright (C) 2001 Iain Young (iain@g7iii.demon.co.uk) + * Copyright (C) 2002 Shanti Katta (katta@csee.wvu.edu) + * Licensed under the GPL + */ + +/* Again, mostly nicked from Jeff's code, and ported to SPARC64 */ + +#ifndef __SYSDEP_SPARC64_SYSCALLS_H +#define __SYSDEP_SPARC64_SYSCALLS_H + +#include "asm/unistd.h" + +typedef long syscall_handler_t(struct pt_regs); + +#define EXECUTE_SYSCALL(syscall, regs) (*sys_call_table[syscall])(*regs) + +#define ARCH_SYSCALLS \ + [ __NR_exit ] = sys_exit, \ + [ __NR_fork ] = sys_fork, \ + [ __NR_read ] = sys_read, \ + [ __NR_write ] = sys_write, \ + [ __NR_open ] = sys_open, \ + [ __NR_close ] = sys_close, \ + [ __NR_wait4 ] = sys_wait4, \ + [ __NR_creat ] = sys_creat, \ + [ __NR_link ] = sys_link, \ + [ __NR_unlink ] = sys_unlink, \ + [ __NR_chdir ] = sys_chdir, \ + [ __NR_chown ] = sys_chown, \ + [ __NR_mknod ] = sys_mknod, \ + [ __NR_chmod ] = sys_chmod, \ + [ __NR_lchown ] = sys_lchown, \ + [ __NR_lseek ] = sys_lseek, \ + [ __NR_getpid ] = sys_getpid, \ + [ __NR_capget ] = sys_capget, \ + [ __NR_capset ] = sys_capset, \ + [ __NR_getuid ] = sys_getuid, \ + [ __NR_ptrace ] = sys_ptrace, \ + [ __NR_alarm ] = sys_alarm, \ + [ __NR_sigaltstack ] = sys_sigaltstack, \ + [ __NR_pause ] = sys_pause, \ + [ __NR_utime ] = sys_utime, \ + [ __NR_access ] = sys_access, \ + [ __NR_nice ] = sys_nice, \ + [ __NR_sync ] = sys_sync, \ + [ __NR_kill ] = sys_kill, \ + [ __NR_sendfile ] = sys_sendfile, \ + [ __NR_dup ] = sys_dup, \ + [ __NR_pipe ] = sys_pipe, \ + [ __NR_times ] = sys_times, \ + [ __NR_setgid ] = sys_setgid, \ + [ __NR_getgid ] = sys_getgid, \ + [ __NR_signal ] = sys_signal, \ + [ __NR_geteuid ] = sys_geteuid, \ + [ __NR_acct ] = sys_acct, \ + [ __NR_ioctl ] = sys_ioctl, \ + [ __NR_reboot ] = sys_reboot, \ + [ __NR_symlink ] = sys_symlink, \ + [ __NR_readlink ] = sys_readlink, \ + [ __NR_execve ] = sys_execve, \ + [ __NR_umask ] = sys_umask, \ + [ __NR_chroot ] = sys_chroot, \ + [ __NR_msync ] = sys_msync, \ + [ __NR_vfork ] = sys_vfork, \ + [ __NR_pread ] = sys_pread, \ + [ __NR_pwrite ] = sys_pwrite, \ + [ __NR_munmap ] = sys_munmap, \ + [ __NR_mprotect ] = sys_mprotect, \ + [ __NR_madvise ] = sys_madvise, \ + [ __NR_vhangup ] = sys_vhangup, \ + [ __NR_mincore ] = sys_mincore, \ + [ __NR_getgroups ] = sys_getgroups, \ + [ __NR_setgroups ] = sys_setgroups, \ + [ __NR_getpgrp ] = sys_getpgrp, \ + [ __NR_setitimer ] = sys_setitimer, \ + [ __NR_swapon ] = sys_swapon, \ + [ __NR_getitimer ] = sys_getitimer, \ + [ __NR_sethostname ] = sys_sethostname, \ + [ __NR_dup2 ] = sys_dup2, \ + [ __NR_fcntl ] = sys_fcntl, \ + [ __NR_select ] = sys_select, \ + [ __NR_fsync ] = sys_fsync, \ + [ __NR_setpriority ] = sys_setpriority, \ + [ __NR_getpriority ] = sys_getpriority, \ + [ __NR_rt_sigreturn ] = sys_rt_sigreturn, \ + [ __NR_rt_sigprocmask ] = sys_rt_sigprocmask, \ + [ __NR_rt_sigpending ] = sys_rt_sigpending, \ + [ __NR_rt_sigtimedwait ] = sys_rt_sigtimedwait, \ + [ __NR_rt_sigqueueinfo ] = sys_rt_sigqueueinfo, \ + [ __NR_rt_sigsuspend ] = sys_rt_sigsuspend, \ + [ __NR_setresuid ] = sys_setresuid, \ + [ __NR_getresuid ] = sys_getresuid, \ + [ __NR_setresgid ] = sys_setresgid, \ + [ __NR_getresgid ] = sys_getresgid, \ + [ __NR_gettimeofday ] = sys_gettimeofday, \ + [ __NR_getrusage ] = sys_getrusage, \ + [ __NR_getcwd ] = sys_getcwd, \ + [ __NR_readv ] = sys_readv, \ + [ __NR_writev ] = sys_writev, \ + [ __NR_settimeofday ] = sys_settimeofday, \ + [ __NR_fchown ] = sys_fchown, \ + [ __NR_fchmod ] = sys_fchmod, \ + [ __NR_setreuid ] = sys_setreuid, \ + [ __NR_setregid ] = sys_setregid, \ + [ __NR_rename ] = sys_rename, \ + [ __NR_truncate ] = sys_truncate, \ + [ __NR_ftruncate ] = sys_ftruncate, \ + [ __NR_flock ] = sys_flock, \ + [ __NR_mkdir ] = sys_mkdir, \ + [ __NR_rmdir ] = sys_rmdir, \ + [ __NR_gettid ] = sys_gettid, \ + [ __NR_getrlimit ] = sys_getrlimit, \ + [ __NR_setrlimit ] = sys_setrlimit, \ + [ __NR_pivot_root ] = sys_pivot_root, \ + [ __NR_prctl ] = sys_prctl, \ + [ __NR_poll ] = sys_poll, \ + [ __NR_getdents64 ] = sys_getdents64, \ + [ __NR_statfs ] = sys_statfs, \ + [ __NR_fstatfs ] = sys_fstatfs, \ + [ __NR_umount ] = sys_umount, \ + [ __NR_setdomainname ] = sys_setdomainname, \ + [ __NR_quotactl ] = sys_quotactl, \ + [ __NR_mount ] = sys_mount, \ + [ __NR_ustat ] = sys_ustat, \ + [ __NR_getdents ] = sys_getdents, \ + [ __NR_setsid ] = sys_setsid, \ + [ __NR_fchdir ] = sys_fchdir, \ + [ __NR_sigpending ] = sys_sigpending, \ + [ __NR_query_module ] = sys_query_module, \ + [ __NR_setpgid ] = sys_setpgid, \ + [ __NR_uname ] = sys_uname, \ + [ __NR_init_module ] = sys_init_module, \ + [ __NR_personality ] = sys_personality, \ + [ __NR_getppid ] = sys_getppid, \ + [ __NR_sigaction ] = sys_sigaction, \ + [ __NR_sgetmask ] = sys_sgetmask, \ + [ __NR_ssetmask ] = sys_ssetmask, \ + [ __NR_sigsuspend ] = sys_sigsuspend, \ + [ __NR_uselib ] = sys_uselib, \ + [ __NR_readahead ] = sys_readahead, \ + [ __NR_socketcall ] = sys_socketcall, \ + [ __NR_syslog ] = sys_syslog, \ + [ __NR_waitpid ] = sys_waitpid, \ + [ __NR_swapoff ] = sys_swapoff, \ + [ __NR_sysinfo ] = sys_sysinfo, \ + [ __NR_ipc ] = sys_ipc, \ + [ __NR_sigreturn ] = sys_sigreturn, \ + [ __NR_clone ] = sys_clone, \ + [ __NR_adjtimex ] = sys_adjtimex, \ + [ __NR_sigprocmask ] = sys_sigprocmask, \ + [ __NR_create_module ] = sys_create_module, \ + [ __NR_delete_module ] = sys_delete_module, \ + [ __NR_get_kernel_syms ] = sys_get_kernel_syms, \ + [ __NR_getpgid ] = sys_getpgid, \ + [ __NR_bdflush ] = sys_bdflush, \ + [ __NR_sysfs ] = sys_sysfs, \ + [ __NR_setfsuid ] = sys_setfsuid, \ + [ __NR_setfsgid ] = sys_setfsgid, \ + [ __NR__llseek ] = sys_llseek, \ + [ __NR_mlock ] = sys_mlock, \ + [ __NR_munlock ] = sys_munlock, \ + [ __NR_mlockall ] = sys_mlockall, \ + [ __NR_munlockall ] = sys_munlockall, \ + [ __NR_sched_setparam ] = sys_sched_setparam, \ + [ __NR_sched_getparam ] = sys_sched_getparam, \ + [ __NR_sched_setscheduler ] = sys_sched_setscheduler, \ + [ __NR_sched_getscheduler ] = sys_sched_getscheduler, \ + [ __NR_sched_yield ] = sys_sched_yield, \ + [ __NR_sched_get_priority_max ] = sys_sched_get_priority_max, \ + [ __NR_sched_get_priority_min ] = sys_sched_get_priority_min, \ + [ __NR_sched_rr_get_interval ] = sys_sched_rr_get_interval, \ + [ __NR_nanosleep ] = sys_nanosleep, \ + [ __NR_mremap ] = sys_mremap, \ + [ __NR__sysctl ] = sys_sysctl, \ + [ __NR_getsid ] = sys_getsid, \ + [ __NR_fdatasync ] = sys_fdatasync, \ + [ __NR_nfsservctl ] = sys_nfsservctl, \ + [ 222 ] = sys_ni_syscall, + +/*#define LAST_ARCH_SYSCALL __NR__exit*/ + +#define LAST_ARCH_SYSCALL 222 + +#endif + + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ + + + diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/include/task.h linux-2.4.18-sparc64um/arch/um/include/task.h --- linux-2.4.18-origum/arch/um/include/task.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/include/task.h 2002-09-13 20:02:57.000000000 -0500 @@ -0,0 +1,11 @@ +/* + * Generated by mk_task + */ + +#ifndef __TASK_H +#define __TASK_H + +#define TASK_REGS(task) ((struct uml_pt_regs *) &(((char *) (task))[1016])) +#define TASK_PID(task) *((int *) &(((char *) (task))[228])) + +#endif diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/kernel/Makefile linux-2.4.18-sparc64um/arch/um/kernel/Makefile --- linux-2.4.18-origum/arch/um/kernel/Makefile 2002-09-12 19:00:36.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/kernel/Makefile 2002-09-12 22:03:09.000000000 -0500 @@ -57,7 +57,7 @@ $(CC) $(CFLAGS_$@) -c -o $@ $< unmap_fin.o : unmap.o - ld -r -o $@ $< -lc -L/usr/lib + ld -m elf64_sparc --multilib-dir 64 -r -o $@ $< -lc -L/usr/lib64 QUOTE = 'my $$config=`cat $(TOPDIR)/.config`; $$config =~ s/"/\\"/g ; while() { $$_ =~ s/CONFIG/$$config/; print $$_ }' diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/kernel/exec_kern.c linux-2.4.18-sparc64um/arch/um/kernel/exec_kern.c --- linux-2.4.18-origum/arch/um/kernel/exec_kern.c 2002-09-12 19:00:36.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/kernel/exec_kern.c 2002-09-12 21:46:47.000000000 -0500 @@ -17,6 +17,7 @@ #include "tlb.h" #include "2_5compat.h" + /* See comment above fork_tramp for why sigstop is defined and used like * this */ diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/kernel/frame_kern.c linux-2.4.18-sparc64um/arch/um/kernel/frame_kern.c --- linux-2.4.18-origum/arch/um/kernel/frame_kern.c 2002-09-12 19:00:36.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/kernel/frame_kern.c 2002-09-12 21:48:21.000000000 -0500 @@ -87,8 +87,8 @@ signal_frame_si.sr_relative)) return(1); - PT_REGS_IP(regs) = handler; - PT_REGS_SP(regs) = start + signal_frame_sc.sp_index; + /*PT_REGS_IP(regs) = handler; + PT_REGS_SP(regs) = start + signal_frame_sc.sp_index;*/ return(0); } diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/kernel/irq.c linux-2.4.18-sparc64um/arch/um/kernel/irq.c --- linux-2.4.18-origum/arch/um/kernel/irq.c 2002-09-12 19:00:36.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/kernel/irq.c 2002-09-12 21:51:58.000000000 -0500 @@ -181,6 +181,8 @@ * This function may be called from IRQ context. */ +#undef disable_irq_nosync + void inline disable_irq_nosync(unsigned int irq) { irq_desc_t *desc = irq_desc + irq; diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/kernel/signal_kern.c linux-2.4.18-sparc64um/arch/um/kernel/signal_kern.c --- linux-2.4.18-origum/arch/um/kernel/signal_kern.c 2002-09-12 19:00:36.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/kernel/signal_kern.c 2002-09-12 22:02:19.000000000 -0500 @@ -98,14 +98,14 @@ if (ka->sa.sa_flags & SA_ONESHOT) ka->sa.sa_handler = SIG_DFL; - if (!(ka->sa.sa_flags & SA_NODEFER)) { + /*if (!(ka->sa.sa_flags & SA_NODEFER)) { spin_lock_irq(¤t->sigmask_lock); sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); sigaddset(¤t->blocked, signr); recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); - } + }*/ sp = PT_REGS_SP(regs); @@ -116,8 +116,8 @@ sp -= 4 * sizeof(void *); - if (ka->sa.sa_flags & SA_RESTORER) restorer = ka->sa.sa_restorer; - else restorer = NULL; + /*if (ka->sa.sa_flags & SA_RESTORER) restorer = ka->sa.sa_restorer; + else restorer = NULL;*/ if(ka->sa.sa_flags & SA_SIGINFO) err = setup_signal_stack_si(sp, signr, (unsigned long) handler, diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/kernel/sys_call_table.c linux-2.4.18-sparc64um/arch/um/kernel/sys_call_table.c --- linux-2.4.18-origum/arch/um/kernel/sys_call_table.c 2002-09-12 19:00:36.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/kernel/sys_call_table.c 2002-09-12 21:59:19.000000000 -0500 @@ -84,7 +84,7 @@ extern syscall_handler_t sys_getgroups16; extern syscall_handler_t sys_setgroups16; extern syscall_handler_t sys_symlink; -extern syscall_handler_t sys_lstat; +/*extern syscall_handler_t sys_lstat;*/ extern syscall_handler_t sys_readlink; extern syscall_handler_t sys_uselib; extern syscall_handler_t sys_swapon; @@ -174,7 +174,7 @@ extern syscall_handler_t sys_getresgid16; extern syscall_handler_t sys_prctl; extern syscall_handler_t sys_ni_syscall; -extern syscall_handler_t sys_rt_sigaction; +/*extern syscall_handler_t sys_rt_sigaction;*/ extern syscall_handler_t sys_rt_sigprocmask; extern syscall_handler_t sys_rt_sigpending; extern syscall_handler_t sys_rt_sigtimedwait; @@ -259,8 +259,8 @@ [ __NR_mknod ] = sys_mknod, [ __NR_chmod ] = sys_chmod, [ __NR_lchown ] = sys_lchown16, - [ __NR_break ] = sys_ni_syscall, - [ __NR_oldstat ] = sys_stat, + /*[ __NR_break ] = sys_ni_syscall,*/ + /*[ __NR_oldstat ] = sys_stat,*/ [ __NR_lseek ] = sys_lseek, [ __NR_getpid ] = sys_getpid, [ __NR_mount ] = um_mount, @@ -270,14 +270,14 @@ [ __NR_stime ] = um_stime, [ __NR_ptrace ] = sys_ptrace, [ __NR_alarm ] = sys_alarm, - [ __NR_oldfstat ] = sys_fstat, + /*[ __NR_oldfstat ] = sys_fstat,*/ [ __NR_pause ] = sys_pause, [ __NR_utime ] = sys_utime, - [ __NR_stty ] = sys_ni_syscall, - [ __NR_gtty ] = sys_ni_syscall, + /*[ __NR_stty ] = sys_ni_syscall, + [ __NR_gtty ] = sys_ni_syscall,*/ [ __NR_access ] = sys_access, [ __NR_nice ] = sys_nice, - [ __NR_ftime ] = sys_ni_syscall, + /*[ __NR_ftime ] = sys_ni_syscall,*/ [ __NR_sync ] = sys_sync, [ __NR_kill ] = sys_kill, [ __NR_rename ] = sys_rename, @@ -288,7 +288,7 @@ [ __NR_dup ] = (syscall_handler_t *) sys_dup, [ __NR_pipe ] = sys_pipe, [ __NR_times ] = sys_times, - [ __NR_prof ] = sys_ni_syscall, + /*[ __NR_prof ] = sys_ni_syscall,*/ [ __NR_brk ] = sys_brk, [ __NR_setgid ] = sys_setgid16, [ __NR_getgid ] = sys_getgid16, @@ -297,13 +297,13 @@ [ __NR_getegid ] = sys_getegid16, [ __NR_acct ] = sys_acct, [ __NR_umount2 ] = sys_umount, - [ __NR_lock ] = sys_ni_syscall, + /*[ __NR_lock ] = sys_ni_syscall,*/ [ __NR_ioctl ] = sys_ioctl, [ __NR_fcntl ] = sys_fcntl, - [ __NR_mpx ] = sys_ni_syscall, + /*[ __NR_mpx ] = sys_ni_syscall,*/ [ __NR_setpgid ] = sys_setpgid, - [ __NR_ulimit ] = sys_ni_syscall, - [ __NR_oldolduname ] = sys_olduname, + /*[ __NR_ulimit ] = sys_ni_syscall, + [ __NR_oldolduname ] = sys_olduname,*/ [ __NR_umask ] = sys_umask, [ __NR_chroot ] = sys_chroot, [ __NR_ustat ] = sys_ustat, @@ -327,7 +327,7 @@ [ __NR_getgroups ] = sys_getgroups16, [ __NR_setgroups ] = sys_setgroups16, [ __NR_symlink ] = sys_symlink, - [ __NR_oldlstat ] = sys_lstat, + /*[ __NR_oldlstat ] = sys_lstat,*/ [ __NR_readlink ] = sys_readlink, [ __NR_uselib ] = sys_uselib, [ __NR_swapon ] = sys_swapon, @@ -340,10 +340,10 @@ [ __NR_fchown ] = sys_fchown16, [ __NR_getpriority ] = sys_getpriority, [ __NR_setpriority ] = sys_setpriority, - [ __NR_profil ] = sys_ni_syscall, + /*[ __NR_profil ] = sys_ni_syscall,*/ [ __NR_statfs ] = sys_statfs, [ __NR_fstatfs ] = sys_fstatfs, - [ __NR_ioperm ] = sys_ni_syscall, + /*[ __NR_ioperm ] = sys_ni_syscall,*/ [ __NR_socketcall ] = sys_socketcall, [ __NR_syslog ] = sys_syslog, [ __NR_setitimer ] = sys_setitimer, @@ -351,10 +351,10 @@ [ __NR_stat ] = sys_newstat, [ __NR_lstat ] = sys_newlstat, [ __NR_fstat ] = sys_newfstat, - [ __NR_olduname ] = sys_uname, - [ __NR_iopl ] = sys_ni_syscall, + /*[ __NR_olduname ] = sys_uname, + [ __NR_iopl ] = sys_ni_syscall,*/ [ __NR_vhangup ] = sys_vhangup, - [ __NR_idle ] = sys_ni_syscall, + /*[ __NR_idle ] = sys_ni_syscall,*/ [ __NR_wait4 ] = (syscall_handler_t *) sys_wait4, [ __NR_swapoff ] = sys_swapoff, [ __NR_sysinfo ] = sys_sysinfo, @@ -406,7 +406,7 @@ [ __NR_mremap ] = sys_mremap, [ __NR_setresuid ] = sys_setresuid16, [ __NR_getresuid ] = sys_getresuid16, - [ __NR_vm86 ] = sys_ni_syscall, + /*[ __NR_vm86 ] = sys_ni_syscall,*/ [ __NR_query_module ] = sys_query_module, [ __NR_poll ] = sys_poll, [ __NR_nfsservctl ] = sys_nfsservctl, @@ -414,7 +414,7 @@ [ __NR_getresgid ] = sys_getresgid16, [ __NR_prctl ] = sys_prctl, [ __NR_rt_sigreturn ] = sys_rt_sigreturn, - [ __NR_rt_sigaction ] = sys_rt_sigaction, + /*[ __NR_rt_sigaction ] = sys_rt_sigaction,*/ [ __NR_rt_sigprocmask ] = sys_rt_sigprocmask, [ __NR_rt_sigpending ] = sys_rt_sigpending, [ __NR_rt_sigtimedwait ] = sys_rt_sigtimedwait, @@ -428,22 +428,22 @@ [ __NR_capset ] = sys_capset, [ __NR_sigaltstack ] = sys_sigaltstack, [ __NR_sendfile ] = sys_sendfile, - [ __NR_getpmsg ] = sys_ni_syscall, - [ __NR_putpmsg ] = sys_ni_syscall, + /*[ __NR_getpmsg ] = sys_ni_syscall, + [ __NR_putpmsg ] = sys_ni_syscall,*/ [ __NR_vfork ] = sys_vfork, - [ __NR_ugetrlimit ] = sys_getrlimit, + /*[ __NR_ugetrlimit ] = sys_getrlimit, [ __NR_mmap2 ] = sys_mmap2, [ __NR_truncate64 ] = sys_truncate64, [ __NR_ftruncate64 ] = sys_ftruncate64, [ __NR_stat64 ] = sys_stat64, [ __NR_lstat64 ] = sys_lstat64, [ __NR_fstat64 ] = sys_fstat64, - [ __NR_fcntl64 ] = sys_fcntl64, + [ __NR_fcntl64 ] = sys_fcntl64,*/ [ __NR_getdents64 ] = sys_getdents64, - [ __NR_security ] = sys_ni_syscall, + /*[ __NR_security ] = sys_ni_syscall,*/ [ __NR_gettid ] = sys_gettid, [ __NR_readahead ] = sys_readahead, - [ __NR_setxattr ] = sys_ni_syscall, + /*[ __NR_setxattr ] = sys_ni_syscall, [ __NR_lsetxattr ] = sys_ni_syscall, [ __NR_fsetxattr ] = sys_ni_syscall, [ __NR_getxattr ] = sys_ni_syscall, @@ -454,7 +454,7 @@ [ __NR_flistxattr ] = sys_ni_syscall, [ __NR_removexattr ] = sys_ni_syscall, [ __NR_lremovexattr ] = sys_ni_syscall, - [ __NR_fremovexattr ] = sys_ni_syscall, + [ __NR_fremovexattr ] = sys_ni_syscall,*/ ARCH_SYSCALLS [ LAST_SYSCALL + 1 ... NR_syscalls ] = diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/kernel/syscall_kern.c linux-2.4.18-sparc64um/arch/um/kernel/syscall_kern.c --- linux-2.4.18-origum/arch/um/kernel/syscall_kern.c 2002-09-12 19:00:36.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/kernel/syscall_kern.c 2002-09-12 21:55:29.000000000 -0500 @@ -321,11 +321,11 @@ sizeof(struct utimbuf))); } -static int check_oldstat(struct pt_regs *regs) +/*static int check_oldstat(struct pt_regs *regs) { return(check_area((void *) regs->regs.args[2], sizeof(struct __old_kernel_stat))); -} +}*/ static int check_stat(struct pt_regs *regs) { @@ -369,12 +369,12 @@ [ __NR_chown ] = { 1, NULL }, [ __NR_lchown ] = { 1, NULL }, [ __NR_utime ] = { 1, check_utime }, - [ __NR_oldlstat ] = { 1, check_oldstat }, - [ __NR_oldstat ] = { 1, check_oldstat }, + /*[ __NR_oldlstat ] = { 1, check_oldstat },*/ + /*[ __NR_oldstat ] = { 1, check_oldstat },*/ [ __NR_stat ] = { 1, check_stat }, - [ __NR_lstat ] = { 1, check_stat }, - [ __NR_stat64 ] = { 1, check_stat64 }, - [ __NR_lstat64 ] = { 1, check_stat64 }, + [ __NR_lstat ] = { 1, check_stat } + /*[ __NR_stat64 ] = { 1, check_stat64 },*/ + /*[ __NR_lstat64 ] = { 1, check_stat64 }*/ }; /* sys_utimes */ diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/kernel/time_kern.c linux-2.4.18-sparc64um/arch/um/kernel/time_kern.c --- linux-2.4.18-origum/arch/um/kernel/time_kern.c 2002-09-12 19:00:36.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/kernel/time_kern.c 2002-09-12 22:00:12.000000000 -0500 @@ -15,6 +15,7 @@ #include "asm/current.h" #include "kern_util.h" #include "user_util.h" +#include "asm/irq.h" extern rwlock_t xtime_lock; @@ -85,19 +86,31 @@ void __delay(um_udelay_t time) { - /* Stolen from the i386 __loop_delay */ - int d0; + /* Stolen from the i386 __loop_delay + int d0; __asm__ __volatile__( "\tjmp 1f\n" - ".align 16\n" + ".align 32\n" "1:\tjmp 2f\n" ".align 16\n" "2:\tdecl %0\n\tjns 2b" :"=&a" (d0) - :"0" (time)); + :"0" (time));*/ + + /* Stolen from sparc64 __delay */ + __asm__ __volatile__( + " b,pt %%xcc, 1f\n" + " cmp %0, 0\n" + " .align 32\n" + "1:\n" + " bne,pt %%xcc, 1b\n" + " subcc %0, 1, %0\n" + : "=&r" (time) + : "0" (time) + : "cc"); } -void __udelay(um_udelay_t usecs) +void __udelay(um_udelay_t usecs, um_udelay_t lps) { int i, n; diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/link.ld linux-2.4.18-sparc64um/arch/um/link.ld --- linux-2.4.18-origum/arch/um/link.ld 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/link.ld 2002-09-12 23:06:02.000000000 -0500 @@ -0,0 +1,133 @@ +OUTPUT_FORMAT("elf64-sparc", "elf64-sparc", "elf64-sparc") +OUTPUT_ARCH(sparc:v9a) +ENTRY(_start) + +SECTIONS +{ + . = 2684354560 + SIZEOF_HEADERS; + + . = ALIGN(4096); + .thread_private : { + __start_thread_private = .; + errno = .; + . += 4; + arch/um/kernel/unmap_fin.o (.data) + __end_thread_private = .; + } + . = ALIGN(4096); + .remap : { arch/um/kernel/unmap_fin.o (.text) } + + . = ALIGN(4096); /* Init code and data */ + _stext = .; + __init_begin = .; + .text.init : { *(.text.init) } + . = ALIGN(4096); + .text : + { + *(.text) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + } + .kstrtab : { *(.kstrtab) } + + . = ALIGN(16); /* Exception table */ + __start___ex_table = .; + __ex_table : { *(__ex_table) } + __stop___ex_table = .; + + __start___ksymtab = .; /* Kernel symbol table */ + __ksymtab : { *(__ksymtab) } + __stop___ksymtab = .; + .fini : { *(.fini) } =0x9090 + .rodata : { *(.rodata) *(.gnu.linkonce.r*) } + .rodata1 : { *(.rodata1) } + _etext = .; + PROVIDE (etext = .); + + . = ALIGN(4096); + PROVIDE (_sdata = .); + + .unprotected : { *(.unprotected) } + . = ALIGN(4096); + PROVIDE (_unprotected_end = .); + + . = ALIGN(4096); + __uml_setup_start = .; + .uml.setup.init : { *(.uml.setup.init) } + __uml_setup_end = .; + __uml_help_start = .; + .uml.help.init : { *(.uml.help.init) } + __uml_help_end = .; + __uml_postsetup_start = .; + .uml.postsetup.init : { *(.uml.postsetup.init) } + __uml_postsetup_end = .; + __setup_start = .; + .setup.init : { *(.setup.init) } + __setup_end = .; + __initcall_start = .; + .initcall.init : { *(.initcall.init) } + __initcall_end = .; + __uml_initcall_start = .; + .uml.initcall.init : { *(.uml.initcall.init) } + __uml_initcall_end = .; + __init_end = .; + __exitcall_begin = .; + .exitcall : { *(.exitcall.exit) } + __exitcall_end = .; + __uml_exitcall_begin = .; + .uml.exitcall : { *(.uml.exitcall.exit) } + __uml_exitcall_end = .; + + .data.init : { *(.data.init) } + .data : + { + . = ALIGN(16384); /* init_task */ + *(.data.init_task) + *(.data) + *(.gnu.linkonce.d*) + CONSTRUCTORS + } + .data1 : { *(.data1) } + .ctors : + { + *(.ctors) + } + .dtors : + { + *(.dtors) + } + + .got : { *(.got.plt) *(.got) } + .dynamic : { *(.dynamic) } + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata : { *(.sdata) } + _edata = .; + PROVIDE (edata = .); + . = ALIGN(0x1000); + .sbss : + { + __bss_start = .; + PROVIDE(_bss_start = .); + *(.sbss) + *(.scommon) + } + .bss : + { + *(.dynbss) + *(.bss) + *(COMMON) + } + _end = . ; + PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } +} diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/link.ld.in linux-2.4.18-sparc64um/arch/um/link.ld.in --- linux-2.4.18-origum/arch/um/link.ld.in 2002-09-12 19:00:36.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/link.ld.in 2002-09-12 22:06:42.000000000 -0500 @@ -1,5 +1,5 @@ -OUTPUT_FORMAT("elf32-ELF_SUBARCH") -OUTPUT_ARCH(ELF_SUBARCH) +OUTPUT_FORMAT("ELF_SUBARCH", "ELF_SUBARCH", "ELF_SUBARCH") +OUTPUT_ARCH(sparc:v9a) ENTRY(_start) SECTIONS diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/sys-sparc64/Makefile linux-2.4.18-sparc64um/arch/um/sys-sparc64/Makefile --- linux-2.4.18-origum/arch/um/sys-sparc64/Makefile 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/sys-sparc64/Makefile 2002-09-15 13:39:16.000000000 -0500 @@ -0,0 +1,54 @@ +OBJ = sys.o + +OBJS = ptrace.o ptrace_user.o semaphore.o sigcontext.o \ + atomic.o bitops.o strncmp.o memstuff.o misc.o + +ARCH_DIR := arch/um +ARCH_INCLUDE := $(TOPDIR)/$(ARCH_DIR)/include + +EXTRA_AFLAGS := -I$(ARCH_INCLUDE) + +USER_OBJS = ptrace_user.o sigcontext.o memstuff.o misc.o + +SYMLINKS = semaphore.c atomic.S bitops.S strncmp.S + +all: $(OBJ) + +$(OBJ): $(OBJS) + rm -f $@ + $(LD) $(LINKFLAGS) --start-group $^ --end-group -o $@ + +$(USER_OBJS) : %.o: %.c + $(CC) $(CFLAGS_$@) $(USER_CFLAGS) -c -o $@ $< + +atomic.S bitops.S strncmp.S: + rm -f $@ + ln -s $(TOPDIR)/arch/sparc64/lib/$@ $@ + +AFLAGS += -m64 -mcpu=ultrasparc -Wa,--undeclared-regs + +semaphore.c: + rm -f $@ + ln -s $(TOPDIR)/arch/sparc64/kernel/$@ $@ + +.S.o: + $(CC) $(AFLAGS) $(EXTRA_AFLAGS) -ansi -c $< -o $*.o + +clean: + rm -f $(OBJS) + rm -f $(SYMLINKS) + +fastdep: + +archmrproper: + rm -f $(SYMLINKS) +archclean: + rm -f link.ld + @$(MAKEBOOT) clean + +archdep: + @$(MAKEBOOT) dep + +modules: + +include $(TOPDIR)/Rules.make diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/sys-sparc64/ksyms.c linux-2.4.18-sparc64um/arch/um/sys-sparc64/ksyms.c --- linux-2.4.18-origum/arch/um/sys-sparc64/ksyms.c 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/sys-sparc64/ksyms.c 2002-09-15 12:22:42.000000000 -0500 @@ -0,0 +1,11 @@ +#include "linux/module.h" +#include "linux/in6.h" +#include "linux/rwsem.h" +#include "asm/byteorder.h" +#include "asm/semaphore.h" +#include "asm/uaccess.h" +#include "asm/checksum.h" +#include "asm/errno.h" + +/* Networking helper routines. */ +EXPORT_SYMBOL(csum_partial_copy_generic); diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/sys-sparc64/memstuff.c linux-2.4.18-sparc64um/arch/um/sys-sparc64/memstuff.c --- linux-2.4.18-origum/arch/um/sys-sparc64/memstuff.c 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/sys-sparc64/memstuff.c 2002-09-12 21:01:34.000000000 -0500 @@ -0,0 +1,39 @@ +/* This is to get rid of "undefined references" to __memcpy, __memmove, __memset */ + +#include + +extern int stop_a_enabled = 1; + +void *__memcpy(void *dst, const void *src, int num) +{ + /* calls the libc memcpy */ + return(memcpy(dst,src,num)); +} + +void *__memset(void *buf, int ch, size_t num) +{ + return(memset(buf,ch,num)); +} + +void *__memmove(void *dst, const void *src, int num) +{ + return(memmove(dst,src,num)); +} + +/* Some page stuff goes here */ + +void _clear_page(void *page) +{ + panic("_clear_page"); +} + +extern void clear_user_page(void *page, unsigned long vaddr) +{ + panic("clear_user_page"); +} + +extern void copy_user_page(void *to, void *from, unsigned long vaddr) +{ + panic("copy_user_page"); +} + diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/sys-sparc64/misc.c linux-2.4.18-sparc64um/arch/um/sys-sparc64/misc.c --- linux-2.4.18-origum/arch/um/sys-sparc64/misc.c 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/sys-sparc64/misc.c 2002-09-12 21:01:34.000000000 -0500 @@ -0,0 +1,65 @@ +/* This is to stub csum functions to help UML compile */ + +extern unsigned int csum_partial_copy_user_sparc64(const char *src, char *dst, int len, unsigned int sum) +{ + panic("csum_partial_copy_user_sparc64"); + return 0; +} + +extern unsigned int csum_partial_copy_sparc64(const char *src, char *dst, int len, unsigned int sum) +{ + panic("csum_partial_copy_sparc64"); + return 0; +} + +extern unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum) +{ + panic("csum_partial"); + return 0; +} + +/* Some more miscellaneous stuff here */ + +extern int sc_size(void *data) +{ + panic("sc_size"); + return 0; +} + +extern int copy_sc_to_user(void *to_ptr, void *from_ptr, void *date) +{ + panic("copy_sc_to_user"); + return 0; +} + +extern int copy_sc_from_user(void *to_ptr, void *from_ptr, void *data) +{ + panic("copy_sc_from_user"); + return 0; +} + +extern void sc_to_sc(void *to_ptr, void *from_ptr) +{ + panic("sc_to_sc"); +} + +extern unsigned long *sc_sigmask(void *sc_ptr) +{ + panic("sc_sigmask"); + return 0; +} + +extern int arch_handle_signal(int sig, struct uml_pt_regs *regs) +{ + panic("arch_handle_signal"); + return 0; +} + +extern void arch_check_bugs(void) +{ + panic("arch_check_bugs"); +} + + + + diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/sys-sparc64/ptrace.c linux-2.4.18-sparc64um/arch/um/sys-sparc64/ptrace.c --- linux-2.4.18-origum/arch/um/sys-sparc64/ptrace.c 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/sys-sparc64/ptrace.c 2002-09-12 21:01:33.000000000 -0500 @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2002 Shanti Katta (katta@csee.wvu.edu) + * Licensed under the GPL + */ + +#include "linux/sched.h" +#include "asm/ptrace.h" +#include "asm/uaccess.h" +#include "ptrace_user.h" +#include "sysdep/sigcontext.h" +#include "sysdep/sc.h" + +int putreg(struct task_struct *child, int regno, unsigned long value) +{ + return 0; +} + +unsigned long getreg(struct task_struct *child, int regno) +{ + unsigned long retval = ~0UL; + return retval; +} + +int get_fpregs(unsigned long buf, struct task_struct *child) +{ + int err; + return(0); +} + +int set_fpregs(unsigned long buf, struct task_struct *child) +{ + int err; + return(0); +} + +/* + Overrides for Emacs so that we follow Linus's tabbing style. + Emacs will notice this stuff at the end of the file and automatically + adjust the settings for this buffer only. This must remain at the end + of the file. + --------------------------------------------------------------------- + Local variables: + c-file-style: "linux" + End: +*/ diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/sys-sparc64/ptrace_user.c linux-2.4.18-sparc64um/arch/um/sys-sparc64/ptrace_user.c --- linux-2.4.18-origum/arch/um/sys-sparc64/ptrace_user.c 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/sys-sparc64/ptrace_user.c 2002-09-12 21:01:33.000000000 -0500 @@ -0,0 +1,24 @@ +#include +#include +#include +#include "sysdep/ptrace.h" + +int ptrace_getregs(long pid, struct sys_pt_regs *regs_out) +{ + return(ptrace(PTRACE_GETREGS, pid, 0, regs_out)); +} + +int ptrace_setregs(long pid, struct sys_pt_regs *regs) +{ + return(ptrace(PTRACE_SETREGS, pid, 0, regs)); +} + +/* Overrides for Emacs so that we follow Linus's tabbing style. + Emacs will notice this stuff at the end of the file and automatically + adjust the settings for this buffer only. This must remain at the end + of the file. + --------------------------------------------------------------------- + Local variables: + c-file-style: "linux" + End: +*/ diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/sys-sparc64/sigcontext.c linux-2.4.18-sparc64um/arch/um/sys-sparc64/sigcontext.c --- linux-2.4.18-origum/arch/um/sys-sparc64/sigcontext.c 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/sys-sparc64/sigcontext.c 2002-09-12 21:01:33.000000000 -0500 @@ -0,0 +1,13 @@ +#include +#include +#include "sysdep/ptrace.h" + +void fill_in_sigcontext(void *sc_ptr, struct sys_pt_regs *regs, unsigned long cr2, int err) +{ + while(0); +} + +void fill_in_regs(struct sys_pt_regs *refs, void *sc_ptr) +{ + while(0); +} diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/sys-sparc64/util/Makefile linux-2.4.18-sparc64um/arch/um/sys-sparc64/util/Makefile --- linux-2.4.18-origum/arch/um/sys-sparc64/util/Makefile 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/sys-sparc64/util/Makefile 2002-09-15 12:57:35.000000000 -0500 @@ -0,0 +1,6 @@ +all : mk_sc + +mk_sc : mk_sc.c + +clean : + rm mk_sc diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/sys-sparc64/util/mk_sc.c linux-2.4.18-sparc64um/arch/um/sys-sparc64/util/mk_sc.c --- linux-2.4.18-origum/arch/um/sys-sparc64/util/mk_sc.c 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/sys-sparc64/util/mk_sc.c 2002-09-12 21:01:34.000000000 -0500 @@ -0,0 +1,53 @@ +#include +#include +#include + +#define SC_OFFSET(name, field) printf("#define " name "(sc) *((unsigned long *) &(((char *) (sc))[%d]))\n", offsetof(struct sigcontext, field)) + + /* +#define SC_FP_OFFSET(name, field) \ + printf("#define " name \ + "(sc) *((unsigned long *) &(((char *) (SC_FPSTATE(sc)))[%d]))\n",\ + offsetof(struct _fpstate, field)) + +#define SC_FP_OFFSET_PTR(name, field, type) \ + printf("#define " name \ + "(sc) ((" type " *) &(((char *) (SC_FPSTATE(sc)))[%d]))\n",\ + offsetof(struct _fpstate, field)) + */ + +int main(int argc, char **argv) +{ + SC_OFFSET("SC_IP", sigc_regs.tpc); + SC_OFFSET("SC_SP", sigc_regs.tstate); + SC_OFFSET("SC_FP", sigc_regs.u_regs[14]); + /*SC_OFFSET("SC_GS", gs); + SC_OFFSET("SC_DS", ds); + SC_OFFSET("SC_ES", es); + SC_OFFSET("SC_SS", ss); + SC_OFFSET("SC_CS", cs); + SC_OFFSET("SC_EFLAGS", eflags);*/ + SC_OFFSET("SC_UREG_I0", sigc_regs.u_regs[8]); + SC_OFFSET("SC_UREG_I1", sigc_regs.u_regs[9]); + SC_OFFSET("SC_UREG_I2", sigc_regs.u_regs[10]); + SC_OFFSET("SC_UREG_I3", sigc_regs.u_regs[11]); + SC_OFFSET("SC_UREG_I4", sigc_regs.u_regs[12]); + SC_OFFSET("SC_UREG_I5", sigc_regs.u_regs[13]); + SC_OFFSET("SC_RETPC", sigc_regs.u_regs[15]); + /*SC_OFFSET("SC_TRAPNO", trapno); + SC_OFFSET("SC_ERR", err); + SC_OFFSET("SC_CR2", cr2); + SC_OFFSET("SC_FPSTATE", fpstate); + SC_FP_OFFSET("SC_FP_CW", cw); + SC_FP_OFFSET("SC_FP_SW", sw); + SC_FP_OFFSET("SC_FP_TAG", tag); + SC_FP_OFFSET("SC_FP_IPOFF", ipoff); + SC_FP_OFFSET("SC_FP_CSSEL", cssel); + SC_FP_OFFSET("SC_FP_DATAOFF", dataoff); + SC_FP_OFFSET("SC_FP_DATASEL", datasel); + SC_FP_OFFSET_PTR("SC_FP_ST", _st, "struct _fpstate"); + SC_FP_OFFSET_PTR("SC_FXSR_ENV", _fxsr_env, "void");*/ + return(0); +} + + diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/util/Makefile linux-2.4.18-sparc64um/arch/um/util/Makefile --- linux-2.4.18-origum/arch/um/util/Makefile 2002-09-12 19:00:36.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/util/Makefile 2002-09-13 20:02:48.000000000 -0500 @@ -1,10 +1,10 @@ all : mk_task mk_task : mk_task_user.o mk_task_kern.o - $(CC) -o mk_task mk_task_user.o mk_task_kern.o + $(CC) $(CFLAGS) -o mk_task mk_task_user.o mk_task_kern.o mk_task_user.o : mk_task_user.c - $(CC) -c $< + $(CC) -m64 -c $< mk_task_kern.o : mk_task_kern.c $(CC) $(CFLAGS) -c $< diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/util/mk_task_kern.c linux-2.4.18-sparc64um/arch/um/util/mk_task_kern.c --- linux-2.4.18-origum/arch/um/util/mk_task_kern.c 2002-09-12 19:00:36.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/util/mk_task_kern.c 2002-09-13 14:50:50.000000000 -0500 @@ -9,8 +9,7 @@ int main(int argc, char **argv) { print_head(); - print_ptr("TASK_REGS", "struct uml_pt_regs", - offsetof(struct task_struct, thread.regs)); + print_ptr("TASK_REGS", "struct uml_pt_regs", offsetof(struct task_struct, thread.regs)); print("TASK_PID", "int", offsetof(struct task_struct, pid)); print_tail(); return(0); diff -Naur -X dontdiff linux-2.4.18-origum/arch/um/util/mk_task_user.c linux-2.4.18-sparc64um/arch/um/util/mk_task_user.c --- linux-2.4.18-origum/arch/um/util/mk_task_user.c 2002-09-12 19:00:36.000000000 -0500 +++ linux-2.4.18-sparc64um/arch/um/util/mk_task_user.c 2002-09-12 22:45:09.000000000 -0500 @@ -2,14 +2,12 @@ void print(char *name, char *type, int offset) { - printf("#define %s(task) *((%s *) &(((char *) (task))[%d]))\n", name, type, - offset); + printf("#define %s(task) *((%s *) &(((char *) (task))[%d]))\n", name, type, offset); } void print_ptr(char *name, char *type, int offset) { - printf("#define %s(task) ((%s *) &(((char *) (task))[%d]))\n", name, type, - offset); + printf("#define %s(task) ((%s *) &(((char *) (task))[%d]))\n", name, type, offset); } void print_head(void) diff -Naur -X dontdiff linux-2.4.18-origum/include/asm-sparc64/checksum.h linux-2.4.18-sparc64um/include/asm-sparc64/checksum.h --- linux-2.4.18-origum/include/asm-sparc64/checksum.h 2001-04-27 00:17:26.000000000 -0500 +++ linux-2.4.18-sparc64um/include/asm-sparc64/checksum.h 2002-09-15 13:08:53.000000000 -0500 @@ -1,4 +1,4 @@ -/* $Id: checksum.h,v 1.17 2001/04/24 01:09:12 davem Exp $ */ +/* $Id: checksum.h,v 1.1.1.1.4.1 2002/05/14 01:16:38 shanti Exp $ */ #ifndef __SPARC64_CHECKSUM_H #define __SPARC64_CHECKSUM_H @@ -44,10 +44,11 @@ unsigned int sum) { int ret; - unsigned char cur_ds = current->thread.current_ds.seg; + /* Next line commented to make asm-sparc64 compile. */ + /*unsigned char cur_ds = current->thread.current_ds.seg;*/ __asm__ __volatile__ ("wr %%g0, %0, %%asi" : : "i" (ASI_P)); ret = csum_partial_copy_sparc64(src, dst, len, sum); - __asm__ __volatile__ ("wr %%g0, %0, %%asi" : : "r" (cur_ds)); + /*__asm__ __volatile__ ("wr %%g0, %0, %%asi" : : "r" (cur_ds));*/ return ret; } diff -Naur -X dontdiff linux-2.4.18-origum/include/asm-sparc64/page.h linux-2.4.18-sparc64um/include/asm-sparc64/page.h --- linux-2.4.18-origum/include/asm-sparc64/page.h 2001-12-21 12:42:03.000000000 -0500 +++ linux-2.4.18-sparc64um/include/asm-sparc64/page.h 2002-09-12 21:43:25.000000000 -0500 @@ -1,4 +1,4 @@ -/* $Id: page.h,v 1.38 2001/11/30 01:04:10 davem Exp $ */ +/* $Id: page.h,v 1.1.1.1.4.1 2002/05/14 01:16:40 shanti Exp $ */ #ifndef _SPARC64_PAGE_H #define _SPARC64_PAGE_H @@ -118,6 +118,9 @@ #define virt_to_phys __pa #define phys_to_virt __va +#undef virt_to_phys +#undef phys_to_virt + #ifndef __ASSEMBLY__ /* The following structure is used to hold the physical diff -Naur -X dontdiff linux-2.4.18-origum/include/asm-sparc64/unistd.h linux-2.4.18-sparc64um/include/asm-sparc64/unistd.h --- linux-2.4.18-origum/include/asm-sparc64/unistd.h 2001-10-21 12:36:54.000000000 -0500 +++ linux-2.4.18-sparc64um/include/asm-sparc64/unistd.h 2002-09-12 21:56:21.000000000 -0500 @@ -1,4 +1,4 @@ -/* $Id: unistd.h,v 1.49 2001/10/18 08:27:05 davem Exp $ */ +/* $Id: unistd.h,v 1.1.1.1.4.1 2002/06/08 20:49:04 shanti Exp $ */ #ifndef _SPARC64_UNISTD_H #define _SPARC64_UNISTD_H @@ -147,14 +147,16 @@ #define __NR_truncate 129 /* Common */ #define __NR_ftruncate 130 /* Common */ #define __NR_flock 131 /* Common */ -/* #define __NR_lstat64 132 Linux sparc32 Specific */ +/*#define __NR_lstat64 132 Linux sparc32 Specific + */ #define __NR_sendto 133 /* Common */ #define __NR_shutdown 134 /* Common */ #define __NR_socketpair 135 /* Common */ #define __NR_mkdir 136 /* Common */ #define __NR_rmdir 137 /* Common */ #define __NR_utimes 138 /* SunOS Specific */ -/* #define __NR_stat64 139 Linux sparc32 Specific */ +/* +#define __NR_stat64 139 Linux sparc32 Specific */ /* #define __NR_adjtime 140 SunOS Specific */ #define __NR_getpeername 141 /* Common */ /* #define __NR_gethostid 142 SunOS Specific */ @@ -249,7 +251,8 @@ #ifdef __KERNEL__ #define __NR_time 231 /* Linux sparc32 */ #endif -/* #define __NR_oldstat 232 Linux Specific */ +/*#define __NR_oldstat 232 Linux Specific + */ #define __NR_stime 233 /* Linux Specific */ /* #define __NR_oldfstat 234 Linux Specific */ /* #define __NR_phys 235 Linux Specific */ diff -Naur -X dontdiff linux-2.4.18-origum/include/asm-um/archparam-sparc64.h linux-2.4.18-sparc64um/include/asm-um/archparam-sparc64.h --- linux-2.4.18-origum/include/asm-um/archparam-sparc64.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/include/asm-um/archparam-sparc64.h 2002-09-15 13:09:34.000000000 -0500 @@ -0,0 +1,94 @@ +/* $Id: archparam-sparc64.h,v 1.1.2.2 2002/06/08 20:49:05 shanti Exp $ */ +#ifndef __UM_ARCHPARAM_SPARC64_H +#define __UM_ARCHPARAM_SPARC64_H + +/* + * ELF register definitions.. + */ + +#include +#ifdef __KERNEL__ +#include +#endif + +/* + * These are used to set parameters in the core dumps. + */ +#ifndef ELF_ARCH +#define ELF_ARCH EM_SPARCV9 +#define ELF_CLASS ELFCLASS64 +#define ELF_DATA ELFDATA2MSB + +typedef unsigned long elf_greg_t; + +#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t)) +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; + +typedef struct { + unsigned long pr_regs[32]; + unsigned long pr_fsr; + unsigned long pr_gsr; + unsigned long pr_fprs; +} elf_fpregset_t; +#endif + +typedef unsigned long um_udelay_t; + +/* + * This is used to ensure we don't load something for the wrong architecture. + */ +#ifndef elf_check_arch +#define elf_check_arch(x) ((x)->e_machine == ELF_ARCH) /* Might be EM_SPARCV9 or EM_SPARC */ +#endif + +#define USE_ELF_CORE_DUMP +#define ELF_EXEC_PAGESIZE PAGE_SIZE + +/* This is the location that an ET_DYN program is loaded if exec'ed. Typical + use of this is to invoke "./ld.so someprog" to test out a new version of + the loader. We need to make sure that it is out of the way of the program + that it will "exec", and that there is sufficient room for the brk. */ + +#ifndef ELF_ET_DYN_BASE +#define ELF_ET_DYN_BASE 0x0000010000000000UL +#endif + + +/* This yields a mask that user programs can use to figure out what + instruction set this cpu supports. */ + +/* On Ultra, we support all of the v8 capabilities. */ +#define ELF_HWCAP ((HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | \ + HWCAP_SPARC_SWAP | HWCAP_SPARC_MULDIV | \ + HWCAP_SPARC_V9) | \ + ((tlb_type == cheetah) ? HWCAP_SPARC_ULTRA3 : 0)) + +/* This yields a string that ld.so will use to load implementation + specific libraries for optimization. This is more specific in + intent than poking at uname or /proc/cpuinfo. */ + +#define ELF_PLATFORM (NULL) + +#ifdef __KERNEL__ +#define SET_PERSONALITY(ex, ibcs2) \ +do { unsigned char flags = current->thread.flags; \ + if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ + flags |= SPARC_FLAG_32BIT; \ + else \ + flags &= ~SPARC_FLAG_32BIT; \ + if (flags != current->thread.flags) { \ + /* flush_thread will update pgd cache */\ + current->thread.flags = flags; \ + } \ + \ + if (ibcs2) \ + set_personality(PER_SVR4); \ + else if (current->personality != PER_LINUX32) \ + set_personality(PER_LINUX); \ +} while (0) +#endif + +#endif /* !(__ASM_SPARC64_ELF_H) */ + + + diff -Naur -X dontdiff linux-2.4.18-origum/include/asm-um/checksum-generic.h linux-2.4.18-sparc64um/include/asm-um/checksum-generic.h --- linux-2.4.18-origum/include/asm-um/checksum-generic.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/include/asm-um/checksum-generic.h 2002-09-12 21:24:56.000000000 -0500 @@ -0,0 +1,6 @@ +#ifndef __UM_CHECKSUM_H +#define __UM_CHECKSUM_H + +#include "asm/arch/checksum.h" + +#endif diff -Naur -X dontdiff linux-2.4.18-origum/include/asm-um/checksum-sparc64.h linux-2.4.18-sparc64um/include/asm-um/checksum-sparc64.h --- linux-2.4.18-origum/include/asm-um/checksum-sparc64.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/include/asm-um/checksum-sparc64.h 2002-09-12 21:24:56.000000000 -0500 @@ -0,0 +1,216 @@ +/* $Id: checksum-sparc64.h,v 1.1.2.1 2002/05/14 01:16:41 shanti Exp $ */ +#ifndef __UM_CHECKSUM_H +#define __UM_CHECKSUM_H + +/* checksum.h: IP/UDP/TCP checksum routines on the V9. + * + * Copyright(C) 1995 Linus Torvalds + * Copyright(C) 1995 Miguel de Icaza + * Copyright(C) 1996 David S. Miller + * Copyright(C) 1996 Eddie C. Dost + * Copyright(C) 1997 Jakub Jelinek + * + * derived from: + * Alpha checksum c-code + * ix86 inline assembly + * RFC1071 Computing the Internet Checksum + */ + +#include + +/* computes the checksum of a memory block at buff, length len, + * and adds in "sum" (32-bit) + * + * returns a 32-bit number suitable for feeding into itself + * or csum_tcpudp_magic + * + * this function must be called with even lengths, except + * for the last fragment, which may be odd + * + * it's best to have buff aligned on a 32-bit boundary + */ +extern unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum); + +/* the same as csum_partial, but copies from user space while it + * checksums + * + * here even more important to align src and dst on a 32-bit (or even + * better 64-bit) boundary + */ +extern unsigned int csum_partial_copy_sparc64(const char *src, char *dst, int len, unsigned int sum); + +extern __inline__ unsigned int +csum_partial_copy_nocheck (const char *src, char *dst, int len, + unsigned int sum) +{ + int ret; + /* Next line commented to make asm-sparc64 compile. */ + unsigned char cur_ds = current->thread.current_ds.seg; + __asm__ __volatile__ ("wr %%g0, %0, %%asi" : : "i" (ASI_P)); + ret = csum_partial_copy_sparc64(src, dst, len, sum); + __asm__ __volatile__ ("wr %%g0, %0, %%asi" : : "r" (cur_ds)); + return ret; +} + +extern __inline__ unsigned int +csum_partial_copy_from_user(const char *src, char *dst, int len, + unsigned int sum, int *err) +{ + __asm__ __volatile__ ("stx %0, [%%sp + 0x7ff + 128]" + : : "r" (err)); + return csum_partial_copy_sparc64(src, dst, len, sum); +} + +/* + * Copy and checksum to user + */ +#define HAVE_CSUM_COPY_USER +extern unsigned int csum_partial_copy_user_sparc64(const char *src, char *dst, int len, unsigned int sum); +extern __inline__ unsigned int +csum_and_copy_to_user(const char *src, char *dst, int len, + unsigned int sum, int *err) +{ + __asm__ __volatile__ ("stx %0, [%%sp + 0x7ff + 128]" + : : "r" (err)); + return csum_partial_copy_user_sparc64(src, dst, len, sum); +} + +/* ihl is always 5 or greater, almost always is 5, and iph is word aligned + * the majority of the time. + */ +extern __inline__ unsigned short ip_fast_csum(__const__ unsigned char *iph, + unsigned int ihl) +{ + unsigned short sum; + + /* Note: We must read %2 before we touch %0 for the first time, + * because GCC can legitimately use the same register for + * both operands. + */ + __asm__ __volatile__( +" sub %2, 4, %%g7 ! IEU0\n" +" lduw [%1 + 0x00], %0 ! Load Group\n" +" lduw [%1 + 0x04], %%g2 ! Load Group\n" +" lduw [%1 + 0x08], %%g3 ! Load Group\n" +" addcc %%g2, %0, %0 ! IEU1 1 Load Bubble + Group\n" +" lduw [%1 + 0x0c], %%g2 ! Load\n" +" addccc %%g3, %0, %0 ! Sngle Group no Bubble\n" +" lduw [%1 + 0x10], %%g3 ! Load Group\n" +" addccc %%g2, %0, %0 ! Sngle Group no Bubble\n" +" addc %0, %%g0, %0 ! Sngle Group\n" +"1: addcc %%g3, %0, %0 ! IEU1 Group no Bubble\n" +" add %1, 4, %1 ! IEU0\n" +" addccc %0, %%g0, %0 ! Sngle Group no Bubble\n" +" subcc %%g7, 1, %%g7 ! IEU1 Group\n" +" be,a,pt %%icc, 2f ! CTI\n" +" sll %0, 16, %%g2 ! IEU0\n" +" lduw [%1 + 0x10], %%g3 ! Load Group\n" +" ba,pt %%xcc, 1b ! CTI\n" +" nop ! IEU0\n" +"2: addcc %0, %%g2, %%g2 ! IEU1 Group\n" +" srl %%g2, 16, %0 ! IEU0 Group regdep XXX Scheisse!\n" +" addc %0, %%g0, %0 ! Sngle Group\n" +" xnor %%g0, %0, %0 ! IEU0 Group\n" +" srl %0, 0, %0 ! IEU0 Group XXX Scheisse!\n" + : "=r" (sum), "=&r" (iph) + : "r" (ihl), "1" (iph) + : "g2", "g3", "g7", "cc"); + return sum; +} + +/* Fold a partial checksum without adding pseudo headers. */ +extern __inline__ unsigned short csum_fold(unsigned int sum) +{ + unsigned int tmp; + + __asm__ __volatile__( +" addcc %0, %1, %1\n" +" srl %1, 16, %1\n" +" addc %1, %%g0, %1\n" +" xnor %%g0, %1, %0\n" + : "=&r" (sum), "=r" (tmp) + : "0" (sum), "1" (sum<<16) + : "cc"); + return (sum & 0xffff); +} + +extern __inline__ unsigned long csum_tcpudp_nofold(unsigned long saddr, + unsigned long daddr, + unsigned int len, + unsigned short proto, + unsigned int sum) +{ + __asm__ __volatile__( +" addcc %1, %0, %0\n" +" addccc %2, %0, %0\n" +" addccc %3, %0, %0\n" +" addc %0, %%g0, %0\n" + : "=r" (sum), "=r" (saddr) + : "r" (daddr), "r" ((proto<<16)+len), "0" (sum), "1" (saddr) + : "cc"); + return sum; +} + +/* + * computes the checksum of the TCP/UDP pseudo-header + * returns a 16-bit checksum, already complemented + */ +static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, + unsigned long daddr, + unsigned short len, + unsigned short proto, + unsigned int sum) +{ + return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); +} + +#define _HAVE_ARCH_IPV6_CSUM + +static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, + struct in6_addr *daddr, + __u32 len, + unsigned short proto, + unsigned int sum) +{ + __asm__ __volatile__ ( +" addcc %3, %4, %%g7\n" +" addccc %5, %%g7, %%g7\n" +" lduw [%2 + 0x0c], %%g2\n" +" lduw [%2 + 0x08], %%g3\n" +" addccc %%g2, %%g7, %%g7\n" +" lduw [%2 + 0x04], %%g2\n" +" addccc %%g3, %%g7, %%g7\n" +" lduw [%2 + 0x00], %%g3\n" +" addccc %%g2, %%g7, %%g7\n" +" lduw [%1 + 0x0c], %%g2\n" +" addccc %%g3, %%g7, %%g7\n" +" lduw [%1 + 0x08], %%g3\n" +" addccc %%g2, %%g7, %%g7\n" +" lduw [%1 + 0x04], %%g2\n" +" addccc %%g3, %%g7, %%g7\n" +" lduw [%1 + 0x00], %%g3\n" +" addccc %%g2, %%g7, %%g7\n" +" addccc %%g3, %%g7, %0\n" +" addc 0, %0, %0\n" + : "=&r" (sum) + : "r" (saddr), "r" (daddr), "r"(htonl(len)), + "r"(htonl(proto)), "r"(sum) + : "g2", "g3", "g7", "cc"); + + return csum_fold(sum); +} + +/* this routine is used for miscellaneous IP-like checksums, mainly in icmp.c */ +extern __inline__ unsigned short ip_compute_csum(unsigned char * buff, int len) +{ + return csum_fold(csum_partial(buff, len, 0)); +} + +#endif /* !(__UM_CHECKSUM_H) */ + + + + + + + diff -Naur -X dontdiff linux-2.4.18-origum/include/asm-um/elf-sparc64.h linux-2.4.18-sparc64um/include/asm-um/elf-sparc64.h --- linux-2.4.18-origum/include/asm-um/elf-sparc64.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/include/asm-um/elf-sparc64.h 2002-09-12 21:25:33.000000000 -0500 @@ -0,0 +1,18 @@ +#ifndef __UM_ELF_H +#define __UM_ELF_H + +#include "asm/archparam.h" + +#define ELF_HWCAP (0) + +#define SET_PERSONALITY(ex, ibcs2) do ; while (0) + +#define ELF_EXEC_PAGESIZE 4096 + +#define elf_check_arch(x) (1) + +#define ELF_CLASS ELFCLASS32 + +#define USE_ELF_CORE_DUMP + +#endif diff -Naur -X dontdiff linux-2.4.18-origum/include/asm-um/irq.h linux-2.4.18-sparc64um/include/asm-um/irq.h --- linux-2.4.18-origum/include/asm-um/irq.h 2002-09-12 19:00:37.000000000 -0500 +++ linux-2.4.18-sparc64um/include/asm-um/irq.h 2002-09-15 13:02:45.000000000 -0500 @@ -24,6 +24,8 @@ #define WINCH_IRQ 10 #define SIGIO_WRITE_IRQ 11 +/*#define CONSOLE_IRQ 12*/ + #define LAST_IRQ SIGIO_WRITE_IRQ #define NR_IRQS (LAST_IRQ + 1) diff -Naur -X dontdiff linux-2.4.18-origum/include/asm-um/mmu.h linux-2.4.18-sparc64um/include/asm-um/mmu.h --- linux-2.4.18-origum/include/asm-um/mmu.h 2002-09-12 19:00:37.000000000 -0500 +++ linux-2.4.18-sparc64um/include/asm-um/mmu.h 2002-09-12 22:48:38.000000000 -0500 @@ -1,5 +1,5 @@ -#ifndef __MMU_H -#define __MMU_H +#ifndef __UM_MMU_H +#define __UM_MMU_H #include "asm/arch/mmu.h" diff -Naur -X dontdiff linux-2.4.18-origum/include/asm-um/page.h linux-2.4.18-sparc64um/include/asm-um/page.h --- linux-2.4.18-origum/include/asm-um/page.h 2002-09-12 19:00:37.000000000 -0500 +++ linux-2.4.18-sparc64um/include/asm-um/page.h 2002-09-12 23:12:02.000000000 -0500 @@ -1,7 +1,10 @@ #ifndef __UM_PAGE_H #define __UM_PAGE_H +/* Modified on 06/18/2002 */ +#ifndef __ASSEMBLY__ struct page; +#endif /* __ASSEMBLY__ */ #include "asm/arch/page.h" @@ -11,12 +14,17 @@ #undef __va #undef virt_to_page #undef VALID_PAGE -#undef PAGE_OFFSET +#undef PAGE_OFFSET #undef KERNELBASE -#define PAGE_OFFSET (uml_physmem) +#define PAGE_OFFSET (uml_physmem) #define KERNELBASE PAGE_OFFSET +#undef TASK_UNMAPPED_BASE + +#define SPARC_FLAG_32BIT 0x04 +#define TASK_UNMAPPED_BASE PAGE_OFFSET + #ifndef __ASSEMBLY__ extern void stop(void); @@ -34,17 +42,26 @@ #define __va_space (8*1024*1024) +/* Modified on 06/18/2002 */ +#ifndef __ASSEMBLY__ + extern unsigned long region_pa(void *virt); extern void *region_va(unsigned long phys); +#endif /* __ASSEMBLY__ */ + #define __pa(virt) region_pa((void *) (virt)) #define __va(phys) region_va((unsigned long) (phys)) +/* Modified on 06/18/2002 */ +#ifndef __ASSEMBLY__ extern struct page *page_mem_map(struct page *page); #define VALID_PAGE(page) (page_mem_map(page) != NULL) extern struct page *arch_validate(struct page *page, int mask, int order); +#endif + #define HAVE_ARCH_VALIDATE #endif diff -Naur -X dontdiff linux-2.4.18-origum/include/asm-um/processor-generic.h linux-2.4.18-sparc64um/include/asm-um/processor-generic.h --- linux-2.4.18-origum/include/asm-um/processor-generic.h 2002-09-12 19:00:37.000000000 -0500 +++ linux-2.4.18-sparc64um/include/asm-um/processor-generic.h 2002-09-15 13:09:45.000000000 -0500 @@ -123,7 +123,8 @@ /* This decides where the kernel will search for a free chunk of vm * space during mmap's. */ -#define TASK_UNMAPPED_BASE (0x40000000) + +/*#define TASK_UNMAPPED_BASE (0x40000000)*/ extern void start_thread(struct pt_regs *regs, unsigned long entry, unsigned long stack); diff -Naur -X dontdiff linux-2.4.18-origum/include/asm-um/processor-sparc64.h linux-2.4.18-sparc64um/include/asm-um/processor-sparc64.h --- linux-2.4.18-origum/include/asm-um/processor-sparc64.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/include/asm-um/processor-sparc64.h 2002-09-15 13:09:45.000000000 -0500 @@ -0,0 +1,19 @@ +#ifndef __UM_PROCESSOR_SPARC64_H +#define __UM_PROCESSOR_SPARC64_H + +#if defined(__ASSEMBLY__) + +#define CONFIG_SPARC64 +#include "asm/arch/processor.h" + +#else + +#include "asm/processor-generic.h" + +#endif + +#endif + + + + diff -Naur -X dontdiff linux-2.4.18-origum/include/asm-um/ptrace-sparc64.h linux-2.4.18-sparc64um/include/asm-um/ptrace-sparc64.h --- linux-2.4.18-origum/include/asm-um/ptrace-sparc64.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/include/asm-um/ptrace-sparc64.h 2002-09-13 14:49:13.000000000 -0500 @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) + * Copyright (C) 2002 Shanti Katta (katta@csee.wvu.edu) + * Licensed under the GPL + */ + +#ifndef __UM_PTRACE_SPARC64_H +#define __UM_PTRACE_SPARC64_H + +#include "asm/ptrace-generic.h" + +/*#define PT_REGS_G0(r) UPT_G0(&(r)->regs) +#define PT_REGS_G1(r) UPT_G1(&(r)->regs) +#define PT_REGS_G2(r) UPT_G2(&(r)->regs) +#define PT_REGS_G3(r) UPT_G3(&(r)->regs) +#define PT_REGS_G4(r) UPT_G4(&(r)->regs) +#define PT_REGS_G5(r) UPT_G5(&(r)->regs) +#define PT_REGS_G6(r) UPT_G6(&(r)->regs) +#define PT_REGS_G7(r) UPT_G7(&(r)->regs) +#define PT_REGS_I0(r) UPT_I0(&(r)->regs) +#define PT_REGS_I1(r) UPT_I1(&(r)->regs) +#define PT_REGS_I2(r) UPT_I2(&(r)->regs) +#define PT_REGS_I3(r) UPT_I3(&(r)->regs) +#define PT_REGS_I4(r) UPT_I4(&(r)->regs) +#define PT_REGS_I5(r) UPT_I5(&(r)->regs) +#define PT_REGS_I6(r) UPT_I6(&(r)->regs) +#define PT_REGS_I7(r) UPT_I7(&(r)->regs) + +#define PT_REGS_EFLAGS(r) UPT_EFLAGS(&(r)->regs) + +#define PT_REGS_ORIG_SYSCALL(r) PT_REGS_I6(r) +#define PT_REGS_SYSCALL_RET(r) PT_REGS_I6(r) +*/ + +#define PT_REGS_U_REGS[x](r) UPT_U_REGS[x](&(r)->regs) +/*#define PT_REGS_U_REGS[1](r) UPT_U_REGS[1](&(r)->regs) +#define PT_REGS_U_REGS[2](r) UPT_U_REGS[2](&(r)->regs) +#define PT_REGS_U_REGS[3](r) UPT_U_REGS[3](&(r)->regs) +#define PT_REGS_U_REGS[4](r) UPT_U_REGS[4](&(r)->regs) +#define PT_REGS_U_REGS[5](r) UPT_U_REGS[5](&(r)->regs) +#define PT_REGS_U_REGS[6](r) UPT_U_REGS[6](&(r)->regs) +#define PT_REGS_U_REGS[7](r) UPT_U_REGS[7](&(r)->regs) +#define PT_REGS_U_REGS[8](r) UPT_U_REGS[8](&(r)->regs) +#define PT_REGS_U_REGS[9](r) UPT_U_REGS[9](&(r)->regs) +#define PT_REGS_U_REGS[10](r) UPT_U_REGS[10](&(r)->regs) +#define PT_REGS_U_REGS[11](r) UPT_U_REGS[11](&(r)->regs) +#define PT_REGS_U_REGS[12](r) UPT_U_REGS[12](&(r)->regs) +#define PT_REGS_U_REGS[13](r) UPT_U_REGS[13](&(r)->regs) +#define PT_REGS_U_REGS[14](r) UPT_U_REGS[14](&(r)->regs) +#define PT_REGS_U_REGS[15](r) UPT_U_REGS[15](&(r)->regs)*/ +#define PT_REGS_TSTATE(r) UPT_TSTATE(&(r)->regs) +#define PT_REGS_FP(r) UPT_FP(&(r)->regs) +#define PT_REGS_RETPC(r) UPT_RETPC(&(r)->regs) + +#define PT_REGS_SYSCALL_RET(r) PT_REGS_RETPC(r) +#define PT_REGS_ORIG_SYSCALL(r) PT_REGS_FP(r) +#define PT_FIX_EXEC_STACK(sp) do ; while(0) + +#define user_mode(r) ((r)->regs.is_user) + +#endif + + diff -Naur -X dontdiff linux-2.4.18-origum/include/asm-um/sigcontext-sparc64.h linux-2.4.18-sparc64um/include/asm-um/sigcontext-sparc64.h --- linux-2.4.18-origum/include/asm-um/sigcontext-sparc64.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/include/asm-um/sigcontext-sparc64.h 2002-09-13 14:49:13.000000000 -0500 @@ -0,0 +1,6 @@ +#ifndef __UM_SIGCONTEXT_SPARC64_H +#define __UM_SIGCONTEXT_SPARC64_H + +#include "asm/sigcontext-generic.h" + +#endif diff -Naur -X dontdiff linux-2.4.18-origum/include/asm-um/system-sparc64.h linux-2.4.18-sparc64um/include/asm-um/system-sparc64.h --- linux-2.4.18-origum/include/asm-um/system-sparc64.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-sparc64um/include/asm-um/system-sparc64.h 2002-09-15 13:09:45.000000000 -0500 @@ -0,0 +1,8 @@ +#ifndef __UM_SYSTEM_SPARC64_H +#define __UM_SYSTEM_SPARC64_H + +#define empty_zero_page empty_zero_page_renamed +#include "asm/system-generic.h" +#undef empty_zero_page + +#endif diff -Naur -X dontdiff linux-2.4.18-origum/include/linux/sched.h linux-2.4.18-sparc64um/include/linux/sched.h --- linux-2.4.18-origum/include/linux/sched.h 2001-12-21 12:42:03.000000000 -0500 +++ linux-2.4.18-sparc64um/include/linux/sched.h 2002-09-15 13:09:45.000000000 -0500 @@ -227,7 +227,7 @@ unsigned dumpable:1; - /* Architecture-specific MM context */ + /* Architecture-specific MM context */ mm_context_t context; };