diff options
-rw-r--r-- | sys/compat/pecoff/imgact_pecoff.c | 13 | ||||
-rw-r--r-- | sys/i386/linux/linux_sysvec.c | 15 | ||||
-rw-r--r-- | sys/kern/imgact_aout.c | 14 |
3 files changed, 20 insertions, 22 deletions
diff --git a/sys/compat/pecoff/imgact_pecoff.c b/sys/compat/pecoff/imgact_pecoff.c index d245fee..812aa5e 100644 --- a/sys/compat/pecoff/imgact_pecoff.c +++ b/sys/compat/pecoff/imgact_pecoff.c @@ -172,7 +172,7 @@ pecoff_coredump(register struct thread * td, register struct vnode * vp, register struct ucred *cred = td->td_ucred; struct proc *p = td->td_proc; register struct vmspace *vm = p->p_vmspace; - caddr_t tempuser; + char *tempuser; int error; #ifdef PECOFF_DEBUG struct vm_map *map; @@ -187,15 +187,14 @@ pecoff_coredump(register struct thread * td, register struct vnode * vp, M_WAITOK | M_ZERO); if (tempuser == NULL) return (ENOMEM); + PROC_LOCK(p); + fill_kinfo_proc(p, &p->p_uarea->u_kproc); + PROC_UNLOCK(p); bcopy(p->p_uarea, tempuser, sizeof(struct user)); bcopy(td->td_frame, tempuser + ctob(uarea_pages) + - ((caddr_t) td->td_frame - (caddr_t) td->td_kstack), + ((caddr_t)td->td_frame - (caddr_t)td->td_kstack), sizeof(struct trapframe)); - PROC_LOCK(p); - fill_kinfo_proc(p, &p->p_uarea->u_kproc); - PROC_UNLOCK(p); - #if PECOFF_DEBUG fill_regs(td, ®s); printf("EIP%x\n", regs.r_eip); @@ -205,7 +204,7 @@ pecoff_coredump(register struct thread * td, register struct vnode * vp, ent = &map->header; printf("%p %p %p\n", ent, ent->prev, ent->next); #endif - error = vn_rdwr(UIO_WRITE, vp, (caddr_t) tempuser, + error = vn_rdwr(UIO_WRITE, vp, (caddr_t)tempuser, ctob(uarea_pages + kstack_pages), (off_t)0, UIO_SYSSPACE, IO_UNIT, cred, NOCRED, (int *)NULL, td); diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index 4e1f3e5..e6c2364 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -30,7 +30,6 @@ /* XXX we use functions that might not exist. */ #include "opt_compat.h" -#include "opt_kstack_pages.h" #ifndef COMPAT_43 #error "Unable to compile Linux-emulator due to missing COMPAT_43 option!" @@ -732,7 +731,7 @@ linux_aout_coredump(struct thread *td, struct vnode *vp, off_t limit) struct proc *p = td->td_proc; struct ucred *cred = td->td_ucred; struct vmspace *vm = p->p_vmspace; - caddr_t tempuser; + char *tempuser; int error; if (ctob((uarea_pages + kstack_pages) + @@ -742,15 +741,15 @@ linux_aout_coredump(struct thread *td, struct vnode *vp, off_t limit) M_WAITOK | M_ZERO); if (tempuser == NULL) return (ENOMEM); + PROC_LOCK(p); + fill_kinfo_proc(p, &p->p_uarea->u_kproc); + PROC_UNLOCK(p); bcopy(p->p_uarea, tempuser, sizeof(struct user)); bcopy(td->td_frame, tempuser + ctob(uarea_pages) + - ((caddr_t) td->td_frame - (caddr_t) td->td_kstack), + ((caddr_t)td->td_frame - (caddr_t)td->td_kstack), sizeof(struct trapframe)); - PROC_LOCK(p); - fill_kinfo_proc(p, &p->p_uarea->u_kproc); - PROC_UNLOCK(p); - error = vn_rdwr(UIO_WRITE, vp, (caddr_t) tempuser, + error = vn_rdwr(UIO_WRITE, vp, (caddr_t)tempuser, ctob(uarea_pages + kstack_pages), (off_t)0, UIO_SYSSPACE, IO_UNIT, cred, NOCRED, (int *)NULL, td); @@ -762,7 +761,7 @@ linux_aout_coredump(struct thread *td, struct vnode *vp, off_t limit) IO_UNIT | IO_DIRECT, cred, NOCRED, (int *) NULL, td); if (error == 0) error = vn_rdwr_inchunks(UIO_WRITE, vp, - (caddr_t) trunc_page(USRSTACK - ctob(vm->vm_ssize)), + (caddr_t)trunc_page(USRSTACK - ctob(vm->vm_ssize)), round_page(ctob(vm->vm_ssize)), (off_t)ctob(uarea_pages + kstack_pages) + ctob(vm->vm_dsize), UIO_USERSPACE, diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c index e21358a..4ed589d 100644 --- a/sys/kern/imgact_aout.c +++ b/sys/kern/imgact_aout.c @@ -272,7 +272,7 @@ aout_coredump(td, vp, limit) struct proc *p = td->td_proc; register struct ucred *cred = td->td_ucred; register struct vmspace *vm = p->p_vmspace; - caddr_t tempuser; + char *tempuser; int error; if (ctob((uarea_pages + kstack_pages) @@ -282,15 +282,15 @@ aout_coredump(td, vp, limit) M_WAITOK | M_ZERO); if (tempuser == NULL) return (ENOMEM); + PROC_LOCK(p); + fill_kinfo_proc(p, &p->p_uarea->u_kproc); + PROC_UNLOCK(p); bcopy(p->p_uarea, tempuser, sizeof(struct user)); bcopy(td->td_frame, tempuser + ctob(uarea_pages) + - ((caddr_t) td->td_frame - (caddr_t) td->td_kstack), + ((caddr_t)td->td_frame - (caddr_t)td->td_kstack), sizeof(struct trapframe)); - PROC_LOCK(p); - fill_kinfo_proc(p, &p->p_uarea->u_kproc); - PROC_UNLOCK(p); - error = vn_rdwr(UIO_WRITE, vp, (caddr_t) tempuser, + error = vn_rdwr(UIO_WRITE, vp, (caddr_t)tempuser, ctob(uarea_pages + kstack_pages), (off_t)0, UIO_SYSSPACE, IO_UNIT, cred, NOCRED, (int *)NULL, td); @@ -302,7 +302,7 @@ aout_coredump(td, vp, limit) IO_UNIT | IO_DIRECT, cred, NOCRED, (int *) NULL, td); if (error == 0) error = vn_rdwr_inchunks(UIO_WRITE, vp, - (caddr_t) trunc_page(USRSTACK - ctob(vm->vm_ssize)), + (caddr_t)trunc_page(USRSTACK - ctob(vm->vm_ssize)), round_page(ctob(vm->vm_ssize)), (off_t)ctob(uarea_pages + kstack_pages) + ctob(vm->vm_dsize), UIO_USERSPACE, |