diff -Naur -X exclude-files ac_cur/arch/um/include/sysdep-ppc/ptrace.h ac/arch/um/include/sysdep-ppc/ptrace.h --- ac_cur/arch/um/include/sysdep-ppc/ptrace.h Fri Jun 1 20:50:47 2001 +++ ac/arch/um/include/sysdep-ppc/ptrace.h Fri Jun 1 22:11:32 2001 @@ -77,7 +77,7 @@ } else { \ UM_SYSCALL_RET((_regs)) = result; \ } \ -while(0) +} while(0) extern void shove_aux_table(unsigned long sp); #define UM_FIX_EXEC_STACK(sp) shove_aux_table(sp); diff -Naur -X exclude-files ac_cur/arch/um/include/sysdep-ppc/sigcontext.h ac/arch/um/include/sysdep-ppc/sigcontext.h --- ac_cur/arch/um/include/sysdep-ppc/sigcontext.h Fri Jun 1 20:50:47 2001 +++ ac/arch/um/include/sysdep-ppc/sigcontext.h Fri Jun 1 22:12:42 2001 @@ -6,7 +6,10 @@ #ifndef __SYS_SIGCONTEXT_PPC_H #define __SYS_SIGCONTEXT_PPC_H -#define UM_GET_SC(sc) asm("mr %0, 4" : "=r" (sc) :) +#define UM_ALLOCATE_SC(name) \ + struct sys_pt_regs name##_regs; \ + struct sigcontext name; \ + name.regs = &name##_regs #define SC_FAULT_ADDR(sc) ({ \ struct sigcontext_struct *_sc = (sc); \ diff -Naur -X exclude-files ac_cur/arch/um/include/sysdep-ppc/syscalls.h ac/arch/um/include/sysdep-ppc/syscalls.h --- ac_cur/arch/um/include/sysdep-ppc/syscalls.h Fri Jun 1 20:50:47 2001 +++ ac/arch/um/include/sysdep-ppc/syscalls.h Fri Jun 1 22:12:47 2001 @@ -3,9 +3,23 @@ * Licensed under the GPL */ -#include "kern_util.h" // FIXME: syscall_handler_t may move to a different .h +typedef long syscall_handler_t(unsigned long arg1, unsigned long arg2, + unsigned long arg3, unsigned long arg4, + unsigned long arg5, unsigned long arg6); + +#define EXECUTE_SYSCALL(syscall, regs) \ + (*sys_call_table[syscall])(UM_SYSCALL_ARG1(®s), \ + UM_SYSCALL_ARG2(®s), \ + UM_SYSCALL_ARG3(®s), \ + UM_SYSCALL_ARG4(®s), \ + UM_SYSCALL_ARG5(®s), \ + UM_SYSCALL_ARG6(®s)) extern syscall_handler_t old_mmap; +extern syscall_handler_t sys_fcntl64; +extern syscall_handler_t sys_getdents64; +extern syscall_handler_t sys_mincore; +extern syscall_handler_t sys_madvise; #define ARCH_SYSCALLS \ [ __NR_modify_ldt ] = sys_ni_syscall, \ @@ -14,6 +28,7 @@ [ __NR_pciconfig_iobase ] = sys_ni_syscall, \ [ __NR_pivot_root ] = sys_ni_syscall, \ [ __NR_multiplexer ] = sys_ni_syscall, \ + [ __NR_mmap ] = old_mmap, \ [ __NR_fcntl64 ] = sys_fcntl64, \ [ __NR_getdents64 ] = sys_getdents64, \ [ __NR_madvise ] = sys_madvise, \ diff -Naur -X exclude-files ac_cur/arch/um/sys-ppc/Makefile ac/arch/um/sys-ppc/Makefile --- ac_cur/arch/um/sys-ppc/Makefile Fri Jun 1 20:50:47 2001 +++ ac/arch/um/sys-ppc/Makefile Fri Jun 1 22:12:55 2001 @@ -5,13 +5,14 @@ OBJS = ptrace.o sigcontext.o semaphore.o checksum.o miscthings.o misc.o \ ptrace_user.o -#bitops.o EXTRA_CFLAGS = -I../include -I$(TOPDIR)/include USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(EXTRA_CFLAGS) +EXTRA_AFLAGS := -DCONFIG_ALL_PPC -I. -I$(TOPDIR)/arch/ppc/kernel + all: $(OBJ) $(OBJ): $(OBJS) @@ -19,11 +20,14 @@ $(LD) $(LINKFLAGS) --start-group $^ --end-group -o $@ ptrace.o: ptrace.c - $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< + $(CC) -D__KERNEL__ $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< miscthings.o: miscthings.c $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< +sigcontext.o: sigcontext.c + $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< + semaphore.c: rm -f $@ ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@ @@ -32,19 +36,6 @@ rm -f $@ ln -s $(TOPDIR)/arch/ppc/lib/$@ $@ -#misc.S: -# rm -f $@ -# ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@ - -../kernel/ppc_asm.tmpl: - rm -f $@ - ln -s $(TOPDIR)/arch/ppc/lib/$@ $@ - ln -s $(TOPDIR)/arch/ppc/lib/$@ ./ - -ppc_asm.h: - rm -f $@ - ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@ - mk_defs.c: rm -f $@ ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@ @@ -68,24 +59,25 @@ # grep '^#define' mk_defs.s >> ppc_defs.h # rm mk_defs.s -asm: - rm -f $@ - ln -s $(TOPDIR)/include/asm-ppc $@ +# the asm link is horrible, and breaks the other targets. This is also +# not going to work with parallel makes. -checksum.o: checksum.S ../kernel/ppc_asm.tmpl +checksum.o: checksum.S rm -f asm - ln -s $(TOPDIR)/include/asm-ppc $@ - $(CC) -I. $(AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o + ln -s $(TOPDIR)/include/asm-ppc asm + $(CC) $(EXTRA_AFLAGS) $(AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o rm -f asm -misc.o: misc.S ../kernel/ppc_asm.tmpl ppc_asm.h ppc_defs.h +misc.o: misc.S ppc_defs.h rm -f asm ln -s $(TOPDIR)/include/asm-ppc asm - $(CC) -I. $(AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o + $(CC) $(EXTRA_AFLAGS) $(AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o rm -f asm clean: rm -f $(OBJS) + rm -f ppc_defs.h + rm -f checksum.S semaphore.c mk_defs.c fastdep: diff -Naur -X exclude-files ac_cur/arch/um/sys-ppc/miscthings.c ac/arch/um/sys-ppc/miscthings.c --- ac_cur/arch/um/sys-ppc/miscthings.c Fri Jun 1 20:50:47 2001 +++ ac/arch/um/sys-ppc/miscthings.c Fri Jun 1 22:13:01 2001 @@ -1,14 +1,12 @@ -#include "linux/threads.h" #include "asm/uaccess.h" #include "linux/config.h" #include "linux/threads.h" -#include "linux/stddef.h" -#include "linux/elf.h" +#include "linux/stddef.h" // for NULL +#include "linux/elf.h" // for AT_NULL /* unsigned int local_bh_count[NR_CPUS]; */ unsigned long isa_io_base = 0; - /* The following function nicked from arch/ppc/kernel/process.c and * adapted slightly */ /* @@ -46,6 +44,7 @@ } } /* END stuff taken from arch/ppc/kernel/process.c */ + /* * Overrides for Emacs so that we follow Linus's tabbing style. diff -Naur -X exclude-files ac_cur/arch/um/sys-ppc/sigcontext.c ac/arch/um/sys-ppc/sigcontext.c --- ac_cur/arch/um/sys-ppc/sigcontext.c Wed Dec 31 19:00:00 1969 +++ ac/arch/um/sys-ppc/sigcontext.c Fri Jun 1 22:13:06 2001 @@ -0,0 +1,40 @@ +#include "asm/ptrace.h" +#include "asm/sigcontext.h" +#include "sysdep/ptrace.h" +#include "user_util.h" + +void fill_in_sigcontext(void *scontext, struct sys_pt_regs *regs, + unsigned long cr2, int err) +{ + struct sigcontext_struct *sc = scontext; +#if 0 + int i; + // general purpose regs + for (i=0; i<32; ++i) { + sc->regs->gpr[i] = regs->regs[PT_R0 + i]; + } + sc->regs->nip = regs->regs[PT_NIP]; + sc->regs->msr = regs->regs[PT_MSR]; + sc->regs->orig_gpr3 = regs->regs[PT_ORIG_R3]; + sc->regs->ctr = regs->regs[PT_CTR]; + sc->regs->link = regs->regs[PT_LNK]; + sc->regs->xer = regs->regs[PT_XER]; + sc->regs->ccr = regs->regs[PT_CCR]; + sc->regs->mq = regs->regs[PT_MQ]; + sc->regs->trap = err; + sc->regs->dar = cr2; +#endif + *(sc->regs) = *regs; + // DAR, DSISR, RESULT? +} + +/* + * 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: + */