diff options
author | Takuya ASADA <syuu@cvs.openbsd.org> | 2009-09-30 06:22:01 +0000 |
---|---|---|
committer | Takuya ASADA <syuu@cvs.openbsd.org> | 2009-09-30 06:22:01 +0000 |
commit | 972b9cd3934a78937f80550d0ebfceea4d010956 (patch) | |
tree | 1b4429a3e7afc39f690f437b5175ddb7e36966e9 /sys/arch/sgi | |
parent | ea936621b858439241476551a88c4c5a040de69d (diff) |
curproc, curprocpaddr moved into cpu_info
OK miod@
Diffstat (limited to 'sys/arch/sgi')
-rw-r--r-- | sys/arch/sgi/include/asm.h | 11 | ||||
-rw-r--r-- | sys/arch/sgi/include/cpu.h | 10 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/genassym.cf | 3 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/machdep.c | 5 |
4 files changed, 19 insertions, 10 deletions
diff --git a/sys/arch/sgi/include/asm.h b/sys/arch/sgi/include/asm.h index 997fa0dc94d..23aea156911 100644 --- a/sys/arch/sgi/include/asm.h +++ b/sys/arch/sgi/include/asm.h @@ -1,5 +1,14 @@ -/* $OpenBSD: asm.h,v 1.1 2004/08/06 21:12:18 pefo Exp $ */ +/* $OpenBSD: asm.h,v 1.2 2009/09/30 06:22:00 syuu Exp $ */ /* Use Mips generic include file */ +#ifdef MULTIPROCESSOR +#define HW_CPU_NUMBER(reg) \ + LA reg, HW_CPU_NUMBER_REG; \ + PTR_L reg, 0(reg) +#else /* MULTIPROCESSOR */ +#define HW_CPU_NUMBER(reg) \ + LI reg, 0 +#endif /* MULTIPROCESSOR */ + #include <mips64/asm.h> diff --git a/sys/arch/sgi/include/cpu.h b/sys/arch/sgi/include/cpu.h index b8740d1af54..18e457c2c5a 100644 --- a/sys/arch/sgi/include/cpu.h +++ b/sys/arch/sgi/include/cpu.h @@ -1,15 +1,15 @@ -/* $OpenBSD: cpu.h,v 1.2 2009/09/15 04:54:31 syuu Exp $ */ +/* $OpenBSD: cpu.h,v 1.3 2009/09/30 06:22:00 syuu Exp $ */ /* Use Mips generic include file */ #ifdef _KERNEL #ifdef MULTIPROCESSOR #if defined(TGT_OCTANE) -#define HW_CPU_NUMBER 0x900000000ff50000/* HEART_PRID */ -#else +#define HW_CPU_NUMBER_REG 0x900000000ff50000 /* HEART_PRID */ +#else /* TGT_OCTANE */ #error MULTIPROCESSOR kernel not supported on this configuration -#endif -#define hw_cpu_number() (*(uint64_t *)HW_CPU_NUMBER) +#endif /* TGT_OCTANE */ +#define hw_cpu_number() (*(uint64_t *)HW_CPU_NUMBER_REG) #else/* MULTIPROCESSOR */ #define hw_cpu_number() 0 #endif/* MULTIPROCESSOR */ diff --git a/sys/arch/sgi/sgi/genassym.cf b/sys/arch/sgi/sgi/genassym.cf index 8c68800f0dd..445e84bc2bc 100644 --- a/sys/arch/sgi/sgi/genassym.cf +++ b/sys/arch/sgi/sgi/genassym.cf @@ -1,4 +1,4 @@ -# $OpenBSD: genassym.cf,v 1.13 2009/06/10 18:05:31 miod Exp $ +# $OpenBSD: genassym.cf,v 1.14 2009/09/30 06:22:00 syuu Exp $ # # Copyright (c) 1997 Per Fogelstrom / Opsycon AB # @@ -57,6 +57,7 @@ member pcb_segtab struct cpu_info member ci_curproc +member ci_curprocpaddr export VM_MIN_KERNEL_ADDRESS export SIGFPE diff --git a/sys/arch/sgi/sgi/machdep.c b/sys/arch/sgi/sgi/machdep.c index 8059aa99591..d941ce5f241 100644 --- a/sys/arch/sgi/sgi/machdep.c +++ b/sys/arch/sgi/sgi/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.82 2009/08/19 12:33:06 jasper Exp $ */ +/* $OpenBSD: machdep.c,v 1.83 2009/09/30 06:22:00 syuu Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -103,7 +103,6 @@ int physmem; /* Max supported memory, changes to actual. */ int rsvdmem; /* Reserved memory not usable. */ int ncpu = 1; /* At least one CPU in the system. */ struct user *proc0paddr; -struct user *curprocpaddr; int console_ok; /* Set when console initialized. */ int kbd_reset; int16_t masternasid; @@ -490,7 +489,7 @@ mips_init(int argc, void *argv, caddr_t boot_esym) /* * Allocate U page(s) for proc[0], pm_tlbpid 1. */ - proc0.p_addr = proc0paddr = curprocpaddr = + proc0.p_addr = proc0paddr = curcpu()->ci_curprocpaddr = (struct user *)pmap_steal_memory(USPACE, NULL, NULL); proc0.p_md.md_regs = (struct trap_frame *)&proc0paddr->u_pcb.pcb_regs; tlb_set_pid(1); |