2008-10-15 10:51:17 +04:00
|
|
|
/* $NetBSD: trap.c,v 1.49 2008/10/15 06:51:18 wrstuden Exp $ */
|
2001-06-13 10:01:44 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2001 Wasabi Systems, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed for the NetBSD Project by
|
|
|
|
* Wasabi Systems, Inc.
|
|
|
|
* 4. The name of Wasabi Systems, Inc. may not be used to endorse
|
|
|
|
* or promote products derived from this software without specific prior
|
|
|
|
* written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
|
|
|
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
|
|
|
* Copyright (C) 1995, 1996 TooLs GmbH.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by TooLs GmbH.
|
|
|
|
* 4. The name of TooLs GmbH may not be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
* IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
|
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
|
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2003-07-15 06:54:31 +04:00
|
|
|
#include <sys/cdefs.h>
|
2008-10-15 10:51:17 +04:00
|
|
|
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.49 2008/10/15 06:51:18 wrstuden Exp $");
|
2003-07-15 06:54:31 +04:00
|
|
|
|
2001-06-13 10:01:44 +04:00
|
|
|
#include "opt_altivec.h"
|
|
|
|
#include "opt_ddb.h"
|
2007-10-17 23:52:51 +04:00
|
|
|
#include "opt_kgdb.h"
|
2001-06-13 10:01:44 +04:00
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/proc.h>
|
|
|
|
#include <sys/reboot.h>
|
|
|
|
#include <sys/syscall.h>
|
|
|
|
#include <sys/systm.h>
|
|
|
|
#include <sys/user.h>
|
2003-01-18 09:23:28 +03:00
|
|
|
#include <sys/pool.h>
|
2008-10-15 10:51:17 +04:00
|
|
|
#include <sys/sa.h>
|
|
|
|
#include <sys/savar.h>
|
2003-10-31 19:44:34 +03:00
|
|
|
#include <sys/userret.h>
|
2006-05-15 13:21:21 +04:00
|
|
|
#include <sys/kauth.h>
|
2001-06-13 10:01:44 +04:00
|
|
|
|
2007-10-17 23:52:51 +04:00
|
|
|
#if defined(KGDB)
|
|
|
|
#include <sys/kgdb.h>
|
|
|
|
#endif
|
|
|
|
|
2001-06-13 10:01:44 +04:00
|
|
|
#include <uvm/uvm_extern.h>
|
|
|
|
|
|
|
|
#include <dev/cons.h>
|
|
|
|
|
|
|
|
#include <machine/cpu.h>
|
|
|
|
#include <machine/db_machdep.h>
|
|
|
|
#include <machine/fpu.h>
|
|
|
|
#include <machine/frame.h>
|
|
|
|
#include <machine/pcb.h>
|
|
|
|
#include <machine/psl.h>
|
|
|
|
#include <machine/trap.h>
|
|
|
|
|
|
|
|
#include <powerpc/spr.h>
|
|
|
|
#include <powerpc/ibm4xx/pmap.h>
|
|
|
|
#include <powerpc/ibm4xx/tlb.h>
|
|
|
|
#include <powerpc/fpu/fpu_extern.h>
|
|
|
|
|
|
|
|
/* These definitions should probably be somewhere else XXX */
|
|
|
|
#define FIRSTARG 3 /* first argument is in reg 3 */
|
|
|
|
#define NARGREG 8 /* 8 args are in registers */
|
2007-03-04 08:59:00 +03:00
|
|
|
#define MOREARGS(sp) ((void *)((int)(sp) + 8)) /* more args go here */
|
2001-06-13 10:01:44 +04:00
|
|
|
|
2003-01-18 09:23:28 +03:00
|
|
|
static int fix_unaligned __P((struct lwp *l, struct trapframe *frame));
|
2001-06-13 10:01:44 +04:00
|
|
|
|
|
|
|
void trap __P((struct trapframe *)); /* Called from locore / trap_subr */
|
|
|
|
/* Why are these not defined in a header? */
|
|
|
|
int badaddr __P((void *, size_t));
|
|
|
|
int badaddr_read __P((void *, size_t, int *));
|
|
|
|
int ctx_setup __P((int, int));
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
#define TDB_ALL 0x1
|
|
|
|
int trapdebug = /* TDB_ALL */ 0;
|
|
|
|
#define DBPRINTF(x, y) if (trapdebug & (x)) printf y
|
|
|
|
#else
|
|
|
|
#define DBPRINTF(x, y)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void
|
|
|
|
trap(struct trapframe *frame)
|
|
|
|
{
|
2003-01-18 09:23:28 +03:00
|
|
|
struct lwp *l = curlwp;
|
|
|
|
struct proc *p = l ? l->l_proc : NULL;
|
2001-06-13 10:01:44 +04:00
|
|
|
int type = frame->exc;
|
|
|
|
int ftype, rv;
|
2003-09-26 04:00:17 +04:00
|
|
|
ksiginfo_t ksi;
|
2001-06-13 10:01:44 +04:00
|
|
|
|
2003-01-18 09:23:28 +03:00
|
|
|
KASSERT(l == 0 || (l->l_stat == LSONPROC));
|
2001-06-13 10:01:44 +04:00
|
|
|
|
2006-07-20 01:11:37 +04:00
|
|
|
if (frame->srr1 & PSL_PR) {
|
|
|
|
LWP_CACHE_CREDS(l, p);
|
2001-06-13 10:01:44 +04:00
|
|
|
type |= EXC_USER;
|
2006-07-20 01:11:37 +04:00
|
|
|
}
|
2001-06-13 10:01:44 +04:00
|
|
|
|
|
|
|
ftype = VM_PROT_READ;
|
|
|
|
|
2003-06-28 18:32:02 +04:00
|
|
|
DBPRINTF(TDB_ALL, ("trap(%x) at %lx from frame %p &frame %p\n",
|
|
|
|
type, frame->srr0, frame, &frame));
|
2001-06-13 10:01:44 +04:00
|
|
|
|
|
|
|
switch (type) {
|
|
|
|
case EXC_DEBUG|EXC_USER:
|
2003-06-28 18:32:02 +04:00
|
|
|
{
|
|
|
|
int srr2, srr3;
|
|
|
|
|
2005-12-24 23:06:46 +03:00
|
|
|
__asm volatile("mfspr %0,0x3f0" :
|
2003-06-28 18:32:02 +04:00
|
|
|
"=r" (rv), "=r" (srr2), "=r" (srr3) :);
|
|
|
|
printf("debug reg is %x srr2 %x srr3 %x\n", rv, srr2,
|
|
|
|
srr3);
|
|
|
|
/* XXX fall through or break here?! */
|
|
|
|
}
|
2001-06-13 10:01:44 +04:00
|
|
|
/*
|
|
|
|
* DEBUG intr -- probably single-step.
|
|
|
|
*/
|
|
|
|
case EXC_TRC|EXC_USER:
|
|
|
|
frame->srr1 &= ~PSL_SE;
|
2003-10-08 04:28:40 +04:00
|
|
|
KSI_INIT_TRAP(&ksi);
|
2003-09-25 22:42:18 +04:00
|
|
|
ksi.ksi_signo = SIGTRAP;
|
|
|
|
ksi.ksi_trap = EXC_TRC;
|
|
|
|
ksi.ksi_addr = (void *)frame->srr0;
|
|
|
|
trapsignal(l, &ksi);
|
2001-06-13 10:01:44 +04:00
|
|
|
break;
|
2002-07-11 05:38:48 +04:00
|
|
|
|
2003-06-28 18:32:02 +04:00
|
|
|
/*
|
|
|
|
* If we could not find and install appropriate TLB entry, fall through.
|
|
|
|
*/
|
2002-07-11 05:38:48 +04:00
|
|
|
|
2001-06-13 10:01:44 +04:00
|
|
|
case EXC_DSI:
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
case EXC_DTMISS:
|
|
|
|
{
|
|
|
|
struct vm_map *map;
|
|
|
|
vaddr_t va;
|
2003-02-02 23:43:17 +03:00
|
|
|
struct faultbuf *fb = NULL;
|
2001-06-13 10:01:44 +04:00
|
|
|
|
2003-02-02 23:43:17 +03:00
|
|
|
va = frame->dar;
|
|
|
|
if (frame->tf_xtra[TF_PID] == KERNEL_PID) {
|
2001-06-13 10:01:44 +04:00
|
|
|
map = kernel_map;
|
|
|
|
} else {
|
|
|
|
map = &p->p_vmspace->vm_map;
|
2008-10-15 10:51:17 +04:00
|
|
|
if ((l->l_flag & LW_SA)
|
|
|
|
&& (~l->l_pflag & LP_SA_NOBLOCK)) {
|
|
|
|
l->l_savp->savp_faultaddr = va;
|
|
|
|
l->l_pflag |= LP_SA_PAGEFAULT;
|
|
|
|
}
|
2001-06-13 10:01:44 +04:00
|
|
|
}
|
|
|
|
|
2003-02-02 23:43:17 +03:00
|
|
|
if (frame->tf_xtra[TF_ESR] & (ESR_DST|ESR_DIZ))
|
2002-02-14 10:08:02 +03:00
|
|
|
ftype = VM_PROT_WRITE;
|
2001-06-13 10:01:44 +04:00
|
|
|
|
2003-06-28 18:32:02 +04:00
|
|
|
DBPRINTF(TDB_ALL,
|
|
|
|
("trap(EXC_DSI) at %lx %s fault on %p esr %x\n",
|
|
|
|
frame->srr0,
|
|
|
|
(ftype & VM_PROT_WRITE) ? "write" : "read",
|
|
|
|
(void *)va, frame->tf_xtra[TF_ESR]));
|
2006-03-15 21:12:02 +03:00
|
|
|
rv = uvm_fault(map, trunc_page(va), ftype);
|
2008-10-15 10:51:17 +04:00
|
|
|
if (map != kernel_map) {
|
|
|
|
l->l_pflag &= ~LP_SA_PAGEFAULT;
|
|
|
|
}
|
2001-06-13 10:01:44 +04:00
|
|
|
if (rv == 0)
|
|
|
|
goto done;
|
2003-01-18 09:23:28 +03:00
|
|
|
if ((fb = l->l_addr->u_pcb.pcb_onfault) != NULL) {
|
2003-02-02 23:43:17 +03:00
|
|
|
frame->tf_xtra[TF_PID] = KERNEL_PID;
|
|
|
|
frame->srr0 = fb->fb_pc;
|
2001-06-13 10:01:44 +04:00
|
|
|
frame->srr1 |= PSL_IR; /* Re-enable IMMU */
|
2003-02-02 23:43:17 +03:00
|
|
|
frame->fixreg[1] = fb->fb_sp;
|
|
|
|
frame->fixreg[2] = fb->fb_r2;
|
2001-06-13 10:01:44 +04:00
|
|
|
frame->fixreg[3] = 1; /* Return TRUE */
|
2003-02-02 23:43:17 +03:00
|
|
|
frame->cr = fb->fb_cr;
|
|
|
|
memcpy(&frame->fixreg[13], fb->fb_fixreg,
|
|
|
|
sizeof(fb->fb_fixreg));
|
2001-06-13 10:01:44 +04:00
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
goto brain_damage;
|
2002-07-11 05:38:48 +04:00
|
|
|
|
2001-06-13 10:01:44 +04:00
|
|
|
case EXC_DSI|EXC_USER:
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
case EXC_DTMISS|EXC_USER:
|
2003-02-02 23:43:17 +03:00
|
|
|
if (frame->tf_xtra[TF_ESR] & (ESR_DST|ESR_DIZ))
|
2002-02-14 10:08:02 +03:00
|
|
|
ftype = VM_PROT_WRITE;
|
2001-06-13 10:01:44 +04:00
|
|
|
|
2003-06-28 18:32:02 +04:00
|
|
|
DBPRINTF(TDB_ALL,
|
|
|
|
("trap(EXC_DSI|EXC_USER) at %lx %s fault on %lx %x\n",
|
|
|
|
frame->srr0, (ftype & VM_PROT_WRITE) ? "write" : "read",
|
|
|
|
frame->dar, frame->tf_xtra[TF_ESR]));
|
|
|
|
KASSERT(l == curlwp && (l->l_stat == LSONPROC));
|
2008-10-15 10:51:17 +04:00
|
|
|
if (l->l_flag & LW_SA) {
|
|
|
|
l->l_savp->savp_faultaddr = (vaddr_t)frame->dar;
|
|
|
|
l->l_pflag |= LP_SA_PAGEFAULT;
|
|
|
|
}
|
2003-06-28 18:32:02 +04:00
|
|
|
rv = uvm_fault(&p->p_vmspace->vm_map, trunc_page(frame->dar),
|
2006-03-15 21:12:02 +03:00
|
|
|
ftype);
|
2001-06-13 10:01:44 +04:00
|
|
|
if (rv == 0) {
|
2008-10-15 10:51:17 +04:00
|
|
|
l->l_pflag &= ~LP_SA_PAGEFAULT;
|
2003-06-28 18:32:02 +04:00
|
|
|
break;
|
2001-06-13 10:01:44 +04:00
|
|
|
}
|
2003-10-08 04:28:40 +04:00
|
|
|
KSI_INIT_TRAP(&ksi);
|
2003-09-25 22:42:18 +04:00
|
|
|
ksi.ksi_signo = SIGSEGV;
|
|
|
|
ksi.ksi_trap = EXC_DSI;
|
|
|
|
ksi.ksi_addr = (void *)frame->dar;
|
2001-06-13 10:01:44 +04:00
|
|
|
if (rv == ENOMEM) {
|
2003-01-18 09:23:28 +03:00
|
|
|
printf("UVM: pid %d (%s) lid %d, uid %d killed: "
|
2003-06-28 18:32:02 +04:00
|
|
|
"out of swap\n",
|
|
|
|
p->p_pid, p->p_comm, l->l_lid,
|
2006-07-24 02:06:03 +04:00
|
|
|
l->l_cred ?
|
|
|
|
kauth_cred_geteuid(l->l_cred) : -1);
|
2003-09-25 22:42:18 +04:00
|
|
|
ksi.ksi_signo = SIGKILL;
|
2001-06-13 10:01:44 +04:00
|
|
|
}
|
2003-09-25 22:42:18 +04:00
|
|
|
trapsignal(l, &ksi);
|
2008-10-15 10:51:17 +04:00
|
|
|
l->l_pflag &= ~LP_SA_PAGEFAULT;
|
2001-06-13 10:01:44 +04:00
|
|
|
break;
|
2003-08-24 21:52:28 +04:00
|
|
|
|
2001-06-13 10:01:44 +04:00
|
|
|
case EXC_ITMISS|EXC_USER:
|
|
|
|
case EXC_ISI|EXC_USER:
|
2008-10-15 10:51:17 +04:00
|
|
|
if (l->l_flag & LW_SA) {
|
|
|
|
l->l_savp->savp_faultaddr = (vaddr_t)frame->srr0;
|
|
|
|
l->l_pflag |= LP_SA_PAGEFAULT;
|
|
|
|
}
|
2003-08-24 21:52:28 +04:00
|
|
|
ftype = VM_PROT_EXECUTE;
|
2003-06-28 18:32:02 +04:00
|
|
|
DBPRINTF(TDB_ALL,
|
2003-08-24 21:52:28 +04:00
|
|
|
("trap(EXC_ISI|EXC_USER) at %lx execute fault tf %p\n",
|
2003-06-28 18:32:02 +04:00
|
|
|
frame->srr0, frame));
|
|
|
|
rv = uvm_fault(&p->p_vmspace->vm_map, trunc_page(frame->srr0),
|
2006-03-15 21:12:02 +03:00
|
|
|
ftype);
|
2001-06-13 10:01:44 +04:00
|
|
|
if (rv == 0) {
|
2008-10-15 10:51:17 +04:00
|
|
|
l->l_pflag &= ~LP_SA_PAGEFAULT;
|
2003-06-28 18:32:02 +04:00
|
|
|
break;
|
2001-06-13 10:01:44 +04:00
|
|
|
}
|
2003-10-08 04:28:40 +04:00
|
|
|
KSI_INIT_TRAP(&ksi);
|
2003-09-25 22:42:18 +04:00
|
|
|
ksi.ksi_signo = SIGSEGV;
|
|
|
|
ksi.ksi_trap = EXC_ISI;
|
|
|
|
ksi.ksi_addr = (void *)frame->srr0;
|
2004-02-24 21:31:46 +03:00
|
|
|
ksi.ksi_code = (rv == EACCES ? SEGV_ACCERR : SEGV_MAPERR);
|
2003-09-25 22:42:18 +04:00
|
|
|
trapsignal(l, &ksi);
|
2008-10-15 10:51:17 +04:00
|
|
|
l->l_pflag &= ~LP_SA_PAGEFAULT;
|
2001-06-13 10:01:44 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case EXC_AST|EXC_USER:
|
2003-02-02 23:43:17 +03:00
|
|
|
curcpu()->ci_astpending = 0; /* we are about to do it */
|
2001-06-13 10:01:44 +04:00
|
|
|
uvmexp.softs++;
|
2007-02-15 18:14:57 +03:00
|
|
|
if (l->l_pflag & LP_OWEUPC) {
|
|
|
|
l->l_pflag &= ~LP_OWEUPC;
|
|
|
|
ADDUPROF(l);
|
2001-06-13 10:01:44 +04:00
|
|
|
}
|
|
|
|
/* Check whether we are being preempted. */
|
2007-05-23 00:06:33 +04:00
|
|
|
if (curcpu()->ci_want_resched)
|
2007-02-10 00:55:00 +03:00
|
|
|
preempt();
|
2001-06-13 10:01:44 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case EXC_ALI|EXC_USER:
|
2003-09-25 22:42:18 +04:00
|
|
|
if (fix_unaligned(l, frame) != 0) {
|
2003-10-08 04:28:40 +04:00
|
|
|
KSI_INIT_TRAP(&ksi);
|
2003-09-25 22:42:18 +04:00
|
|
|
ksi.ksi_signo = SIGBUS;
|
|
|
|
ksi.ksi_trap = EXC_ALI;
|
|
|
|
ksi.ksi_addr = (void *)frame->dar;
|
|
|
|
trapsignal(l, &ksi);
|
|
|
|
} else
|
2001-06-13 10:01:44 +04:00
|
|
|
frame->srr0 += 4;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case EXC_PGM|EXC_USER:
|
2002-07-11 05:38:48 +04:00
|
|
|
/*
|
|
|
|
* Illegal insn:
|
2001-06-13 10:01:44 +04:00
|
|
|
*
|
2002-07-11 05:38:48 +04:00
|
|
|
* let's try to see if it's FPU and can be emulated.
|
2001-06-13 10:01:44 +04:00
|
|
|
*/
|
2005-01-19 14:41:07 +03:00
|
|
|
uvmexp.traps++;
|
2003-01-18 09:23:28 +03:00
|
|
|
if (!(l->l_addr->u_pcb.pcb_flags & PCB_FPU)) {
|
|
|
|
memset(&l->l_addr->u_pcb.pcb_fpu, 0,
|
|
|
|
sizeof l->l_addr->u_pcb.pcb_fpu);
|
|
|
|
l->l_addr->u_pcb.pcb_flags |= PCB_FPU;
|
2001-06-13 10:01:44 +04:00
|
|
|
}
|
|
|
|
|
2002-07-11 05:38:48 +04:00
|
|
|
if ((rv = fpu_emulate(frame,
|
2003-01-18 09:23:28 +03:00
|
|
|
(struct fpreg *)&l->l_addr->u_pcb.pcb_fpu))) {
|
2003-10-08 04:28:40 +04:00
|
|
|
KSI_INIT_TRAP(&ksi);
|
2003-09-25 22:42:18 +04:00
|
|
|
ksi.ksi_signo = rv;
|
|
|
|
ksi.ksi_trap = EXC_PGM;
|
|
|
|
ksi.ksi_addr = (void *)frame->srr0;
|
|
|
|
trapsignal(l, &ksi);
|
2001-06-13 10:01:44 +04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case EXC_MCHK:
|
|
|
|
{
|
2003-02-02 23:43:17 +03:00
|
|
|
struct faultbuf *fb;
|
2001-06-13 10:01:44 +04:00
|
|
|
|
2003-01-18 09:23:28 +03:00
|
|
|
if ((fb = l->l_addr->u_pcb.pcb_onfault) != NULL) {
|
2003-02-02 23:43:17 +03:00
|
|
|
frame->tf_xtra[TF_PID] = KERNEL_PID;
|
|
|
|
frame->srr0 = fb->fb_pc;
|
2001-06-13 10:01:44 +04:00
|
|
|
frame->srr1 |= PSL_IR; /* Re-enable IMMU */
|
2003-02-02 23:43:17 +03:00
|
|
|
frame->fixreg[1] = fb->fb_sp;
|
|
|
|
frame->fixreg[2] = fb->fb_r2;
|
2001-06-13 10:01:44 +04:00
|
|
|
frame->fixreg[3] = 1; /* Return TRUE */
|
2003-02-02 23:43:17 +03:00
|
|
|
frame->cr = fb->fb_cr;
|
|
|
|
memcpy(&frame->fixreg[13], fb->fb_fixreg,
|
|
|
|
sizeof(fb->fb_fixreg));
|
2001-06-13 10:01:44 +04:00
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
goto brain_damage;
|
|
|
|
default:
|
2003-06-28 18:32:02 +04:00
|
|
|
brain_damage:
|
2003-02-02 23:43:17 +03:00
|
|
|
printf("trap type 0x%x at 0x%lx\n", type, frame->srr0);
|
2007-10-17 23:52:51 +04:00
|
|
|
#if defined(DDB) || defined(KGDB)
|
2001-06-13 10:01:44 +04:00
|
|
|
if (kdb_trap(type, frame))
|
|
|
|
goto done;
|
|
|
|
#endif
|
|
|
|
#ifdef TRAP_PANICWAIT
|
|
|
|
printf("Press a key to panic.\n");
|
|
|
|
cngetc();
|
|
|
|
#endif
|
|
|
|
panic("trap");
|
|
|
|
}
|
|
|
|
|
2003-10-31 19:44:34 +03:00
|
|
|
/* Invoke MI userret code */
|
|
|
|
mi_userret(l);
|
2003-06-28 18:32:02 +04:00
|
|
|
done:
|
2002-11-25 08:11:32 +03:00
|
|
|
return;
|
2001-06-13 10:01:44 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
ctx_setup(int ctx, int srr1)
|
|
|
|
{
|
|
|
|
volatile struct pmap *pm;
|
|
|
|
|
|
|
|
/* Update PID if we're returning to user mode. */
|
|
|
|
if (srr1 & PSL_PR) {
|
|
|
|
pm = curproc->p_vmspace->vm_map.pmap;
|
|
|
|
if (!pm->pm_ctx) {
|
2005-06-03 15:54:48 +04:00
|
|
|
ctx_alloc(__UNVOLATILE(pm));
|
2001-06-13 10:01:44 +04:00
|
|
|
}
|
|
|
|
ctx = pm->pm_ctx;
|
|
|
|
if (srr1 & PSL_SE) {
|
|
|
|
int dbreg, mask = 0x48000000;
|
|
|
|
/*
|
|
|
|
* Set the Internal Debug and
|
|
|
|
* Instruction Completion bits of
|
|
|
|
* the DBCR0 register.
|
|
|
|
*
|
|
|
|
* XXX this is also used by jtag debuggers...
|
|
|
|
*/
|
2005-12-24 23:06:46 +03:00
|
|
|
__asm volatile("mfspr %0,0x3f2;"
|
2003-06-28 18:32:02 +04:00
|
|
|
"or %0,%0,%1;"
|
|
|
|
"mtspr 0x3f2,%0;" :
|
|
|
|
"=&r" (dbreg) : "r" (mask));
|
2001-06-13 10:01:44 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!ctx) {
|
|
|
|
ctx = KERNEL_PID;
|
|
|
|
}
|
|
|
|
return (ctx);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Used by copyin()/copyout()
|
|
|
|
*/
|
|
|
|
extern vaddr_t vmaprange __P((struct proc *, vaddr_t, vsize_t, int));
|
|
|
|
extern void vunmaprange __P((vaddr_t, vsize_t));
|
2003-06-28 18:32:02 +04:00
|
|
|
static int bigcopyin __P((const void *, void *, size_t ));
|
2001-06-13 10:01:44 +04:00
|
|
|
static int bigcopyout __P((const void *, void *, size_t ));
|
|
|
|
|
|
|
|
int
|
|
|
|
copyin(const void *udaddr, void *kaddr, size_t len)
|
|
|
|
{
|
|
|
|
struct pmap *pm = curproc->p_vmspace->vm_map.pmap;
|
2007-11-22 16:33:08 +03:00
|
|
|
int msr, pid, tmp, ctx, count=0;
|
2003-02-02 23:43:17 +03:00
|
|
|
struct faultbuf env;
|
2001-06-13 10:01:44 +04:00
|
|
|
|
|
|
|
/* For bigger buffers use the faster copy */
|
2007-11-22 16:33:08 +03:00
|
|
|
if (len > 1024)
|
2005-02-25 10:09:58 +03:00
|
|
|
return (bigcopyin(udaddr, kaddr, len));
|
2001-06-13 10:01:44 +04:00
|
|
|
|
2003-02-02 23:43:17 +03:00
|
|
|
if (setfault(&env)) {
|
2001-06-13 10:01:44 +04:00
|
|
|
curpcb->pcb_onfault = 0;
|
|
|
|
return EFAULT;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!(ctx = pm->pm_ctx)) {
|
|
|
|
/* No context -- assign it one */
|
|
|
|
ctx_alloc(pm);
|
|
|
|
ctx = pm->pm_ctx;
|
|
|
|
}
|
|
|
|
|
2007-11-22 16:33:08 +03:00
|
|
|
__asm volatile(
|
|
|
|
" mfmsr %[msr];" /* Save MSR */
|
|
|
|
" li %[pid],0x20; "
|
|
|
|
" andc %[pid],%[msr],%[pid]; mtmsr %[pid];" /* Disable IMMU */
|
|
|
|
" mfpid %[pid];" /* Save old PID */
|
|
|
|
" sync; isync;"
|
|
|
|
|
|
|
|
" srwi. %[count],%[len],0x2;" /* How many words? */
|
|
|
|
" beq- 2f;" /* No words. Go do bytes */
|
|
|
|
" mtctr %[count];"
|
|
|
|
"1: mtpid %[ctx]; sync;"
|
2007-11-28 15:22:28 +03:00
|
|
|
" lswi %[tmp],%[udaddr],4;" /* Load user word */
|
2007-11-22 16:33:08 +03:00
|
|
|
" addi %[udaddr],%[udaddr],0x4;" /* next udaddr word */
|
|
|
|
" sync; isync;"
|
|
|
|
" mtpid %[pid];sync;"
|
2007-11-28 15:22:28 +03:00
|
|
|
" stswi %[tmp],%[kaddr],4;" /* Store kernel word */
|
2007-11-22 16:33:08 +03:00
|
|
|
" dcbf 0,%[kaddr];" /* flush cache */
|
|
|
|
" addi %[kaddr],%[kaddr],0x4;" /* next udaddr word */
|
|
|
|
" sync; isync;"
|
|
|
|
" bdnz 1b;" /* repeat */
|
|
|
|
|
|
|
|
"2: andi. %[count],%[len],0x3;" /* How many remaining bytes? */
|
|
|
|
" addi %[count],%[count],0x1;"
|
|
|
|
" mtctr %[count];"
|
|
|
|
"3: bdz 10f;" /* while count */
|
|
|
|
" mtpid %[ctx];sync;"
|
|
|
|
" lbz %[tmp],0(%[udaddr]);" /* Load user byte */
|
|
|
|
" addi %[udaddr],%[udaddr],0x1;" /* next udaddr byte */
|
|
|
|
" sync; isync;"
|
|
|
|
" mtpid %[pid]; sync;"
|
|
|
|
" stb %[tmp],0(%[kaddr]);" /* Store kernel byte */
|
|
|
|
" dcbf 0,%[kaddr];" /* flush cache */
|
|
|
|
" addi %[kaddr],%[kaddr],0x1;"
|
|
|
|
" sync; isync;"
|
|
|
|
" b 3b;"
|
|
|
|
"10:mtpid %[pid]; mtmsr %[msr]; sync; isync;" /* Restore PID and MSR */
|
|
|
|
: [msr] "=&r" (msr), [pid] "=&r" (pid), [tmp] "=&r" (tmp)
|
|
|
|
: [udaddr] "b" (udaddr), [ctx] "b" (ctx), [kaddr] "b" (kaddr), [len] "b" (len), [count] "b" (count));
|
2001-06-13 10:01:44 +04:00
|
|
|
|
|
|
|
curpcb->pcb_onfault = 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
bigcopyin(const void *udaddr, void *kaddr, size_t len)
|
|
|
|
{
|
|
|
|
const char *up;
|
|
|
|
char *kp = kaddr;
|
2003-01-18 09:23:28 +03:00
|
|
|
struct lwp *l = curlwp;
|
|
|
|
struct proc *p;
|
2001-06-13 10:01:44 +04:00
|
|
|
int error;
|
|
|
|
|
2003-01-18 09:23:28 +03:00
|
|
|
if (!l) {
|
2001-06-13 10:01:44 +04:00
|
|
|
return EFAULT;
|
|
|
|
}
|
|
|
|
|
2003-01-18 09:23:28 +03:00
|
|
|
p = l->l_proc;
|
|
|
|
|
2001-06-13 10:01:44 +04:00
|
|
|
/*
|
2002-07-11 05:38:48 +04:00
|
|
|
* Stolen from physio():
|
2001-06-13 10:01:44 +04:00
|
|
|
*/
|
2007-07-10 00:51:58 +04:00
|
|
|
uvm_lwp_hold(l);
|
2006-10-05 18:48:32 +04:00
|
|
|
error = uvm_vslock(p->p_vmspace, __UNCONST(udaddr), len, VM_PROT_READ);
|
2001-06-13 10:01:44 +04:00
|
|
|
if (error) {
|
2007-07-10 00:51:58 +04:00
|
|
|
uvm_lwp_rele(l);
|
2001-06-13 10:01:44 +04:00
|
|
|
return EFAULT;
|
|
|
|
}
|
|
|
|
up = (char *)vmaprange(p, (vaddr_t)udaddr, len, VM_PROT_READ);
|
|
|
|
|
2001-07-22 15:29:44 +04:00
|
|
|
memcpy(kp, up, len);
|
2001-06-13 10:01:44 +04:00
|
|
|
vunmaprange((vaddr_t)up, len);
|
2006-10-05 18:48:32 +04:00
|
|
|
uvm_vsunlock(p->p_vmspace, __UNCONST(udaddr), len);
|
2007-07-10 00:51:58 +04:00
|
|
|
uvm_lwp_rele(l);
|
2001-06-13 10:01:44 +04:00
|
|
|
|
2002-07-11 05:38:48 +04:00
|
|
|
return 0;
|
2001-06-13 10:01:44 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
copyout(const void *kaddr, void *udaddr, size_t len)
|
|
|
|
{
|
|
|
|
struct pmap *pm = curproc->p_vmspace->vm_map.pmap;
|
2007-11-22 16:33:08 +03:00
|
|
|
int msr, pid, tmp, ctx, count=0;
|
2003-02-02 23:43:17 +03:00
|
|
|
struct faultbuf env;
|
2001-06-13 10:01:44 +04:00
|
|
|
|
|
|
|
/* For big copies use more efficient routine */
|
2007-11-22 16:33:08 +03:00
|
|
|
if (len > 1024)
|
2005-02-25 10:09:58 +03:00
|
|
|
return (bigcopyout(kaddr, udaddr, len));
|
2001-06-13 10:01:44 +04:00
|
|
|
|
2003-02-02 23:43:17 +03:00
|
|
|
if (setfault(&env)) {
|
2001-06-13 10:01:44 +04:00
|
|
|
curpcb->pcb_onfault = 0;
|
|
|
|
return EFAULT;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!(ctx = pm->pm_ctx)) {
|
|
|
|
/* No context -- assign it one */
|
|
|
|
ctx_alloc(pm);
|
|
|
|
ctx = pm->pm_ctx;
|
|
|
|
}
|
|
|
|
|
2007-11-22 16:33:08 +03:00
|
|
|
__asm volatile(
|
|
|
|
" mfmsr %[msr];" /* Save MSR */ \
|
|
|
|
" li %[pid],0x20; " \
|
|
|
|
" andc %[pid],%[msr],%[pid]; mtmsr %[pid];" /* Disable IMMU */ \
|
|
|
|
" mfpid %[pid];" /* Save old PID */ \
|
|
|
|
" sync; isync;"
|
|
|
|
|
|
|
|
" srwi. %[count],%[len],0x2;" /* How many words? */
|
|
|
|
" beq- 2f;" /* No words. Go do bytes */
|
|
|
|
" mtctr %[count];"
|
|
|
|
"1: mtpid %[pid];sync;"
|
2007-11-28 15:22:28 +03:00
|
|
|
" lswi %[tmp],%[kaddr],4;" /* Load kernel word */
|
2007-11-22 16:33:08 +03:00
|
|
|
" addi %[kaddr],%[kaddr],0x4;" /* next kaddr word */
|
|
|
|
" sync; isync;"
|
|
|
|
" mtpid %[ctx]; sync;"
|
2007-11-28 15:22:28 +03:00
|
|
|
" stswi %[tmp],%[udaddr],4;" /* Store user word */
|
2007-11-22 16:33:08 +03:00
|
|
|
" dcbf 0,%[udaddr];" /* flush cache */
|
|
|
|
" addi %[udaddr],%[udaddr],0x4;" /* next udaddr word */
|
|
|
|
" sync; isync;"
|
|
|
|
" bdnz 1b;" /* repeat */
|
|
|
|
|
|
|
|
"2: andi. %[count],%[len],0x3;" /* How many remaining bytes? */
|
|
|
|
" addi %[count],%[count],0x1;"
|
|
|
|
" mtctr %[count];"
|
|
|
|
"3: bdz 10f;" /* while count */
|
|
|
|
" mtpid %[pid];sync;"
|
|
|
|
" lbz %[tmp],0(%[kaddr]);" /* Load kernel byte */
|
|
|
|
" addi %[kaddr],%[kaddr],0x1;" /* next kaddr byte */
|
|
|
|
" sync; isync;"
|
|
|
|
" mtpid %[ctx]; sync;"
|
|
|
|
" stb %[tmp],0(%[udaddr]);" /* Store user byte */
|
|
|
|
" dcbf 0,%[udaddr];" /* flush cache */
|
|
|
|
" addi %[udaddr],%[udaddr],0x1;"
|
|
|
|
" sync; isync;"
|
|
|
|
" b 3b;"
|
|
|
|
"10:mtpid %[pid]; mtmsr %[msr]; sync; isync;" /* Restore PID and MSR */
|
|
|
|
: [msr] "=&r" (msr), [pid] "=&r" (pid), [tmp] "=&r" (tmp)
|
|
|
|
: [udaddr] "b" (udaddr), [ctx] "b" (ctx), [kaddr] "b" (kaddr), [len] "b" (len), [count] "b" (count));
|
2001-06-13 10:01:44 +04:00
|
|
|
|
|
|
|
curpcb->pcb_onfault = 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
bigcopyout(const void *kaddr, void *udaddr, size_t len)
|
|
|
|
{
|
|
|
|
char *up;
|
2005-06-03 15:54:48 +04:00
|
|
|
const char *kp = (const char *)kaddr;
|
2003-01-18 09:23:28 +03:00
|
|
|
struct lwp *l = curlwp;
|
|
|
|
struct proc *p;
|
2001-06-13 10:01:44 +04:00
|
|
|
int error;
|
|
|
|
|
2003-01-18 09:23:28 +03:00
|
|
|
if (!l) {
|
2001-06-13 10:01:44 +04:00
|
|
|
return EFAULT;
|
|
|
|
}
|
|
|
|
|
2003-01-18 09:23:28 +03:00
|
|
|
p = l->l_proc;
|
|
|
|
|
2001-06-13 10:01:44 +04:00
|
|
|
/*
|
2002-07-11 05:38:48 +04:00
|
|
|
* Stolen from physio():
|
2001-06-13 10:01:44 +04:00
|
|
|
*/
|
2007-07-10 00:51:58 +04:00
|
|
|
uvm_lwp_hold(l);
|
2006-10-05 18:48:32 +04:00
|
|
|
error = uvm_vslock(p->p_vmspace, udaddr, len, VM_PROT_WRITE);
|
2001-06-13 10:01:44 +04:00
|
|
|
if (error) {
|
2007-07-10 00:51:58 +04:00
|
|
|
uvm_lwp_rele(l);
|
2001-06-13 10:01:44 +04:00
|
|
|
return EFAULT;
|
|
|
|
}
|
2002-07-11 05:38:48 +04:00
|
|
|
up = (char *)vmaprange(p, (vaddr_t)udaddr, len,
|
2003-06-28 18:32:02 +04:00
|
|
|
VM_PROT_READ | VM_PROT_WRITE);
|
2001-06-13 10:01:44 +04:00
|
|
|
|
2001-07-22 15:29:44 +04:00
|
|
|
memcpy(up, kp, len);
|
2001-06-13 10:01:44 +04:00
|
|
|
vunmaprange((vaddr_t)up, len);
|
2006-10-05 18:48:32 +04:00
|
|
|
uvm_vsunlock(p->p_vmspace, udaddr, len);
|
2007-07-10 00:51:58 +04:00
|
|
|
uvm_lwp_rele(l);
|
2001-06-13 10:01:44 +04:00
|
|
|
|
2002-07-11 05:38:48 +04:00
|
|
|
return 0;
|
2001-06-13 10:01:44 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* kcopy(const void *src, void *dst, size_t len);
|
|
|
|
*
|
|
|
|
* Copy len bytes from src to dst, aborting if we encounter a fatal
|
|
|
|
* page fault.
|
|
|
|
*
|
|
|
|
* kcopy() _must_ save and restore the old fault handler since it is
|
|
|
|
* called by uiomove(), which may be in the path of servicing a non-fatal
|
|
|
|
* page fault.
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
kcopy(const void *src, void *dst, size_t len)
|
|
|
|
{
|
2003-02-02 23:43:17 +03:00
|
|
|
struct faultbuf env, *oldfault;
|
2001-06-13 10:01:44 +04:00
|
|
|
|
|
|
|
oldfault = curpcb->pcb_onfault;
|
2003-02-02 23:43:17 +03:00
|
|
|
if (setfault(&env)) {
|
2001-06-13 10:01:44 +04:00
|
|
|
curpcb->pcb_onfault = oldfault;
|
|
|
|
return EFAULT;
|
|
|
|
}
|
|
|
|
|
2001-07-22 15:29:44 +04:00
|
|
|
memcpy(dst, src, len);
|
2001-06-13 10:01:44 +04:00
|
|
|
|
|
|
|
curpcb->pcb_onfault = oldfault;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
badaddr(void *addr, size_t size)
|
|
|
|
{
|
|
|
|
|
|
|
|
return badaddr_read(addr, size, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
badaddr_read(void *addr, size_t size, int *rptr)
|
|
|
|
{
|
2003-02-02 23:43:17 +03:00
|
|
|
struct faultbuf env;
|
2001-06-13 10:01:44 +04:00
|
|
|
int x;
|
|
|
|
|
|
|
|
/* Get rid of any stale machine checks that have been waiting. */
|
2005-12-24 23:06:46 +03:00
|
|
|
__asm volatile ("sync; isync");
|
2001-06-13 10:01:44 +04:00
|
|
|
|
2003-02-02 23:43:17 +03:00
|
|
|
if (setfault(&env)) {
|
2001-06-13 10:01:44 +04:00
|
|
|
curpcb->pcb_onfault = 0;
|
2005-12-24 23:06:46 +03:00
|
|
|
__asm volatile ("sync");
|
2001-06-13 10:01:44 +04:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2005-12-24 23:06:46 +03:00
|
|
|
__asm volatile ("sync");
|
2001-06-13 10:01:44 +04:00
|
|
|
|
|
|
|
switch (size) {
|
|
|
|
case 1:
|
|
|
|
x = *(volatile int8_t *)addr;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
x = *(volatile int16_t *)addr;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
x = *(volatile int32_t *)addr;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
panic("badaddr: invalid size (%d)", size);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Make sure we took the machine check, if we caused one. */
|
2005-12-24 23:06:46 +03:00
|
|
|
__asm volatile ("sync; isync");
|
2001-06-13 10:01:44 +04:00
|
|
|
|
|
|
|
curpcb->pcb_onfault = 0;
|
2005-12-24 23:06:46 +03:00
|
|
|
__asm volatile ("sync"); /* To be sure. */
|
2001-06-13 10:01:44 +04:00
|
|
|
|
|
|
|
/* Use the value to avoid reorder. */
|
|
|
|
if (rptr)
|
|
|
|
*rptr = x;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* For now, this only deals with the particular unaligned access case
|
|
|
|
* that gcc tends to generate. Eventually it should handle all of the
|
|
|
|
* possibilities that can happen on a 32-bit PowerPC in big-endian mode.
|
|
|
|
*/
|
|
|
|
|
|
|
|
static int
|
2003-01-18 09:23:28 +03:00
|
|
|
fix_unaligned(struct lwp *l, struct trapframe *frame)
|
2001-06-13 10:01:44 +04:00
|
|
|
{
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
2003-01-18 09:23:28 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Start a new LWP
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
startlwp(arg)
|
|
|
|
void *arg;
|
|
|
|
{
|
|
|
|
int err;
|
|
|
|
ucontext_t *uc = arg;
|
|
|
|
struct lwp *l = curlwp;
|
|
|
|
|
|
|
|
err = cpu_setmcontext(l, &uc->uc_mcontext, uc->uc_flags);
|
|
|
|
#if DIAGNOSTIC
|
|
|
|
if (err) {
|
|
|
|
printf("Error %d from cpu_setmcontext.", err);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
pool_put(&lwp_uc_pool, uc);
|
|
|
|
|
2008-10-15 10:51:17 +04:00
|
|
|
upcallret(l);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XXX This is a terrible name.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
upcallret(l)
|
|
|
|
struct lwp *l;
|
|
|
|
{
|
|
|
|
|
2003-10-31 19:44:34 +03:00
|
|
|
/* Invoke MI userret code */
|
|
|
|
mi_userret(l);
|
2003-01-18 09:23:28 +03:00
|
|
|
}
|