diff options
author | grehan <grehan@FreeBSD.org> | 2003-01-08 12:19:37 +0000 |
---|---|---|
committer | grehan <grehan@FreeBSD.org> | 2003-01-08 12:19:37 +0000 |
commit | 654cbff0ddaa5d0cc777cfec4789e9357757537b (patch) | |
tree | eae10dcf6fad5ea88ddf43656d9a66d8bd2786f5 /sys/powerpc/aim | |
parent | be4bc4017501a05921869f9121a54415301ea500 (diff) | |
download | FreeBSD-src-654cbff0ddaa5d0cc777cfec4789e9357757537b.zip FreeBSD-src-654cbff0ddaa5d0cc777cfec4789e9357757537b.tar.gz |
Fix incorrect error returns and sign-extension.
Approved by: benno
Diffstat (limited to 'sys/powerpc/aim')
-rw-r--r-- | sys/powerpc/aim/copyinout.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/powerpc/aim/copyinout.c b/sys/powerpc/aim/copyinout.c index 7a28fc0..227dd70 100644 --- a/sys/powerpc/aim/copyinout.c +++ b/sys/powerpc/aim/copyinout.c @@ -221,7 +221,7 @@ subyte(void *addr, int byte) if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; - return (EFAULT); + return (-1); } set_user_sr(pm->pm_sr[(u_int)addr >> ADDR_SR_SHFT]); @@ -246,7 +246,7 @@ suword(void *addr, long word) if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; - return (EFAULT); + return (-1); } set_user_sr(pm->pm_sr[(u_int)addr >> ADDR_SR_SHFT]); @@ -270,21 +270,21 @@ fubyte(const void *addr) struct thread *td; pmap_t pm; faultbuf env; - char *p; + u_char *p; int val; td = PCPU_GET(curthread); pm = &td->td_proc->p_vmspace->vm_pmap; - p = (char *)((u_int)USER_ADDR + ((u_int)addr & ~SEGMENT_MASK)); + p = (u_char *)((u_int)USER_ADDR + ((u_int)addr & ~SEGMENT_MASK)); if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; - return (EFAULT); + return (-1); } set_user_sr(pm->pm_sr[(u_int)addr >> ADDR_SR_SHFT]); - val = (int)*p; + val = *p; td->td_pcb->pcb_onfault = NULL; return (val); @@ -304,7 +304,7 @@ fuword(const void *addr) if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; - return (EFAULT); + return (-1); } set_user_sr(pm->pm_sr[(u_int)addr >> ADDR_SR_SHFT]); |