Changeset 75e1db0 in mainline for arch/sparc64/include/asm.h
- Timestamp:
- 2005-12-19T22:41:07Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d6e8529
- Parents:
- 031e264
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/sparc64/include/asm.h
r031e264 r75e1db0 30 30 #define __sparc64_ASM_H__ 31 31 32 #include <typedefs.h> 32 33 #include <arch/types.h> 34 #include <arch/register.h> 33 35 #include <config.h> 36 37 /** Read Processor State register. 38 * 39 * @return Value of PSTATE register. 40 */ 41 static inline __u64 pstate_read(void) 42 { 43 __u64 v; 44 45 __asm__ volatile ("rdpr %%pstate, %0\n" : "=r" (v)); 46 47 return v; 48 } 49 50 /** Write Processor State register. 51 * 52 * @param New value of PSTATE register. 53 */ 54 static inline void pstate_write(__u64 v) 55 { 56 __asm__ volatile ("wrpr %0, %1, %%pstate\n" : : "r" (v), "i" (0)); 57 } 58 34 59 35 60 /** Enable interrupts. … … 41 66 */ 42 67 static inline ipl_t interrupts_enable(void) { 68 pstate_reg_t pstate; 69 __u64 value; 70 71 value = pstate_read(); 72 pstate.value = value; 73 pstate.ie = true; 74 pstate_write(pstate.value); 75 76 return (ipl_t) value; 43 77 } 44 78 … … 51 85 */ 52 86 static inline ipl_t interrupts_disable(void) { 87 pstate_reg_t pstate; 88 __u64 value; 89 90 value = pstate_read(); 91 pstate.value = value; 92 pstate.ie = false; 93 pstate_write(pstate.value); 94 95 return (ipl_t) value; 53 96 } 54 97 … … 60 103 */ 61 104 static inline void interrupts_restore(ipl_t ipl) { 105 pstate_reg_t pstate; 106 107 pstate.value = pstate_read(); 108 pstate.ie = ((pstate_reg_t) ipl).ie; 109 pstate_write(pstate.value); 62 110 } 63 111 … … 69 117 */ 70 118 static inline ipl_t interrupts_read(void) { 119 return (ipl_t) pstate_read(); 71 120 } 72 121 … … 81 130 __address v; 82 131 83 __asm__ volatile ("and %% o6, %1, %0\n" : "=r" (v) : "r" (~(STACK_SIZE-1)));132 __asm__ volatile ("and %%sp, %1, %0\n" : "=r" (v) : "r" (~(STACK_SIZE-1))); 84 133 85 134 return v;
Note:
See TracChangeset
for help on using the changeset viewer.