diff options
Diffstat (limited to 'sys/ia64/ia64/machdep.c')
-rw-r--r-- | sys/ia64/ia64/machdep.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index cddf6c0b8f96..c13adc3181b6 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -80,7 +80,6 @@ __FBSDID("$FreeBSD$"); #include <vm/vm_pager.h> #include <machine/bootinfo.h> -#include <machine/clock.h> #include <machine/cpu.h> #include <machine/efi.h> #include <machine/elf.h> @@ -100,8 +99,6 @@ __FBSDID("$FreeBSD$"); #include <machine/unwind.h> #include <machine/vmparam.h> -#include <i386/include/specialreg.h> - SYSCTL_NODE(_hw, OID_AUTO, freq, CTLFLAG_RD, 0, ""); SYSCTL_NODE(_machdep, OID_AUTO, cpu, CTLFLAG_RD, 0, ""); @@ -374,7 +371,7 @@ cpu_startup(void *dummy) SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, "nstrays", CTLFLAG_RD, &pcs->pcs_nstrays, - "Number of stray vectors"); + "Number of stray interrupts"); } } SYSINIT(cpu_startup, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); @@ -443,25 +440,29 @@ cpu_switch(struct thread *old, struct thread *new, struct mtx *mtx) struct pcb *oldpcb, *newpcb; oldpcb = old->td_pcb; -#ifdef COMPAT_IA32 +#ifdef COMPAT_FREEBSD32 ia32_savectx(oldpcb); #endif if (PCPU_GET(fpcurthread) == old) old->td_frame->tf_special.psr |= IA64_PSR_DFH; if (!savectx(oldpcb)) { atomic_store_rel_ptr(&old->td_lock, mtx); -#if defined(SCHED_ULE) && defined(SMP) - /* td_lock is volatile */ - while (new->td_lock == &blocked_lock) - ; -#endif + newpcb = new->td_pcb; oldpcb->pcb_current_pmap = pmap_switch(newpcb->pcb_current_pmap); + +#if defined(SCHED_ULE) && defined(SMP) + while (atomic_load_acq_ptr(&new->td_lock) == &blocked_lock) + cpu_spinwait(); +#endif + PCPU_SET(curthread, new); -#ifdef COMPAT_IA32 + +#ifdef COMPAT_FREEBSD32 ia32_restorectx(newpcb); #endif + if (PCPU_GET(fpcurthread) == new) new->td_frame->tf_special.psr &= ~IA64_PSR_DFH; restorectx(newpcb); @@ -478,10 +479,18 @@ cpu_throw(struct thread *old __unused, struct thread *new) newpcb = new->td_pcb; (void)pmap_switch(newpcb->pcb_current_pmap); + +#if defined(SCHED_ULE) && defined(SMP) + while (atomic_load_acq_ptr(&new->td_lock) == &blocked_lock) + cpu_spinwait(); +#endif + PCPU_SET(curthread, new); -#ifdef COMPAT_IA32 + +#ifdef COMPAT_FREEBSD32 ia32_restorectx(newpcb); #endif + restorectx(newpcb); /* We should not get here. */ panic("cpu_throw: restorectx() returned"); @@ -709,16 +718,6 @@ ia64_init(void) */ boothowto = bootinfo.bi_boothowto; - /* - * Catch case of boot_verbose set in environment. - */ - if ((p = getenv("boot_verbose")) != NULL) { - if (strcmp(p, "yes") == 0 || strcmp(p, "YES") == 0) { - boothowto |= RB_VERBOSE; - } - freeenv(p); - } - if (boothowto & RB_VERBOSE) bootverbose = 1; @@ -772,6 +771,7 @@ ia64_init(void) */ map_pal_code(); efi_boot_minimal(bootinfo.bi_systab); + ia64_xiv_init(); ia64_sal_init(); calculate_frequencies(); @@ -786,7 +786,7 @@ ia64_init(void) init_param1(); p = getenv("kernelname"); - if (p) { + if (p != NULL) { strncpy(kernelname, p, sizeof(kernelname) - 1); freeenv(p); } @@ -1328,7 +1328,7 @@ set_mcontext(struct thread *td, const mcontext_t *mc) * Clear registers on exec. */ void -exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings) +exec_setregs(struct thread *td, struct image_params *imgp, u_long stack) { struct trapframe *tf; uint64_t *ksttop, *kst; @@ -1366,7 +1366,7 @@ exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings) *kst-- = 0; if (((uintptr_t)kst & 0x1ff) == 0x1f8) *kst-- = 0; - *kst-- = ps_strings; + *kst-- = imgp->ps_strings; if (((uintptr_t)kst & 0x1ff) == 0x1f8) *kst-- = 0; *kst = stack; @@ -1381,11 +1381,11 @@ exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings) * Assumes that (bspstore & 0x1f8) < 0x1e0. */ suword((caddr_t)tf->tf_special.bspstore - 24, stack); - suword((caddr_t)tf->tf_special.bspstore - 16, ps_strings); + suword((caddr_t)tf->tf_special.bspstore - 16, imgp->ps_strings); suword((caddr_t)tf->tf_special.bspstore - 8, 0); } - tf->tf_special.iip = entry; + tf->tf_special.iip = imgp->entry_addr; tf->tf_special.sp = (stack & ~15) - 16; tf->tf_special.rsc = 0xf; tf->tf_special.fpsr = IA64_FPSR_DEFAULT; |