summaryrefslogtreecommitdiffstats
path: root/sys/i386/linux
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2003-03-03 09:14:26 +0000
committerdes <des@FreeBSD.org>2003-03-03 09:14:26 +0000
commit021faa11ac3e8868e33ee981995319d77cba1b58 (patch)
tree328039d4f363f2179be4fe277b395b7f3e9d2d3f /sys/i386/linux
parent0968a2b9642c2cbd0a4a82a8fcd1e16cd8f356de (diff)
downloadFreeBSD-src-021faa11ac3e8868e33ee981995319d77cba1b58.zip
FreeBSD-src-021faa11ac3e8868e33ee981995319d77cba1b58.tar.gz
More caddr_t removal, in conjunction with copy{in,out}(9) this time.
Also clean up some egregious casts and incorrect use of sizeof.
Diffstat (limited to 'sys/i386/linux')
-rw-r--r--sys/i386/linux/imgact_linux.c9
-rw-r--r--sys/i386/linux/linux_machdep.c14
-rw-r--r--sys/i386/linux/linux_ptrace.c19
-rw-r--r--sys/i386/linux/linux_sysvec.c4
4 files changed, 21 insertions, 25 deletions
diff --git a/sys/i386/linux/imgact_linux.c b/sys/i386/linux/imgact_linux.c
index 176a858..bc32ba8 100644
--- a/sys/i386/linux/imgact_linux.c
+++ b/sys/i386/linux/imgact_linux.c
@@ -149,8 +149,8 @@ exec_linux_imgact(struct image_params *imgp)
if (error)
goto fail;
- error = copyout((caddr_t)(void *)(uintptr_t)(buffer + file_offset),
- (caddr_t)vmaddr, a_out->a_text + a_out->a_data);
+ error = copyout((void *)(buffer + file_offset),
+ (void *)vmaddr, a_out->a_text + a_out->a_data);
vm_map_remove(kernel_map, buffer,
buffer + round_page(a_out->a_text + a_out->a_data + file_offset));
@@ -223,9 +223,8 @@ exec_linux_imgact(struct image_params *imgp)
/* Fill in process VM information */
vmspace->vm_tsize = round_page(a_out->a_text) >> PAGE_SHIFT;
vmspace->vm_dsize = round_page(a_out->a_data + bss_size) >> PAGE_SHIFT;
- vmspace->vm_taddr = (caddr_t)(void *)(uintptr_t)virtual_offset;
- vmspace->vm_daddr = (caddr_t)(void *)(uintptr_t)
- (virtual_offset + a_out->a_text);
+ vmspace->vm_taddr = (caddr_t)virtual_offset;
+ vmspace->vm_daddr = (caddr_t)(virtual_offset + a_out->a_text);
/* Fill in image_params */
imgp->interpreted = 0;
diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c
index 9f8c97a..9448f3e 100644
--- a/sys/i386/linux/linux_machdep.c
+++ b/sys/i386/linux/linux_machdep.c
@@ -153,7 +153,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *args)
a.semid = args->arg1;
a.semnum = args->arg2;
a.cmd = args->arg3;
- error = copyin((caddr_t)args->ptr, &a.arg, sizeof(a.arg));
+ error = copyin(args->ptr, &a.arg, sizeof(a.arg));
if (error)
return (error);
return (linux_semctl(td, &a));
@@ -179,7 +179,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *args)
if (args->ptr == NULL)
return (EINVAL);
- error = copyin((caddr_t)args->ptr, &tmp, sizeof(tmp));
+ error = copyin(args->ptr, &tmp, sizeof(tmp));
if (error)
return (error);
a.msgp = tmp.msgp;
@@ -255,7 +255,7 @@ linux_old_select(struct thread *td, struct linux_old_select_args *args)
printf(ARGS(old_select, "%p"), args->ptr);
#endif
- error = copyin((caddr_t)args->ptr, &linux_args, sizeof(linux_args));
+ error = copyin(args->ptr, &linux_args, sizeof(linux_args));
if (error)
return (error);
@@ -416,7 +416,7 @@ linux_mmap(struct thread *td, struct linux_mmap_args *args)
int error;
struct l_mmap_argv linux_args;
- error = copyin((caddr_t)args->ptr, &linux_args, sizeof(linux_args));
+ error = copyin(args->ptr, &linux_args, sizeof(linux_args));
if (error)
return (error);
@@ -683,8 +683,7 @@ linux_sigaction(struct thread *td, struct linux_sigaction_args *args)
#endif
if (args->nsa != NULL) {
- error = copyin((caddr_t)args->nsa, &osa,
- sizeof(l_osigaction_t));
+ error = copyin(args->nsa, &osa, sizeof(l_osigaction_t));
if (error)
return (error);
act.lsa_handler = osa.lsa_handler;
@@ -702,8 +701,7 @@ linux_sigaction(struct thread *td, struct linux_sigaction_args *args)
osa.lsa_flags = oact.lsa_flags;
osa.lsa_restorer = oact.lsa_restorer;
osa.lsa_mask = oact.lsa_mask.__bits[0];
- error = copyout(&osa, (caddr_t)args->osa,
- sizeof(l_osigaction_t));
+ error = copyout(&osa, args->osa, sizeof(l_osigaction_t));
}
return (error);
diff --git a/sys/i386/linux/linux_ptrace.c b/sys/i386/linux/linux_ptrace.c
index ff7c0ae..284c84a 100644
--- a/sys/i386/linux/linux_ptrace.c
+++ b/sys/i386/linux/linux_ptrace.c
@@ -287,7 +287,7 @@ linux_ptrace(struct thread *td, struct linux_ptrace_args *uap)
int rval = td->td_retval[0];
error = kern_ptrace(td, req, pid, addr, 0);
if (error == 0)
- error = copyout(td->td_retval, (caddr_t)uap->data,
+ error = copyout(td->td_retval, (void *)uap->data,
sizeof(l_int));
td->td_retval[0] = rval;
break;
@@ -309,13 +309,13 @@ linux_ptrace(struct thread *td, struct linux_ptrace_args *uap)
error = kern_ptrace(td, PT_GETREGS, pid, &u.bsd_reg, 0);
if (error == 0) {
map_regs_to_linux(&u.bsd_reg, &r.reg);
- error = copyout(&r.reg, (caddr_t)uap->data,
+ error = copyout(&r.reg, (void *)uap->data,
sizeof(r.reg));
}
break;
case PTRACE_SETREGS:
/* Linux is using data where FreeBSD is using addr */
- error = copyin((caddr_t)uap->data, &r.reg, sizeof(r.reg));
+ error = copyin((void *)uap->data, &r.reg, sizeof(r.reg));
if (error == 0) {
map_regs_from_linux(&u.bsd_reg, &r.reg);
error = kern_ptrace(td, PT_SETREGS, pid, &u.bsd_reg, 0);
@@ -326,13 +326,13 @@ linux_ptrace(struct thread *td, struct linux_ptrace_args *uap)
error = kern_ptrace(td, PT_GETFPREGS, pid, &u.bsd_fpreg, 0);
if (error == 0) {
map_fpregs_to_linux(&u.bsd_fpreg, &r.fpreg);
- error = copyout(&r.fpreg, (caddr_t)uap->data,
+ error = copyout(&r.fpreg, (void *)uap->data,
sizeof(r.fpreg));
}
break;
case PTRACE_SETFPREGS:
/* Linux is using data where FreeBSD is using addr */
- error = copyin((caddr_t)uap->data, &r.fpreg, sizeof(r.fpreg));
+ error = copyin((void *)uap->data, &r.fpreg, sizeof(r.fpreg));
if (error == 0) {
map_fpregs_from_linux(&u.bsd_fpreg, &r.fpreg);
error = kern_ptrace(td, PT_SETFPREGS, pid,
@@ -341,8 +341,7 @@ linux_ptrace(struct thread *td, struct linux_ptrace_args *uap)
break;
case PTRACE_SETFPXREGS:
#ifdef CPU_ENABLE_SSE
- error = copyin((caddr_t)uap->data, &r.fpxreg,
- sizeof(r.fpxreg));
+ error = copyin((void *)uap->data, &r.fpxreg, sizeof(r.fpxreg));
if (error)
break;
#endif
@@ -401,7 +400,7 @@ linux_ptrace(struct thread *td, struct linux_ptrace_args *uap)
_PRELE(p);
PROC_UNLOCK(p);
if (error == 0)
- error = copyout(&r.fpxreg, (caddr_t)uap->data,
+ error = copyout(&r.fpxreg, (void *)uap->data,
sizeof(r.fpxreg));
} else {
/* clear dangerous bits exactly as Linux does*/
@@ -440,7 +439,7 @@ linux_ptrace(struct thread *td, struct linux_ptrace_args *uap)
map_regs_to_linux(&u.bsd_reg, &r.reg);
if (req == PTRACE_PEEKUSR) {
error = copyout((char *)&r.reg + uap->addr,
- (caddr_t)uap->data, sizeof(l_int));
+ (void *)uap->data, sizeof(l_int));
break;
}
@@ -464,7 +463,7 @@ linux_ptrace(struct thread *td, struct linux_ptrace_args *uap)
uap->addr -= LINUX_DBREG_OFFSET;
if (req == PTRACE_PEEKUSR) {
error = copyout((char *)&u.bsd_dbreg +
- uap->addr, (caddr_t)uap->data,
+ uap->addr, (void *)uap->data,
sizeof(l_int));
break;
}
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c
index 29b0713..b476b48 100644
--- a/sys/i386/linux/linux_sysvec.c
+++ b/sys/i386/linux/linux_sysvec.c
@@ -523,7 +523,7 @@ linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args)
* It is unsafe to keep track of it ourselves, in the event that a
* program jumps out of a signal handler.
*/
- if (copyin((caddr_t)args->sfp, &frame, sizeof(frame)) != 0)
+ if (copyin(args->sfp, &frame, sizeof(frame)) != 0)
return (EFAULT);
/*
@@ -619,7 +619,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args)
* It is unsafe to keep track of it ourselves, in the event that a
* program jumps out of a signal handler.
*/
- if (copyin((caddr_t)args->ucp, &uc, sizeof(uc)) != 0)
+ if (copyin(args->ucp, &uc, sizeof(uc)) != 0)
return (EFAULT);
context = &uc.uc_mcontext;
OpenPOWER on IntegriCloud