summaryrefslogtreecommitdiff
path: root/sys/arch/sgi
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-10-24 15:40:04 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-10-24 15:40:04 +0000
commit555d994b2495e1f479b843b362be40d8e4b093c5 (patch)
tree204f4e0d713f95b594d48589a872ba10615b41fc /sys/arch/sgi
parent45a1c7c63149bd25222da561e7da3774e32cde02 (diff)
Move build_trampoline() and setregs() to a common location for all mips ports.
Diffstat (limited to 'sys/arch/sgi')
-rw-r--r--sys/arch/sgi/sgi/machdep.c106
1 files changed, 1 insertions, 105 deletions
diff --git a/sys/arch/sgi/sgi/machdep.c b/sys/arch/sgi/sgi/machdep.c
index fa527d52225..9f3617212fa 100644
--- a/sys/arch/sgi/sgi/machdep.c
+++ b/sys/arch/sgi/sgi/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.105 2010/06/27 13:28:46 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.106 2010/10/24 15:40:03 miod Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -138,7 +138,6 @@ void dumpconf(void);
static void dobootopts(int, void *);
void arcbios_halt(int);
-void build_trampoline(vaddr_t, vaddr_t);
boolean_t is_memory_range(paddr_t, psize_t, psize_t);
void (*md_halt)(int) = arcbios_halt;
@@ -525,73 +524,6 @@ mips_init(int argc, void *argv, caddr_t boot_esym)
}
/*
- * Build a tlb trampoline
- */
-void
-build_trampoline(vaddr_t addr, vaddr_t dest)
-{
- const uint32_t insns[] = {
- 0x3c1a0000, /* lui k0, imm16 */
- 0x675a0000, /* daddiu k0, k0, imm16 */
- 0x001ad438, /* dsll k0, k0, 0x10 */
- 0x675a0000, /* daddiu k0, k0, imm16 */
- 0x001ad438, /* dsll k0, k0, 0x10 */
- 0x675a0000, /* daddiu k0, k0, imm16 */
- 0x03400008, /* jr k0 */
- 0x00000000 /* nop */
- };
- uint32_t *dst = (uint32_t *)addr;
- const uint32_t *src = insns;
- uint32_t a, b, c, d;
-
- /*
- * Decompose the handler address in the four components which,
- * added with sign extension, will produce the correct address.
- */
- d = dest & 0xffff;
- dest >>= 16;
- if (d & 0x8000)
- dest++;
- c = dest & 0xffff;
- dest >>= 16;
- if (c & 0x8000)
- dest++;
- b = dest & 0xffff;
- dest >>= 16;
- if (b & 0x8000)
- dest++;
- a = dest & 0xffff;
-
- /*
- * Build the trampoline, skipping noop computations.
- */
- *dst++ = *src++ | a;
- if (b != 0)
- *dst++ = *src++ | b;
- else
- src++;
- *dst++ = *src++;
- if (c != 0)
- *dst++ = *src++ | c;
- else
- src++;
- *dst++ = *src++;
- if (d != 0)
- *dst++ = *src++ | d;
- else
- src++;
- *dst++ = *src++;
- *dst++ = *src++;
-
- /*
- * Note that we keep the delay slot instruction a nop, instead
- * of branching to the second instruction of the handler and
- * having its first instruction in the delay slot, so that the
- * tlb handler is free to use k0 immediately.
- */
-}
-
-/*
* Decode boot options.
*/
static void
@@ -750,42 +682,6 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
}
}
-/*
- * Set registers on exec for native exec format. For o64/64.
- */
-void
-setregs(p, pack, stack, retval)
- struct proc *p;
- struct exec_package *pack;
- u_long stack;
- register_t *retval;
-{
- struct cpu_info *ci = curcpu();
-
- bzero((caddr_t)p->p_md.md_regs, sizeof(struct trap_frame));
- p->p_md.md_regs->sp = stack;
- p->p_md.md_regs->pc = pack->ep_entry & ~3;
- p->p_md.md_regs->t9 = pack->ep_entry & ~3; /* abicall req */
- p->p_md.md_regs->sr = SR_FR_32 | SR_XX | SR_KSU_USER | SR_KX | SR_UX |
- SR_EXL | SR_INT_ENAB;
-#if defined(CPU_R10000) && !defined(TGT_COHERENT)
- if (ci->ci_hw.type == MIPS_R12000)
- p->p_md.md_regs->sr |= SR_DSD;
-#endif
- p->p_md.md_regs->sr |= idle_mask & SR_INT_MASK;
- p->p_md.md_regs->ic = (idle_mask << 8) & IC_INT_MASK;
- p->p_md.md_flags &= ~MDP_FPUSED;
- if (ci->ci_fpuproc == p)
- ci->ci_fpuproc = (struct proc *)0;
- p->p_md.md_ss_addr = 0;
- p->p_md.md_pc_ctrl = 0;
- p->p_md.md_watch_1 = 0;
- p->p_md.md_watch_2 = 0;
-
- retval[1] = 0;
-}
-
-
int waittime = -1;
void