diff -Naur -X exclude-files ac_clean/arch/um/Makefile ac/arch/um/Makefile --- ac_clean/arch/um/Makefile Sat May 12 19:21:35 2001 +++ ac/arch/um/Makefile Sat May 12 19:23:18 2001 @@ -43,7 +43,8 @@ $(ARCH_DIR)/link.ld: m4 -DSTART=$(shell echo $$((($(NESTING) + 1) * $(START_ADDR)))) \ - -DSUBARCH=$(SUBARCH) $(ARCH_DIR)/link.ld.in > $(ARCH_DIR)/link.ld + -DSUBARCH=$(SUBARCH) -DELF_SUBARCH=$(ELF_SUBARCH) \ + $(ARCH_DIR)/link.ld.in > $(ARCH_DIR)/link.ld ARCH_SYMLINKS = include/asm-um/arch arch/um/include/sysdep diff -Naur -X exclude-files ac_clean/arch/um/Makefile-i386 ac/arch/um/Makefile-i386 --- ac_clean/arch/um/Makefile-i386 Thu May 10 15:54:55 2001 +++ ac/arch/um/Makefile-i386 Sat May 12 19:23:33 2001 @@ -1,2 +1,3 @@ START_ADDR = 0x10000000 ARCH_CFLAGS = -U__$(SUBARCH)__ -U$(SUBARCH) +ELF_SUBARCH = $(SUBARCH) diff -Naur -X exclude-files ac_clean/arch/um/fs/hostfs/hostfs_kern.c ac/arch/um/fs/hostfs/hostfs_kern.c --- ac_clean/arch/um/fs/hostfs/hostfs_kern.c Thu May 10 15:54:55 2001 +++ ac/arch/um/fs/hostfs/hostfs_kern.c Sat May 12 19:25:51 2001 @@ -73,15 +73,24 @@ static int read_name(struct inode *ino, char *name) { + /* The non-int inode fields are copied into ints by stat_file and + * then copied into the inode because passing the actual pointers + * in and having them treated as int * breaks on big-endian machines + */ int err; - err = stat_file(name, (int *) &ino->i_dev, &ino->i_ino, - (int *) &ino->i_mode, (int *) &ino->i_nlink, - &ino->i_uid, &ino->i_gid, - (unsigned long *) &ino->i_size, - &ino->i_atime, &ino->i_mtime, &ino->i_ctime, - (int *) &ino->i_blksize, (int *) &ino->i_blocks); + int i_dev, i_mode, i_nlink, i_blksize, i_blocks; + unsigned long i_size; + err = stat_file(name, &i_dev, &ino->i_ino, &i_mode, &i_nlink, + &ino->i_uid, &ino->i_gid, &i_size, &ino->i_atime, + &ino->i_mtime, &ino->i_ctime, &i_blksize, &i_blocks); if(err) return(err); + ino->i_dev = i_dev; + ino->i_mode = i_mode; + ino->i_nlink = i_nlink; + ino->i_size = i_size; + ino->i_blksize = i_blksize; + ino->i_blocks = i_blocks; if((ino->i_sb->s_dev == ROOT_DEV) && (ino->i_uid == getuid())) ino->i_uid = 0; return(0); diff -Naur -X exclude-files ac_clean/arch/um/include/process.h ac/arch/um/include/process.h --- ac_clean/arch/um/include/process.h Wed Dec 31 19:00:00 1969 +++ ac/arch/um/include/process.h Sat May 12 19:22:35 2001 @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2000 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#ifndef __PROCESS_H__ +#define __PROCESS_H__ + +#include + +extern void sig_handler(int sig, struct sigcontext sc); +extern void irq_handler(int sig, struct sigcontext sc); + +#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 exclude-files ac_clean/arch/um/include/sysdep-i386/ptrace.h ac/arch/um/include/sysdep-i386/ptrace.h --- ac_clean/arch/um/include/sysdep-i386/ptrace.h Thu May 10 15:54:55 2001 +++ ac/arch/um/include/sysdep-i386/ptrace.h Sat May 12 19:27:35 2001 @@ -20,6 +20,7 @@ #define UM_SYSCALL_RET(r) UM_REG(r, EAX) #define UM_SYSCALL_NR(r) UM_REG(r, ORIG_EAX) + #define UM_SYSCALL_ARG1(r) UM_REG(r, EBX) #define UM_SYSCALL_ARG2(r) UM_REG(r, ECX) #define UM_SYSCALL_ARG3(r) UM_REG(r, EDX) @@ -27,10 +28,19 @@ #define UM_SYSCALL_ARG5(r) UM_REG(r, EDI) #define UM_SYSCALL_ARG6(r) UM_REG(r, EBP) -#define UM_SYSCALL_NR_OFFSET (ORIG_EAX * sizeof(long)) -#define UM_SP_OFFSET (UESP * sizeof(long)) #define UM_IP_OFFSET (EIP * sizeof(long)) +#define UM_SP_OFFSET (UESP * sizeof(long)) #define UM_ELF_ZERO_OFFSET (EDX * sizeof(long)) + +#define UM_SYSCALL_RET_OFFSET (EAX * sizeof(long)) +#define UM_SYSCALL_NR_OFFSET (ORIG_EAX * sizeof(long)) + +#define UM_SYSCALL_ARG1_OFFSET (EBX * sizeof(long)) +#define UM_SYSCALL_ARG2_OFFSET (ECX * sizeof(long)) +#define UM_SYSCALL_ARG3_OFFSET (EDX * sizeof(long)) +#define UM_SYSCALL_ARG4_OFFSET (ESI * sizeof(long)) +#define UM_SYSCALL_ARG5_OFFSET (EDI * sizeof(long)) +#define UM_SYSCALL_ARG6_OFFSET (EBP * sizeof(long)) #endif diff -Naur -X exclude-files ac_clean/arch/um/include/sysdep-i386/sigcontext.h ac/arch/um/include/sysdep-i386/sigcontext.h --- ac_clean/arch/um/include/sysdep-i386/sigcontext.h Thu May 10 15:54:55 2001 +++ ac/arch/um/include/sysdep-i386/sigcontext.h Sat May 12 19:27:57 2001 @@ -8,6 +8,8 @@ #define SC_FAULT_ADDR(sc) ((sc)->cr2) #define SC_FAULT_WRITE(sc) (((sc)->err) & 2) +#define SC_IP(sc) ((sc)->eip) +#define SC_SP(sc) ((sc)->esp_at_signal) #endif diff -Naur -X exclude-files ac_clean/arch/um/include/user_util.h ac/arch/um/include/user_util.h --- ac_clean/arch/um/include/user_util.h Thu May 10 15:54:55 2001 +++ ac/arch/um/include/user_util.h Sat May 12 19:26:14 2001 @@ -127,8 +127,6 @@ extern void check_brk(void *process_brk); extern void idle_sleep(int secs); extern int get_one_stack(char **stack_out, struct sys_pt_regs *regs_out); -extern void sig_handler(int sig); -extern void irq_handler(int sig); extern void setup_machinename(char *machine_out); extern void setup_hostinfo(void); extern void add_arg(char *cmd_line, char *arg); @@ -147,6 +145,8 @@ extern void create_pid_file(char *name); extern void remap_profiling_buffers(void); extern int load_initrd(char *filename, void *buf, int size); +extern int ptrace_getregs(long pid, struct sys_pt_regs *regs_out); +extern int ptrace_setregs(long pid, struct sys_pt_regs *regs_in); #endif /* diff -Naur -X exclude-files ac_clean/arch/um/kernel/exec_user.c ac/arch/um/kernel/exec_user.c --- ac_clean/arch/um/kernel/exec_user.c Thu May 10 15:54:55 2001 +++ ac/arch/um/kernel/exec_user.c Sat May 12 19:28:49 2001 @@ -24,12 +24,12 @@ (waitpid(new_pid, 0, WUNTRACED) < 0)) tracer_panic("do_exec failed to attach proc"); - if(ptrace(PTRACE_GETREGS, old_pid, 0, ®s) < 0) + if(ptrace_getregs(old_pid, ®s) < 0) tracer_panic("do_exec failed to get registers"); kill(old_pid, SIGKILL); - if((ptrace(PTRACE_SETREGS, new_pid, 0, ®s) < 0) || + if((ptrace_setregs(new_pid, ®s) < 0) || (ptrace(PTRACE_CONT, new_pid, 0, 0) < 0)) tracer_panic("do_exec failed to start new proc"); } diff -Naur -X exclude-files ac_clean/arch/um/kernel/irq_user.c ac/arch/um/kernel/irq_user.c --- ac_clean/arch/um/kernel/irq_user.c Thu May 10 15:54:55 2001 +++ ac/arch/um/kernel/irq_user.c Sat May 12 19:29:44 2001 @@ -14,6 +14,7 @@ #include "user_util.h" #include "kern_util.h" #include "user.h" +#include "process.h" struct irq_fd { struct irq_fd *next; @@ -143,10 +144,10 @@ int flags; flags = on_sigstack ? SA_ONSTACK : 0; - set_handler(SIGVTALRM, irq_handler, flags, SIGUSR1, SIGVTALRM, - SIGALRM, SIGIO, SIGUSR2, -1); - set_handler(SIGIO, irq_handler, flags, SIGUSR1, SIGVTALRM, - SIGALRM, SIGIO, SIGUSR2, -1); + set_handler(SIGVTALRM, (__sighandler_t) irq_handler, flags, SIGUSR1, + SIGVTALRM, SIGALRM, SIGIO, SIGUSR2, -1); + set_handler(SIGIO, (__sighandler_t) irq_handler, flags, SIGUSR1, + SIGVTALRM, SIGALRM, SIGIO, SIGUSR2, -1); } /* diff -Naur -X exclude-files ac_clean/arch/um/kernel/process.c ac/arch/um/kernel/process.c --- ac_clean/arch/um/kernel/process.c Thu May 10 15:54:55 2001 +++ ac/arch/um/kernel/process.c Sat May 12 19:56:47 2001 @@ -22,6 +22,7 @@ #include "user_util.h" #include "kern_util.h" #include "user.h" +#include "process.h" #include "sysdep/ptrace.h" void stop_pid(int pid) @@ -81,12 +82,12 @@ set_sigstack(sig_stack); flags = SA_ONSTACK; } - set_handler(SIGSEGV, sig_handler, flags, SIGVTALRM, SIGUSR1, - SIGALRM, SIGIO, -1); - set_handler(SIGTRAP, sig_handler, flags, SIGVTALRM, SIGUSR1, - SIGALRM, SIGIO, -1); - set_handler(SIGFPE, sig_handler, flags, SIGVTALRM, SIGUSR1, - SIGALRM, SIGIO, -1); + set_handler(SIGSEGV, (__sighandler_t) sig_handler, flags, SIGVTALRM, + SIGUSR1, SIGALRM, SIGIO, -1); + set_handler(SIGTRAP, (__sighandler_t) sig_handler, flags, SIGVTALRM, + SIGUSR1, SIGALRM, SIGIO, -1); + set_handler(SIGFPE, (__sighandler_t) sig_handler, flags, SIGVTALRM, + SIGUSR1, SIGALRM, SIGIO, -1); set_handler(SIGUSR2, process_stack_handler, SA_NODEFER, SIGUSR1, -1); change_sig(SIGUSR2, 1); if(usr1_handler) set_handler(SIGUSR1, usr1_handler, flags, -1); @@ -178,7 +179,7 @@ if(ptrace(PTRACE_CONT, pid, 0, SIGUSR1) < 0) tracer_panic("Couldn't continue forked process"); wait_for_stop(pid, SIGSTOP, PTRACE_CONT); - if(ptrace(PTRACE_SETREGS, pid, 0, regs) < 0) + if(ptrace_setregs(pid, regs) < 0) tracer_panic("Couldn't restore registers"); } @@ -194,7 +195,7 @@ if(pid < 0) return(-errno); wait_for_stop(pid, SIGSTOP, PTRACE_CONT); regs = altstack_state(NULL, NULL, NULL); - if(ptrace(PTRACE_GETREGS, pid, 0, regs) < 0) + if(ptrace_getregs(pid, regs) < 0) panic("Couldn't get altstack state"); save_altstack(NULL, UM_SP(regs)); kill(pid, SIGKILL); @@ -269,11 +270,11 @@ wait_for_stop(pid, SIGSTOP, PTRACE_CONT); ptrace(PTRACE_CONT, pid, 0, 0); wait_for_stop(pid, SIGSTOP, PTRACE_CONT); - if(ptrace(PTRACE_GETREGS, pid, 0, regs_out) < 0){ + if(ptrace_getregs(pid, regs_out) < 0){ perror("get_one_stack : couldn't get registers"); exit(1); } - sp = regs_out->regs[UESP]; + sp = UM_SP(regs_out); sp &= ~sizeof(unsigned long); while(sp < (unsigned long) stack + page_size()){ *((unsigned long *) sp) = ptrace(PTRACE_PEEKDATA, pid, @@ -282,7 +283,7 @@ } ptrace(PTRACE_KILL, pid, 0, 0); waitpid(pid, NULL, 0); - n = page_size() - (regs_out->regs[UESP] & ~page_mask()); + n = page_size() - (UM_SP(regs_out) & ~page_mask()); *stack_out = stack; return(n); diff -Naur -X exclude-files ac_clean/arch/um/kernel/process_kern.c ac/arch/um/kernel/process_kern.c --- ac_clean/arch/um/kernel/process_kern.c Thu May 10 15:54:55 2001 +++ ac/arch/um/kernel/process_kern.c Sat May 12 19:32:27 2001 @@ -657,7 +657,7 @@ if(current->need_resched) schedule(); if(current->thread.npending == 0) do_signal(current, NULL, NULL); if(current->thread.npending > 0) - probe_stack(current->thread.process_regs.regs[UESP]); + probe_stack(UM_SP(¤t->thread.process_regs)); } void *um_kmalloc(int size) diff -Naur -X exclude-files ac_clean/arch/um/kernel/ptrace.c ac/arch/um/kernel/ptrace.c --- ac_clean/arch/um/kernel/ptrace.c Thu May 10 15:54:55 2001 +++ ac/arch/um/kernel/ptrace.c Sat May 12 19:33:23 2001 @@ -190,6 +190,7 @@ break; } +#ifdef PTRACE_GETREGS case PTRACE_GETREGS: { /* Get all gp regs from the child. */ if (!access_ok(VERIFY_WRITE, (unsigned *)data, 17*sizeof(long))) { ret = -EIO; @@ -202,7 +203,8 @@ ret = 0; break; } - +#endif +#ifdef PTRACE_SETREGS case PTRACE_SETREGS: { /* Set all gp regs in the child. */ unsigned long tmp = 0; if (!access_ok(VERIFY_READ, (unsigned *)data, 17*sizeof(long))) { @@ -217,17 +219,19 @@ ret = 0; break; } - +#endif +#ifdef PTRACE_GETFPREGS case PTRACE_GETFPREGS: { /* Get the child FPU state. */ ret = -EIO; break; } - +#endif +#ifdef PTRACE_SETFPREGS case PTRACE_SETFPREGS: { /* Set the child FPU state. */ ret = -EIO; break; } - +#endif default: ret = -EIO; break; diff -Naur -X exclude-files ac_clean/arch/um/kernel/syscall_user.c ac/arch/um/kernel/syscall_user.c --- ac_clean/arch/um/kernel/syscall_user.c Sat May 12 19:21:35 2001 +++ ac/arch/um/kernel/syscall_user.c Sat May 12 19:34:49 2001 @@ -108,21 +108,21 @@ restore = get_restore_regs(task); if(restore){ regs = process_state(task, NULL, NULL); - if(ptrace(PTRACE_SETREGS, pid, 0, regs) < 0) + if(ptrace_setregs(pid, regs) < 0) tracer_panic("Couldn't restore registers"); } if(have_signals(task, 0)) *signal_out = SIGUSR2; else if(have_signals(task, 1)){ regs = altstack_state(task, &stack, &n); - if(ptrace(PTRACE_SETREGS, pid, 0, regs) < 0) + if(ptrace_setregs(pid, regs) < 0) panic("Couldn't set alternate stack state"); sp = um_virt_to_phys(task, UM_SP(regs)); memcpy((void *) sp, stack, n); } else if(again){ regs = syscall_state(task, &stack, &n); - if(ptrace(PTRACE_SETREGS, pid, 0, regs) < 0) + if(ptrace_setregs(pid, regs) < 0) panic("Couldn't restart system call"); memcpy((void *) UM_SP(regs), stack, n); tracing = 0; @@ -138,15 +138,15 @@ struct sys_pt_regs *regs, proc_regs; int syscall, n; - if(ptrace(PTRACE_GETREGS, pid, 0, &proc_regs) < 0) + if(ptrace_getregs(pid, &proc_regs) < 0) tracer_panic("Couldn't read registers"); syscall = UM_SYSCALL_NR(&proc_regs); if(syscall < 1) return(0); if((syscall != __NR_sigreturn) && - ((unsigned long *) proc_regs.regs[EIP] >= &_stext) && - ((unsigned long *) proc_regs.regs[EIP] <= &_etext)) + ((unsigned long *) UM_IP(&proc_regs) >= &_stext) && + ((unsigned long *) UM_IP(&proc_regs) <= &_etext)) tracer_panic("I'm tracing myself and I can't get out"); regs = process_state(task, NULL, NULL); if(syscall == __NR_sigreturn){ @@ -156,7 +156,7 @@ else *regs = proc_regs; set_tracing(task, 0); regs = syscall_state(task, &stack, &n); - if(ptrace(PTRACE_SETREGS, pid, 0, regs) < 0) + if(ptrace_setregs(pid, regs) < 0) tracer_panic("Couldn't set system call state"); memcpy((void *) UM_SP(regs), stack, n); diff -Naur -X exclude-files ac_clean/arch/um/kernel/time.c ac/arch/um/kernel/time.c --- ac_clean/arch/um/kernel/time.c Thu May 10 15:54:55 2001 +++ ac/arch/um/kernel/time.c Sat May 12 19:57:34 2001 @@ -25,6 +25,7 @@ #include "user_util.h" #include "kern_util.h" #include "user.h" +#include "process.h" void timer_handler(int sig, void *sc, int usermode) { @@ -54,8 +55,8 @@ { if(signal(SIGVTALRM, SIG_IGN) == SIG_ERR) panic("Couldn't unset SIGVTALRM handler"); - set_handler(SIGALRM, irq_handler, 0, SIGUSR1, SIGVTALRM, - SIGALRM, SIGIO, SIGUSR2, -1); + set_handler(SIGALRM, (__sighandler_t) irq_handler, 0, SIGUSR1, + SIGVTALRM, SIGALRM, SIGIO, SIGUSR2, -1); set_interval(ITIMER_REAL); } @@ -69,7 +70,7 @@ void set_timers(int set_signal) { if(set_signal){ - if(signal(SIGVTALRM, irq_handler) == SIG_ERR) + if(signal(SIGVTALRM, (__sighandler_t) irq_handler) == SIG_ERR) panic("Couldn't set SIGVTALRM handler"); set_interval(ITIMER_VIRTUAL); } diff -Naur -X exclude-files ac_clean/arch/um/kernel/time_kern.c ac/arch/um/kernel/time_kern.c --- ac_clean/arch/um/kernel/time_kern.c Thu May 10 15:54:55 2001 +++ ac/arch/um/kernel/time_kern.c Sat May 12 19:37:14 2001 @@ -48,26 +48,26 @@ write_unlock(&xtime_lock); } -void __delay(unsigned long time) +void __delay(um_udelay_t time) { int i; for(i=0;iesp_at_signal; + segfault_record[index].sp = SC_SP(context); segfault_record[index].is_user = usermode; - new_ip = segv(SC_FAULT_ADDR(context), context->eip, + new_ip = segv(SC_FAULT_ADDR(context), SC_IP(context), SC_FAULT_WRITE(context), usermode); - if(new_ip != 0) context->eip = new_ip; + if(new_ip != 0) SC_IP(context) = new_ip; } static void (*handlers[])(int, void *, int) = { @@ -313,15 +314,13 @@ [ SIGALRM ] timer_handler }; -void irq_handler(int sig) +void irq_handler(int sig, struct sigcontext sc) { - struct sigcontext_struct *sc; int user_mode, save_errno = errno; - sc = (struct sigcontext_struct *) (&sig + 1); - user_mode = user_context(sc->esp_at_signal); + user_mode = user_context(SC_SP(&sc)); change_sig(SIGUSR1, 1); - (*handlers[sig])(sig, sc, user_mode); + (*handlers[sig])(sig, &sc, user_mode); if(user_mode) interrupt_end(); block_signals(); change_sig(SIGUSR1, 0); @@ -329,19 +328,14 @@ errno = save_errno; } -void sig_handler(int sig) +void sig_handler(int sig, struct sigcontext sc) { - struct sigcontext_struct *sc; int user_mode, save_errno = errno; - sc = (struct sigcontext_struct *) (&sig + 1); - user_mode = user_context(sc->esp_at_signal); + user_mode = user_context(SC_SP(&sc)); change_sig(SIGUSR1, 1); unblock_signals(); - if(user_mode){ - fill_in_regs(process_state(NULL, NULL, NULL), sc); - } - (*handlers[sig])(sig, sc, user_mode); + (*handlers[sig])(sig, &sc, user_mode); if(user_mode){ interrupt_end(); block_signals(); diff -Naur -X exclude-files ac_clean/arch/um/kernel/um_arch.c ac/arch/um/kernel/um_arch.c --- ac_clean/arch/um/kernel/um_arch.c Thu May 10 15:54:55 2001 +++ ac/arch/um/kernel/um_arch.c Sat May 12 19:40:56 2001 @@ -19,6 +19,7 @@ #include "asm/ptrace.h" #include "asm/elf.h" #include "asm/user.h" +#include "asm/delay.h" #include "ubd_user.h" #include "asm/current.h" #include "user_util.h" diff -Naur -X exclude-files ac_clean/arch/um/link.ld.in ac/arch/um/link.ld.in --- ac_clean/arch/um/link.ld.in Thu May 10 15:54:55 2001 +++ ac/arch/um/link.ld.in Sat May 12 19:24:02 2001 @@ -1,5 +1,5 @@ -OUTPUT_FORMAT("elf32-SUBARCH") -OUTPUT_ARCH(SUBARCH) +OUTPUT_FORMAT("elf32-ELF_SUBARCH") +OUTPUT_ARCH(ELF_SUBARCH) ENTRY(_start) SECTIONS diff -Naur -X exclude-files ac_clean/arch/um/ptproxy/sysdep.c ac/arch/um/ptproxy/sysdep.c --- ac_clean/arch/um/ptproxy/sysdep.c Thu May 10 15:54:55 2001 +++ ac/arch/um/ptproxy/sysdep.c Sat May 12 19:43:33 2001 @@ -9,67 +9,61 @@ #include #include #include +#include +#include #include -#ifdef i386 -# define REG_SYSCALL (4 * 11) -# define REG_RESULT (4 * 6) -# define REG_ARG1 (4 * 0) -# define REG_ARG2 (4 * 1) -# define REG_ARG3 (4 * 2) -# define REG_ARG4 (4 * 3) -# define REG_ARG5 (4 * 4) -#endif -#ifdef arm -# define REG_SYSCALL (4 * 17) -# define REG_RESULT (4 * 0) -# define REG_ARG1 (4 * 0) -# define REG_ARG2 (4 * 1) -# define REG_ARG3 (4 * 2) -# define REG_ARG4 (4 * 3) -# define REG_ARG5 (4 * 4) -#endif - int syscall_get_number (pid_t pid) { - return ptrace (PTRACE_PEEKUSER, pid, REG_SYSCALL, 0); + return ptrace (PTRACE_PEEKUSER, pid, UM_SYSCALL_NR_OFFSET, 0); } void syscall_cancel (pid_t pid) { - int err; + int err; - err = ptrace (PTRACE_POKEUSER, pid, REG_SYSCALL, __NR_getpid); - if (err == -1) - { - fprintf (stderr, "ptproxy: couldn't cancel syscall: errno = %d\n", - errno); - exit (1); - } + err = ptrace (PTRACE_POKEUSER, pid, UM_SYSCALL_NR_OFFSET, __NR_getpid); + if (err == -1) + { + fprintf (stderr, "ptproxy: couldn't cancel syscall: " + "errno = %d\n", errno); + exit (1); + } } void syscall_get_args (pid_t pid, long *arg1, long *arg2, long *arg3, long *arg4, long *arg5) { - *arg1 = ptrace (PTRACE_PEEKUSER, pid, REG_ARG1, 0); - *arg2 = ptrace (PTRACE_PEEKUSER, pid, REG_ARG2, 0); - *arg3 = ptrace (PTRACE_PEEKUSER, pid, REG_ARG3, 0); - *arg4 = ptrace (PTRACE_PEEKUSER, pid, REG_ARG4, 0); - *arg5 = ptrace (PTRACE_PEEKUSER, pid, REG_ARG5, 0); + *arg1 = ptrace (PTRACE_PEEKUSER, pid, UM_SYSCALL_ARG1_OFFSET, 0); + *arg2 = ptrace (PTRACE_PEEKUSER, pid, UM_SYSCALL_ARG2_OFFSET, 0); + *arg3 = ptrace (PTRACE_PEEKUSER, pid, UM_SYSCALL_ARG3_OFFSET, 0); + *arg4 = ptrace (PTRACE_PEEKUSER, pid, UM_SYSCALL_ARG4_OFFSET, 0); + *arg5 = ptrace (PTRACE_PEEKUSER, pid, UM_SYSCALL_ARG5_OFFSET, 0); } void syscall_set_result (pid_t pid, long result) { - ptrace (PTRACE_POKEUSER, pid, REG_RESULT, result); + ptrace (PTRACE_POKEUSER, pid, UM_SYSCALL_RET_OFFSET, result); } void syscall_continue (pid_t pid) { - ptrace (PTRACE_SYSCALL, pid, 0, 0); + ptrace (PTRACE_SYSCALL, pid, 0, 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 exclude-files ac_clean/arch/um/sys-i386/Makefile ac/arch/um/sys-i386/Makefile --- ac_clean/arch/um/sys-i386/Makefile Sat May 12 19:21:35 2001 +++ ac/arch/um/sys-i386/Makefile Sat May 12 19:45:38 2001 @@ -1,6 +1,7 @@ OBJ = sys.o -OBJS = checksum.o ldt.o old-checksum.o ptrace.o semaphore.o sigcontext.o +OBJS = checksum.o ldt.o old-checksum.o ptrace.o ptrace_user.o semaphore.o \ + sigcontext.o OX_OBJS = ksyms.o EXTRA_CFLAGS = -I../include @@ -20,6 +21,9 @@ $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< ldt.o: ldt.c + $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< + +ptrace_user.o: ptrace_user.c $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< checksum.S old-checksum.c: diff -Naur -X exclude-files ac_clean/arch/um/sys-i386/ptrace_user.c ac/arch/um/sys-i386/ptrace_user.c --- ac_clean/arch/um/sys-i386/ptrace_user.c Wed Dec 31 19:00:00 1969 +++ ac/arch/um/sys-i386/ptrace_user.c Sat May 12 19:54:58 2001 @@ -0,0 +1,25 @@ +#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 exclude-files ac_clean/include/asm-um/delay.h ac/include/asm-um/delay.h --- ac_clean/include/asm-um/delay.h Thu May 10 15:55:00 2001 +++ ac/include/asm-um/delay.h Sat May 12 19:45:27 2001 @@ -3,4 +3,6 @@ #include "asm/arch/delay.h" +typedef unsigned long um_udelay_t; + #endif