Rev 650 | Rev 664 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 650 | Rev 658 | ||
---|---|---|---|
Line 54... | Line 54... | ||
54 | static inline void pstate_write(__u64 v) |
54 | static inline void pstate_write(__u64 v) |
55 | { |
55 | { |
56 | __asm__ volatile ("wrpr %0, %1, %%pstate\n" : : "r" (v), "i" (0)); |
56 | __asm__ volatile ("wrpr %0, %1, %%pstate\n" : : "r" (v), "i" (0)); |
57 | } |
57 | } |
58 | 58 | ||
- | 59 | /** Read TICK_compare Register. |
|
- | 60 | * |
|
- | 61 | * @return Value of TICK_comapre register. |
|
- | 62 | */ |
|
- | 63 | static inline __u64 tick_compare_read(void) |
|
- | 64 | { |
|
- | 65 | __u64 v; |
|
- | 66 | ||
- | 67 | __asm__ volatile ("rd %%tick_cmpr, %0\n" : "=r" (v)); |
|
- | 68 | ||
- | 69 | return v; |
|
- | 70 | } |
|
- | 71 | ||
- | 72 | /** Write TICK_compare Register. |
|
- | 73 | * |
|
- | 74 | * @param New value of TICK_comapre register. |
|
- | 75 | */ |
|
- | 76 | static inline void tick_compare_write(__u64 v) |
|
- | 77 | { |
|
- | 78 | __asm__ volatile ("wr %0, %1, %%tick_cmpr\n" : : "r" (v), "i" (0)); |
|
- | 79 | } |
|
- | 80 | ||
- | 81 | /** Read TICK Register. |
|
- | 82 | * |
|
- | 83 | * @return Value of TICK register. |
|
- | 84 | */ |
|
- | 85 | static inline __u64 tick_read(void) |
|
- | 86 | { |
|
- | 87 | __u64 v; |
|
- | 88 | ||
- | 89 | __asm__ volatile ("rdpr %%tick, %0\n" : "=r" (v)); |
|
- | 90 | ||
- | 91 | return v; |
|
- | 92 | } |
|
- | 93 | ||
- | 94 | /** Write TICK Register. |
|
- | 95 | * |
|
- | 96 | * @param New value of TICK register. |
|
- | 97 | */ |
|
- | 98 | static inline void tick_write(__u64 v) |
|
- | 99 | { |
|
- | 100 | __asm__ volatile ("wrpr %0, %1, %%tick\n" : : "r" (v), "i" (0)); |
|
- | 101 | } |
|
- | 102 | ||
59 | 103 | ||
60 | /** Enable interrupts. |
104 | /** Enable interrupts. |
61 | * |
105 | * |
62 | * Enable interrupts and return previous |
106 | * Enable interrupts and return previous |
63 | * value of IPL. |
107 | * value of IPL. |
Line 194... | Line 238... | ||
194 | static inline void asi_u64_write(asi_t asi, __address va, __u64 v) |
238 | static inline void asi_u64_write(asi_t asi, __address va, __u64 v) |
195 | { |
239 | { |
196 | __asm__ volatile ("stxa %0, [%1] %2\n" : : "r" (v), "r" (va), "i" (asi) : "memory"); |
240 | __asm__ volatile ("stxa %0, [%1] %2\n" : : "r" (v), "r" (va), "i" (asi) : "memory"); |
197 | } |
241 | } |
198 | 242 | ||
- | 243 | ||
- | 244 | ||
199 | void cpu_halt(void); |
245 | void cpu_halt(void); |
200 | void cpu_sleep(void); |
246 | void cpu_sleep(void); |
201 | void asm_delay_loop(__u32 t); |
247 | void asm_delay_loop(__u32 t); |
202 | 248 | ||
203 | #endif |
249 | #endif |