Subversion Repositories HelenOS

Rev

Rev 3993 | Rev 4663 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3993 Rev 4369
Line 68... Line 68...
68
 
68
 
69
#endif  
69
#endif  
70
 
70
 
71
#ifdef __ASM__
71
#ifdef __ASM__
72
 
72
 
73
/*
-
 
74
 * Computes the pointer to the kstack_wbuf_ptr structure of the current CPU.
-
 
75
 *
-
 
76
 * Parameters:
-
 
77
 *  tmpreg1     global register to be used for scratching purposes
-
 
78
 *  result      register where the resulting pointer will be saved
-
 
79
 */
-
 
80
.macro get_kstack_wbuf_ptr tmpreg1, result
-
 
81
    ! load CPUID to tmpreg1
-
 
82
    or %g0, SCRATCHPAD_CPUID, \tmpreg1
-
 
83
    ldxa [\tmpreg1] ASI_SCRATCHPAD, \tmpreg1
-
 
84
 
-
 
85
    ! compute offset within the array of kstack_wbuf_ptr structures (each
-
 
86
    ! such structure is 16 bytes long)
-
 
87
    mulx \tmpreg1, KSTACK_WBUF_PTR_SIZE, \tmpreg1
-
 
88
 
-
 
89
    ! compute the pointer to the structure for the current CPU
-
 
90
    sethi %hi(kstack_wbuf_ptrs), \result
-
 
91
    or \result, %lo(kstack_wbuf_ptrs), \result
-
 
92
    add \result, \tmpreg1, \result
-
 
93
.endm
-
 
94
 
-
 
95
#endif
73
#endif
96
 
74
 
97
#endif
75
#endif
98
 
76
 
99
/** @}
77
/** @}