From owner-p4-projects@FreeBSD.ORG Mon Mar 13 20:10:55 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1660E16A42D; Mon, 13 Mar 2006 20:10:55 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CDD0316A41F for ; Mon, 13 Mar 2006 20:10:51 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 36D9743D46 for ; Mon, 13 Mar 2006 20:10:51 +0000 (GMT) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k2DKApjM057237 for ; Mon, 13 Mar 2006 20:10:51 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k2DKAoZU057234 for perforce@freebsd.org; Mon, 13 Mar 2006 20:10:50 GMT (envelope-from kmacy@freebsd.org) Date: Mon, 13 Mar 2006 20:10:50 GMT Message-Id: <200603132010.k2DKAoZU057234@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 93257 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Mar 2006 20:10:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=93257 Change 93257 by kmacy@kmacy_storage:sun4v_work on 2006/03/13 20:10:25 switch trap over to not taking all data out of the trapframe Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/trap.c#7 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/trap.c#7 (text+ko) ==== @@ -92,12 +92,12 @@ #include #include -void trap(struct trapframe *tf); +void trap(struct trapframe *tf, int64_t type, uint64_t data); void syscall(struct trapframe *tf); vm_paddr_t mmu_fault_status_area; -static int trap_pfault(struct thread *td, struct trapframe *tf); +static int trap_pfault(struct thread *td, struct trapframe *tf, int64_t type, uint64_t data); extern char copy_fault[]; extern char copy_nofault_begin[]; @@ -246,7 +246,7 @@ } void -trap(struct trapframe *tf) +trap(struct trapframe *tf, int64_t type, uint64_t data) { struct thread *td; struct proc *p; @@ -257,7 +257,7 @@ td = PCPU_GET(curthread); CTR4(KTR_TRAP, "trap: %p type=%s (%s) pil=%#lx", td, - trap_msg[tf->tf_type & ~T_KERNEL], + trap_msg[type & ~T_KERNEL], (TRAPF_USERMODE(tf) ? "user" : "kernel"), rdpr(pil)); PCPU_LAZY_INC(cnt.v_trap); @@ -272,11 +272,11 @@ if (td->td_ucred != p->p_ucred) cred_update_thread(td); - switch (tf->tf_type) { + switch (type) { case T_DATA_MISS: case T_DATA_PROTECTION: case T_INSTRUCTION_MISS: - sig = trap_pfault(td, tf); + sig = trap_pfault(td, tf, type, data); break; case T_FILL: sig = rwindow_load(td, tf, 2); @@ -288,10 +288,10 @@ sig = rwindow_save(td); break; default: - if (tf->tf_type < 0 || tf->tf_type >= T_MAX || - trap_sig[tf->tf_type] == -1) + if (type < 0 || type >= T_MAX || + trap_sig[type] == -1) panic("trap: bad trap type"); - sig = trap_sig[tf->tf_type]; + sig = trap_sig[type]; break; } @@ -299,23 +299,23 @@ /* Translate fault for emulators. */ if (p->p_sysent->sv_transtrap != NULL) { sig = p->p_sysent->sv_transtrap(sig, - tf->tf_type); + type); } if (debugger_on_signal && (sig == 4 || sig == 10 || sig == 11)) kdb_enter("trapsig"); ksiginfo_init_trap(&ksi); ksi.ksi_signo = sig; - ksi.ksi_code = (int)tf->tf_type; /* XXX not POSIX */ + ksi.ksi_code = (int)type; /* XXX not POSIX */ /* ksi.ksi_addr = ? */ - ksi.ksi_trapno = (int)tf->tf_type; + ksi.ksi_trapno = (int)type; trapsignal(td, &ksi); } userret(td, tf); mtx_assert(&Giant, MA_NOTOWNED); } else { - KASSERT((tf->tf_type & T_KERNEL) != 0, + KASSERT((type & T_KERNEL) != 0, ("trap: kernel trap isn't")); #ifdef KDB @@ -325,18 +325,18 @@ } #endif - switch (tf->tf_type & ~T_KERNEL) { + switch (type & ~T_KERNEL) { #ifdef KDB case T_BREAKPOINT: case T_KSTACK_FAULT: - error = (kdb_trap(tf->tf_type, 0, tf) == 0); + error = (kdb_trap(type, 0, tf) == 0); TF_DONE(tf); break; #endif case T_DATA_MISS: case T_DATA_PROTECTION: case T_INSTRUCTION_MISS: - error = trap_pfault(td, tf); + error = trap_pfault(td, tf, type, data); break; case T_DATA_EXCEPTION: case T_MEM_ADDRESS_NOT_ALIGNED: @@ -371,13 +371,13 @@ } if (error != 0) - panic("trap: %s", trap_msg[tf->tf_type & ~T_KERNEL]); + panic("trap: %s", trap_msg[type & ~T_KERNEL]); } CTR1(KTR_TRAP, "trap: td=%p return", td); } static int -trap_pfault(struct thread *td, struct trapframe *tf) +trap_pfault(struct thread *td, struct trapframe *tf, int64_t type, uint64_t data) { struct vmspace *vm; struct pcb *pcb; @@ -386,7 +386,6 @@ vm_prot_t prot; u_long ctx; int flags; - int type; int rv; if (td == NULL) @@ -398,10 +397,10 @@ p = td->td_proc; rv = KERN_SUCCESS; - ctx = TLB_TAR_CTX(tf->tf_tar); + ctx = TLB_TAR_CTX(data); pcb = td->td_pcb; - type = tf->tf_type & ~T_KERNEL; - va = TLB_TAR_VA(tf->tf_tar); + type = type & ~T_KERNEL; + va = TLB_TAR_VA(data); CTR4(KTR_TRAP, "trap_pfault: td=%p pm_ctx=%#lx va=%#lx ctx=%#lx", td, p->p_vmspace->vm_pmap.pm_context[PCPU_GET(cpuid)], va, ctx);