diff options
-rw-r--r-- | sys/sparc64/include/frame.h | 1 | ||||
-rw-r--r-- | sys/sparc64/include/param.h | 3 | ||||
-rw-r--r-- | sys/sparc64/sparc64/genassym.c | 4 | ||||
-rw-r--r-- | sys/sparc64/sparc64/machdep.c | 3 | ||||
-rw-r--r-- | sys/sparc64/sparc64/rwindow.c | 1 | ||||
-rw-r--r-- | sys/sparc64/sparc64/swtch.S | 4 | ||||
-rw-r--r-- | sys/sparc64/sparc64/swtch.s | 4 |
7 files changed, 13 insertions, 7 deletions
diff --git a/sys/sparc64/include/frame.h b/sys/sparc64/include/frame.h index bcd1af7720c4..13eb625ad6db 100644 --- a/sys/sparc64/include/frame.h +++ b/sys/sparc64/include/frame.h @@ -29,7 +29,6 @@ #ifndef _MACHINE_FRAME_H_ #define _MACHINE_FRAME_H_ -#define PTR_SHIFT 3 #define RW_SHIFT 7 #define SPOFF 2047 diff --git a/sys/sparc64/include/param.h b/sys/sparc64/include/param.h index bd0f2a486946..72cf69c28039 100644 --- a/sys/sparc64/include/param.h +++ b/sys/sparc64/include/param.h @@ -82,6 +82,9 @@ #define MAXCPU 1 #endif /* SMP */ +#define INT_SHIFT 2 +#define PTR_SHIFT 3 + #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) diff --git a/sys/sparc64/sparc64/genassym.c b/sys/sparc64/sparc64/genassym.c index edbfabe72d45..09dc4bd2a75a 100644 --- a/sys/sparc64/sparc64/genassym.c +++ b/sys/sparc64/sparc64/genassym.c @@ -97,6 +97,9 @@ ASSYM(TSB_BUCKET_ADDRESS_BITS, TSB_BUCKET_ADDRESS_BITS); ASSYM(TSB_BUCKET_SHIFT, TSB_BUCKET_SHIFT); ASSYM(TSB_KERNEL_MASK, TSB_KERNEL_MASK); +ASSYM(INT_SHIFT, INT_SHIFT); +ASSYM(PTR_SHIFT, PTR_SHIFT); + ASSYM(PAGE_SHIFT, PAGE_SHIFT); ASSYM(PAGE_MASK, PAGE_MASK); @@ -187,7 +190,6 @@ ASSYM(P_SFLAG, offsetof(struct proc, p_sflag)); ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace)); ASSYM(RW_SHIFT, RW_SHIFT); -ASSYM(PTR_SHIFT, PTR_SHIFT); ASSYM(KE_FLAGS, offsetof(struct kse, ke_flags)); diff --git a/sys/sparc64/sparc64/machdep.c b/sys/sparc64/sparc64/machdep.c index acd6f7f2f498..a738c730735f 100644 --- a/sys/sparc64/sparc64/machdep.c +++ b/sys/sparc64/sparc64/machdep.c @@ -137,6 +137,9 @@ void sparc64_shutdown_final(void *dummy, int howto); static void cpu_startup(void *); SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); +CTASSERT((1 << INT_SHIFT) == sizeof(int)); +CTASSERT((1 << PTR_SHIFT) == sizeof(char *)); + CTASSERT(sizeof(struct pcpu) <= (PAGE_SIZE / 2)); static void diff --git a/sys/sparc64/sparc64/rwindow.c b/sys/sparc64/sparc64/rwindow.c index 039882e42076..2a29a23ceda4 100644 --- a/sys/sparc64/sparc64/rwindow.c +++ b/sys/sparc64/sparc64/rwindow.c @@ -38,7 +38,6 @@ #include <machine/frame.h> CTASSERT((1 << RW_SHIFT) == sizeof(struct rwindow)); -CTASSERT((1 << PTR_SHIFT) == sizeof(char *)); int rwindow_load(struct thread *td, struct trapframe *tf, int n) diff --git a/sys/sparc64/sparc64/swtch.S b/sys/sparc64/sparc64/swtch.S index c2d6c0b2352f..c69d153706f5 100644 --- a/sys/sparc64/sparc64/swtch.S +++ b/sys/sparc64/sparc64/swtch.S @@ -136,7 +136,7 @@ ENTRY(cpu_switch) * tsb. */ lduw [PCPU(CPUID)], %l3 - sllx %l3, 2, %l3 + sllx %l3, INT_SHIFT, %l3 add %l2, VM_PMAP + PM_CONTEXT, %l4 lduw [%l3 + %l4], %l5 brz,a,pn %l5, 3f @@ -164,7 +164,7 @@ ENTRY(cpu_switch) * If the new process has nucleus context we are done. */ 3: lduw [PCPU(CPUID)], %o3 - sllx %o3, 2, %o3 + sllx %o3, INT_SHIFT, %o3 add %o2, VM_PMAP + PM_CONTEXT, %o4 lduw [%o3 + %o4], %o5 brz,a,pn %o5, 4f diff --git a/sys/sparc64/sparc64/swtch.s b/sys/sparc64/sparc64/swtch.s index c2d6c0b2352f..c69d153706f5 100644 --- a/sys/sparc64/sparc64/swtch.s +++ b/sys/sparc64/sparc64/swtch.s @@ -136,7 +136,7 @@ ENTRY(cpu_switch) * tsb. */ lduw [PCPU(CPUID)], %l3 - sllx %l3, 2, %l3 + sllx %l3, INT_SHIFT, %l3 add %l2, VM_PMAP + PM_CONTEXT, %l4 lduw [%l3 + %l4], %l5 brz,a,pn %l5, 3f @@ -164,7 +164,7 @@ ENTRY(cpu_switch) * If the new process has nucleus context we are done. */ 3: lduw [PCPU(CPUID)], %o3 - sllx %o3, 2, %o3 + sllx %o3, INT_SHIFT, %o3 add %o2, VM_PMAP + PM_CONTEXT, %o4 lduw [%o3 + %o4], %o5 brz,a,pn %o5, 4f |