/branches/sparc/kernel/arch/sparc64/include/sun4v/arch.h |
---|
51,6 → 51,12 |
/* register where the CPUID will be stored */ |
#define SCRATCHPAD_CPUID 0x08 |
/* register where the kernel stack address will be stored */ |
#define SCRATCHPAD_KSTACK 0x10 |
/* register where the userspace window buffer address will be stored */ |
#define SCRATCHPAD_WBUF 0x18 |
#endif |
/** @} |
/branches/sparc/kernel/arch/sparc64/include/sun4v/cpu.h |
---|
70,28 → 70,6 |
#ifdef __ASM__ |
/* |
* Computes the pointer to the kstack_wbuf_ptr structure of the current CPU. |
* |
* Parameters: |
* tmpreg1 global register to be used for scratching purposes |
* result register where the resulting pointer will be saved |
*/ |
.macro get_kstack_wbuf_ptr tmpreg1, result |
! load CPUID to tmpreg1 |
or %g0, SCRATCHPAD_CPUID, \tmpreg1 |
ldxa [\tmpreg1] ASI_SCRATCHPAD, \tmpreg1 |
! compute offset within the array of kstack_wbuf_ptr structures (each |
! such structure is 16 bytes long) |
mulx \tmpreg1, KSTACK_WBUF_PTR_SIZE, \tmpreg1 |
! compute the pointer to the structure for the current CPU |
sethi %hi(kstack_wbuf_ptrs), \result |
or \result, %lo(kstack_wbuf_ptrs), \result |
add \result, \tmpreg1, \result |
.endm |
#endif |
#endif |
/branches/sparc/kernel/arch/sparc64/include/trap/sun4v/regwin.h |
---|
45,8 → 45,8 |
* \tmpreg2 global register to be used for scratching purposes |
*/ |
.macro SAVE_TO_USPACE_WBUF tmpreg1, tmpreg2 |
get_kstack_wbuf_ptr \tmpreg1, \tmpreg2 |
ldx [\tmpreg2 + 8], \tmpreg1 |
set SCRATCHPAD_WBUF, \tmpreg2 |
ldxa [\tmpreg2] ASI_SCRATCHPAD, \tmpreg1 |
stx %l0, [\tmpreg1 + L0_OFFSET] |
stx %l1, [\tmpreg1 + L1_OFFSET] |
stx %l2, [\tmpreg1 + L2_OFFSET] |
64,7 → 64,7 |
stx %i6, [\tmpreg1 + I6_OFFSET] |
stx %i7, [\tmpreg1 + I7_OFFSET] |
add \tmpreg1, STACK_WINDOW_SAVE_AREA_SIZE, \tmpreg1 |
stx \tmpreg1, [\tmpreg2 + 8] |
stxa \tmpreg1, [\tmpreg2] ASI_SCRATCHPAD |
.endm |
/* |