diff options
author | Tony Luck <tony.luck@intel.com> | 2005-05-09 16:44:53 -0700 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2005-05-09 16:44:53 -0700 |
commit | a84f5770170232a48e753e02ee5f0f17ee17b791 (patch) | |
tree | 4efbd8a990df4437fb178c8a705dadc36812f98a /arch/um/sys-x86_64/ptrace.c | |
parent | 66302f211a21bb9439a2ae7f7b6a4c386bb10ecd (diff) | |
parent | 88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff) | |
download | op-kernel-dev-a84f5770170232a48e753e02ee5f0f17ee17b791.zip op-kernel-dev-a84f5770170232a48e753e02ee5f0f17ee17b791.tar.gz |
Merge with /home/aegl/GIT/linus
Diffstat (limited to 'arch/um/sys-x86_64/ptrace.c')
-rw-r--r-- | arch/um/sys-x86_64/ptrace.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/arch/um/sys-x86_64/ptrace.c b/arch/um/sys-x86_64/ptrace.c index 8c146b2..b593bb2 100644 --- a/arch/um/sys-x86_64/ptrace.c +++ b/arch/um/sys-x86_64/ptrace.c @@ -62,6 +62,27 @@ int putreg(struct task_struct *child, int regno, unsigned long value) return 0; } +int poke_user(struct task_struct *child, long addr, long data) +{ + if ((addr & 3) || addr < 0) + return -EIO; + + if (addr < MAX_REG_OFFSET) + return putreg(child, addr, data); + +#if 0 /* Need x86_64 debugregs handling */ + else if((addr >= offsetof(struct user, u_debugreg[0])) && + (addr <= offsetof(struct user, u_debugreg[7]))){ + addr -= offsetof(struct user, u_debugreg[0]); + addr = addr >> 2; + if((addr == 4) || (addr == 5)) return -EIO; + child->thread.arch.debugregs[addr] = data; + return 0; + } +#endif + return -EIO; +} + unsigned long getreg(struct task_struct *child, int regno) { unsigned long retval = ~0UL; @@ -84,6 +105,29 @@ unsigned long getreg(struct task_struct *child, int regno) return retval; } +int peek_user(struct task_struct *child, long addr, long data) +{ + /* read the word at location addr in the USER area. */ + unsigned long tmp; + + if ((addr & 3) || addr < 0) + return -EIO; + + tmp = 0; /* Default return condition */ + if(addr < MAX_REG_OFFSET){ + tmp = getreg(child, addr); + } +#if 0 /* Need x86_64 debugregs handling */ + else if((addr >= offsetof(struct user, u_debugreg[0])) && + (addr <= offsetof(struct user, u_debugreg[7]))){ + addr -= offsetof(struct user, u_debugreg[0]); + addr = addr >> 2; + tmp = child->thread.arch.debugregs[addr]; + } +#endif + return put_user(tmp, (unsigned long *) data); +} + void arch_switch(void) { /* XXX |