From owner-svn-src-stable@FreeBSD.ORG Sun Mar 22 21:31:03 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47549106566C; Sun, 22 Mar 2009 21:31:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3375F8FC12; Sun, 22 Mar 2009 21:31:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2MLV3GQ084415; Sun, 22 Mar 2009 21:31:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MLV2Ka084411; Sun, 22 Mar 2009 21:31:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903222131.n2MLV2Ka084411@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 21:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190289 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/include sparc64/sparc64 sun4v/include sun4v/sun4v X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 21:31:04 -0000 Author: marius Date: Sun Mar 22 21:31:02 2009 New Revision: 190289 URL: http://svn.freebsd.org/changeset/base/190289 Log: MFC: 190107 (partial) - There's no need to wrap kdb_active and kdb_trap() in #ifdef KDB as they're always available. - Remove unused variable. [1] - Add a missing const. - Sort includes. Submitted by: Christoph Mallon [1] Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/include/trap.h stable/7/sys/sparc64/sparc64/trap.c stable/7/sys/sun4v/include/trap.h stable/7/sys/sun4v/sun4v/trap.c Modified: stable/7/sys/sparc64/include/trap.h ============================================================================== --- stable/7/sys/sparc64/include/trap.h Sun Mar 22 21:17:20 2009 (r190288) +++ stable/7/sys/sparc64/include/trap.h Sun Mar 22 21:31:02 2009 (r190289) @@ -91,7 +91,7 @@ #ifndef LOCORE void sun4u_set_traptable(void *tba_addr); -extern const char *trap_msg[]; +extern const char *const trap_msg[]; #endif #endif Modified: stable/7/sys/sparc64/sparc64/trap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/trap.c Sun Mar 22 21:17:20 2009 (r190288) +++ stable/7/sys/sparc64/sparc64/trap.c Sun Mar 22 21:31:02 2009 (r190289) @@ -83,7 +83,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -113,7 +112,7 @@ extern char fas_nofault_end[]; extern char *syscallnames[]; -const char *trap_msg[] = { +const char *const trap_msg[] = { "reserved", "instruction access exception", "instruction access error", @@ -328,15 +327,12 @@ trap(struct trapframe *tf) KASSERT((tf->tf_type & T_KERNEL) != 0, ("trap: kernel trap isn't")); -#ifdef KDB if (kdb_active) { kdb_reenter(); return; } -#endif switch (tf->tf_type & ~T_KERNEL) { -#ifdef KDB case T_BREAKPOINT: case T_KSTACK_FAULT: error = (kdb_trap(tf->tf_type, 0, tf) == 0); @@ -348,7 +344,6 @@ trap(struct trapframe *tf) error = db_watch_trap(tf); break; #endif -#endif case T_DATA_MISS: case T_DATA_PROTECTION: case T_INSTRUCTION_MISS: @@ -408,7 +403,6 @@ static int trap_pfault(struct thread *td, struct trapframe *tf) { struct vmspace *vm; - struct pcb *pcb; struct proc *p; vm_offset_t va; vm_prot_t prot; @@ -428,7 +422,6 @@ trap_pfault(struct thread *td, struct tr rv = KERN_SUCCESS; ctx = TLB_TAR_CTX(tf->tf_tar); - pcb = td->td_pcb; type = tf->tf_type & ~T_KERNEL; va = TLB_TAR_VA(tf->tf_tar); @@ -558,11 +551,6 @@ syscall(struct trapframe *tf) PCPU_INC(cnt.v_syscall); - narg = 0; - error = 0; - reg = 0; - regcnt = REG_MAXARGS; - td->td_pticks = 0; td->td_frame = tf; if (td->td_ucred != p->p_ucred) @@ -580,6 +568,8 @@ syscall(struct trapframe *tf) tpc = tf->tf_tpc; TF_DONE(tf); + reg = 0; + regcnt = REG_MAXARGS; if (p->p_sysent->sv_prepsyscall) { /* * The prep code is MP aware. Modified: stable/7/sys/sun4v/include/trap.h ============================================================================== --- stable/7/sys/sun4v/include/trap.h Sun Mar 22 21:17:20 2009 (r190288) +++ stable/7/sys/sun4v/include/trap.h Sun Mar 22 21:31:02 2009 (r190289) @@ -144,7 +144,7 @@ #ifndef LOCORE -extern const char *trap_msg[]; +extern const char *const trap_msg[]; extern void set_mmfsa_traptable(void *, uint64_t); extern void trap_init(void); #endif Modified: stable/7/sys/sun4v/sun4v/trap.c ============================================================================== --- stable/7/sys/sun4v/sun4v/trap.c Sun Mar 22 21:17:20 2009 (r190288) +++ stable/7/sys/sun4v/sun4v/trap.c Sun Mar 22 21:31:02 2009 (r190289) @@ -81,7 +81,6 @@ #include #include #include -#include #include #include #include @@ -119,7 +118,7 @@ extern char fas_nofault_end[]; extern char *syscallnames[]; -const char *trap_msg[] = { +const char *const trap_msg[] = { "reserved", "instruction access exception", "instruction access error", @@ -390,21 +389,17 @@ trap(struct trapframe *tf, int64_t type, ("trap: kernel trap isn't - trap: %ld:%s: 0x%lx at 0x%lx on cpu=%d\n", trapno, trap_msg[trapno], data, tf->tf_tpc, curcpu)); -#ifdef KDB if (kdb_active) { kdb_reenter(); return; } -#endif switch (trapno) { -#ifdef KDB case T_BREAKPOINT: case T_KSTACK_FAULT: error = (kdb_trap(trapno, 0, tf) == 0); TF_DONE(tf); break; -#endif case T_DATA_MISS: case T_DATA_PROTECTION: case T_INSTRUCTION_MISS: @@ -460,7 +455,6 @@ static int trap_pfault(struct thread *td, struct trapframe *tf, int64_t type, uint64_t data) { struct vmspace *vm; - struct pcb *pcb; struct proc *p; vm_offset_t va; vm_prot_t prot; @@ -475,7 +469,6 @@ trap_pfault(struct thread *td, struct tr rv = KERN_SUCCESS; ctx = TLB_TAR_CTX(data); - pcb = td->td_pcb; type = type & ~T_KERNEL; va = TLB_TAR_VA(data); @@ -603,11 +596,6 @@ syscall(struct trapframe *tf) PCPU_INC(cnt.v_syscall); - narg = 0; - error = 0; - reg = 0; - regcnt = REG_MAXARGS; - td->td_pticks = 0; td->td_frame = tf; if (td->td_ucred != p->p_ucred) @@ -621,6 +609,8 @@ syscall(struct trapframe *tf) tpc = tf->tf_tpc; TF_DONE(tf); + reg = 0; + regcnt = REG_MAXARGS; if (p->p_sysent->sv_prepsyscall) { /* * The prep code is MP aware.