diff options
author | Petr Machata <pmachata@redhat.com> | 2013-03-26 13:19:36 +0100 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2013-03-26 13:19:36 +0100 |
commit | 09489a36a9f0b7fda7bf9d0806301e8d712001b9 (patch) | |
tree | 038a480de6b0f197287ff888c7fb61faad9b499e /sysdeps | |
parent | a193452188e51f233677e3f2607d9a61a789a1df (diff) | |
download | ltrace-09489a36a9f0b7fda7bf9d0806301e8d712001b9.tar.gz |
Coding style in s390/regs.c
- This changes uses of void* to arch_addr_t, and adds tags for future
conversion of arch_addr_t to an integral type.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/linux-gnu/s390/regs.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/sysdeps/linux-gnu/s390/regs.c b/sysdeps/linux-gnu/s390/regs.c index bb16c61..656654a 100644 --- a/sysdeps/linux-gnu/s390/regs.c +++ b/sysdeps/linux-gnu/s390/regs.c @@ -46,7 +46,7 @@ #define PSW_MASK 0x7fffffff #endif -void * +arch_addr_t get_instruction_pointer(struct process *proc) { long ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_PSWADDR, 0) & PSW_MASK; @@ -54,20 +54,22 @@ get_instruction_pointer(struct process *proc) if (proc->mask_32bit) ret &= PSW_MASK31; #endif - return (void *)ret; + /* XXX double cast. */ + return (arch_addr_t)ret; } void -set_instruction_pointer(struct process *proc, void *addr) +set_instruction_pointer(struct process *proc, arch_addr_t addr) { #ifdef __s390x__ if (proc->mask_32bit) - addr = (void *)((long)addr & PSW_MASK31); + /* XXX double cast. */ + addr = (arch_addr_t)((uintptr_t)addr & PSW_MASK31); #endif ptrace(PTRACE_POKEUSER, proc->pid, PT_PSWADDR, addr); } -void * +arch_addr_t get_stack_pointer(struct process *proc) { long ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_GPR15, 0) & PSW_MASK; @@ -75,16 +77,18 @@ get_stack_pointer(struct process *proc) if (proc->mask_32bit) ret &= PSW_MASK31; #endif - return (void *)ret; + /* XXX double cast. */ + return (arch_addr_t)ret; } -void * -get_return_addr(struct process *proc, void *stack_pointer) +arch_addr_t +get_return_addr(struct process *proc, arch_addr_t stack_pointer) { long ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_GPR14, 0) & PSW_MASK; #ifdef __s390x__ if (proc->mask_32bit) ret &= PSW_MASK31; #endif - return (void *)ret; + /* XXX double cast. */ + return (arch_addr_t)ret; } |