Module Name: src Committed By: rmind Date: Thu Dec 17 01:25:11 UTC 2009
Modified Files: src/sys/ddb: db_lwp.c src/sys/kern: init_main.c kern_lwp.c kern_proc.c subr_prof.c sys_process.c src/sys/uvm: uvm_fault.c uvm_glue.c Log Message: Replace few USER_TO_UAREA/UAREA_TO_USER uses, reduce sys/user.h inclusions. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/ddb/db_lwp.c cvs rdiff -u -r1.411 -r1.412 src/sys/kern/init_main.c cvs rdiff -u -r1.136 -r1.137 src/sys/kern/kern_lwp.c cvs rdiff -u -r1.158 -r1.159 src/sys/kern/kern_proc.c cvs rdiff -u -r1.44 -r1.45 src/sys/kern/subr_prof.c cvs rdiff -u -r1.152 -r1.153 src/sys/kern/sys_process.c cvs rdiff -u -r1.128 -r1.129 src/sys/uvm/uvm_fault.c cvs rdiff -u -r1.142 -r1.143 src/sys/uvm/uvm_glue.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/ddb/db_lwp.c diff -u src/sys/ddb/db_lwp.c:1.4 src/sys/ddb/db_lwp.c:1.5 --- src/sys/ddb/db_lwp.c:1.4 Mon Mar 9 06:07:05 2009 +++ src/sys/ddb/db_lwp.c Thu Dec 17 01:25:10 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: db_lwp.c,v 1.4 2009/03/09 06:07:05 mrg Exp $ */ +/* $NetBSD: db_lwp.c,v 1.5 2009/12/17 01:25:10 rmind Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: db_lwp.c,v 1.4 2009/03/09 06:07:05 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_lwp.c,v 1.5 2009/12/17 01:25:10 rmind Exp $"); #ifndef _KERNEL #include <stdbool.h> @@ -39,7 +39,6 @@ #include <sys/param.h> #include <sys/cpu.h> #include <sys/proc.h> -#include <sys/user.h> #include <ddb/ddb.h> Index: src/sys/kern/init_main.c diff -u src/sys/kern/init_main.c:1.411 src/sys/kern/init_main.c:1.412 --- src/sys/kern/init_main.c:1.411 Fri Nov 27 16:43:51 2009 +++ src/sys/kern/init_main.c Thu Dec 17 01:25:10 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: init_main.c,v 1.411 2009/11/27 16:43:51 pooka Exp $ */ +/* $NetBSD: init_main.c,v 1.412 2009/12/17 01:25:10 rmind Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.411 2009/11/27 16:43:51 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.412 2009/12/17 01:25:10 rmind Exp $"); #include "opt_ddb.h" #include "opt_ipsec.h" @@ -152,7 +152,6 @@ #include <sys/pset.h> #include <sys/sysctl.h> #include <sys/reboot.h> -#include <sys/user.h> #include <sys/sysctl.h> #include <sys/event.h> #include <sys/mbuf.h> Index: src/sys/kern/kern_lwp.c diff -u src/sys/kern/kern_lwp.c:1.136 src/sys/kern/kern_lwp.c:1.137 --- src/sys/kern/kern_lwp.c:1.136 Tue Oct 27 02:58:28 2009 +++ src/sys/kern/kern_lwp.c Thu Dec 17 01:25:10 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_lwp.c,v 1.136 2009/10/27 02:58:28 rmind Exp $ */ +/* $NetBSD: kern_lwp.c,v 1.137 2009/12/17 01:25:10 rmind Exp $ */ /*- * Copyright (c) 2001, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -209,7 +209,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.136 2009/10/27 02:58:28 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.137 2009/12/17 01:25:10 rmind Exp $"); #include "opt_ddb.h" #include "opt_lockdebug.h" @@ -228,7 +228,6 @@ #include <sys/syscall_stats.h> #include <sys/kauth.h> #include <sys/sleepq.h> -#include <sys/user.h> #include <sys/lockdebug.h> #include <sys/kmem.h> #include <sys/pset.h> @@ -632,7 +631,7 @@ if (rnewlwpp != NULL) *rnewlwpp = l2; - l2->l_addr = UAREA_TO_USER(uaddr); + uvm_lwp_setuarea(l2, uaddr); uvm_lwp_fork(l1, l2, stack, stacksize, func, (arg != NULL) ? arg : l2); Index: src/sys/kern/kern_proc.c diff -u src/sys/kern/kern_proc.c:1.158 src/sys/kern/kern_proc.c:1.159 --- src/sys/kern/kern_proc.c:1.158 Thu Nov 26 00:19:11 2009 +++ src/sys/kern/kern_proc.c Thu Dec 17 01:25:10 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_proc.c,v 1.158 2009/11/26 00:19:11 matt Exp $ */ +/* $NetBSD: kern_proc.c,v 1.159 2009/12/17 01:25:10 rmind Exp $ */ /*- * Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.158 2009/11/26 00:19:11 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.159 2009/12/17 01:25:10 rmind Exp $"); #include "opt_kstack.h" #include "opt_maxuprc.h" @@ -365,7 +365,7 @@ pg = &pgrp0; l = &lwp0; - KASSERT(l->l_addr != NULL); + KASSERT((void *)uvm_lwp_getuarea(l) != NULL); KASSERT(l->l_lid == p->p_nlwpid); mutex_init(&p->p_stmutex, MUTEX_DEFAULT, IPL_HIGH); @@ -1149,7 +1149,6 @@ #endif /* DDB */ #ifdef KSTACK_CHECK_MAGIC -#include <sys/user.h> #define KSTACK_MAGIC 0xdeadbeaf Index: src/sys/kern/subr_prof.c diff -u src/sys/kern/subr_prof.c:1.44 src/sys/kern/subr_prof.c:1.45 --- src/sys/kern/subr_prof.c:1.44 Sat Dec 12 17:48:54 2009 +++ src/sys/kern/subr_prof.c Thu Dec 17 01:25:10 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_prof.c,v 1.44 2009/12/12 17:48:54 dsl Exp $ */ +/* $NetBSD: subr_prof.c,v 1.45 2009/12/17 01:25:10 rmind Exp $ */ /*- * Copyright (c) 1982, 1986, 1993 @@ -32,13 +32,12 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: subr_prof.c,v 1.44 2009/12/12 17:48:54 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_prof.c,v 1.45 2009/12/17 01:25:10 rmind Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> #include <sys/proc.h> -#include <sys/user.h> #include <sys/mount.h> #include <sys/syscallargs.h> #include <sys/sysctl.h> Index: src/sys/kern/sys_process.c diff -u src/sys/kern/sys_process.c:1.152 src/sys/kern/sys_process.c:1.153 --- src/sys/kern/sys_process.c:1.152 Mon Dec 14 00:48:35 2009 +++ src/sys/kern/sys_process.c Thu Dec 17 01:25:10 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_process.c,v 1.152 2009/12/14 00:48:35 matt Exp $ */ +/* $NetBSD: sys_process.c,v 1.153 2009/12/17 01:25:10 rmind Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -118,7 +118,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.152 2009/12/14 00:48:35 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.153 2009/12/17 01:25:10 rmind Exp $"); #include "opt_ptrace.h" #include "opt_ktrace.h" @@ -129,7 +129,6 @@ #include <sys/errno.h> #include <sys/ptrace.h> #include <sys/uio.h> -#include <sys/user.h> #include <sys/ras.h> #include <sys/kmem.h> #include <sys/kauth.h> Index: src/sys/uvm/uvm_fault.c diff -u src/sys/uvm/uvm_fault.c:1.128 src/sys/uvm/uvm_fault.c:1.129 --- src/sys/uvm/uvm_fault.c:1.128 Sat Dec 5 22:34:43 2009 +++ src/sys/uvm/uvm_fault.c Thu Dec 17 01:25:10 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_fault.c,v 1.128 2009/12/05 22:34:43 pooka Exp $ */ +/* $NetBSD: uvm_fault.c,v 1.129 2009/12/17 01:25:10 rmind Exp $ */ /* * @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.128 2009/12/05 22:34:43 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.129 2009/12/17 01:25:10 rmind Exp $"); #include "opt_uvmhist.h" @@ -49,7 +49,6 @@ #include <sys/proc.h> #include <sys/malloc.h> #include <sys/mman.h> -#include <sys/user.h> #include <uvm/uvm.h> Index: src/sys/uvm/uvm_glue.c diff -u src/sys/uvm/uvm_glue.c:1.142 src/sys/uvm/uvm_glue.c:1.143 --- src/sys/uvm/uvm_glue.c:1.142 Sat Nov 21 17:45:02 2009 +++ src/sys/uvm/uvm_glue.c Thu Dec 17 01:25:11 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_glue.c,v 1.142 2009/11/21 17:45:02 rmind Exp $ */ +/* $NetBSD: uvm_glue.c,v 1.143 2009/12/17 01:25:11 rmind Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uvm_glue.c,v 1.142 2009/11/21 17:45:02 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_glue.c,v 1.143 2009/12/17 01:25:11 rmind Exp $"); #include "opt_kgdb.h" #include "opt_kstack.h" @@ -335,14 +335,14 @@ uvm_lwp_getuarea(lwp_t *l) { - return USER_TO_UAREA(l->l_addr); + return (vaddr_t)l->l_addr - UAREA_USER_OFFSET; } void uvm_lwp_setuarea(lwp_t *l, vaddr_t addr) { - l->l_addr = UAREA_TO_USER(addr); + l->l_addr = (void *)(addr + UAREA_USER_OFFSET); } /* @@ -376,10 +376,12 @@ void uvm_lwp_exit(struct lwp *l) { - vaddr_t va = USER_TO_UAREA(l->l_addr); + vaddr_t va = uvm_lwp_getuarea(l); uvm_uarea_free(va); - l->l_addr = NULL; +#ifdef DIAGNOSTIC + uvm_lwp_setuarea(l, (vaddr_t)NULL); +#endif } /*