Changeset 0259524 in mainline
- Timestamp:
- 2005-11-03T20:26:29Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 05d9dd89
- Parents:
- dbd1059
- Location:
- arch
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/include/asm.h
rdbd1059 r0259524 139 139 * @return Old interrupt priority level. 140 140 */ 141 static inline ipl_t interrupts_enable(void) { 141 static inline ipl_t interrupts_enable(void) 142 { 142 143 ipl_t v; 143 144 __asm__ volatile ( … … 157 158 * @return Old interrupt priority level. 158 159 */ 159 static inline ipl_t interrupts_disable(void) { 160 static inline ipl_t interrupts_disable(void) 161 { 160 162 ipl_t v; 161 163 __asm__ volatile ( … … 174 176 * @param ipl Saved interrupt priority level. 175 177 */ 176 static inline void interrupts_restore(ipl_t ipl) { 178 static inline void interrupts_restore(ipl_t ipl) 179 { 177 180 __asm__ volatile ( 178 181 "pushl %0\n\t" … … 186 189 * @return EFLAFS. 187 190 */ 188 static inline ipl_t interrupts_read(void) { 191 static inline ipl_t interrupts_read(void) 192 { 189 193 ipl_t v; 190 194 __asm__ volatile ( -
arch/ia64/include/asm.h
rdbd1059 r0259524 32 32 #include <arch/types.h> 33 33 #include <config.h> 34 #include <arch/register.h> 34 35 35 36 /** Return base address of current stack … … 48 49 } 49 50 50 /** Read IVR (External Interrupt Vector Register) 51 /** Read IVR (External Interrupt Vector Register). 51 52 * 52 53 * @return Highest priority, pending, unmasked external interrupt vector. 53 54 */ 54 static inline __u8 read_ivr(void) 55 { 56 __u64 v; 57 58 __asm__ volatile ("mov %0 = cr65\n" : "=r" (v)); 59 60 return (__u8) (v & 0xf); 61 } 62 63 64 void cpu_sleep(void); 65 66 void asm_delay_loop(__u32 t); 67 55 static inline __u64 ivr_read(void) 56 { 57 __u64 v; 58 59 __asm__ volatile ("mov %0 = cr.ivr\n" : "=r" (v)); 60 61 return v; 62 } 63 64 /** Write ITC (Interval Timer Counter) register. 65 * 66 * @param New counter value. 67 */ 68 static inline void itc_write(__u64 v) 69 { 70 __asm__ volatile ("mov ar.itc = %0\n" : : "r" (v)); 71 } 72 73 /** Read ITC (Interval Timer Counter) register. 74 * 75 * @return Current counter value. 76 */ 77 static inline __u64 itc_read(void) 78 { 79 __u64 v; 80 81 __asm__ volatile ("mov %0 = ar.itc\n" : "=r" (v)); 82 83 return v; 84 } 85 86 /** Write ITM (Interval Timer Match) register. 87 * 88 * @param New match value. 89 */ 90 static inline void itm_write(__u64 v) 91 { 92 __asm__ volatile ("mov cr.itm = %0\n" : : "r" (v)); 93 } 94 95 /** Write ITV (Interval Timer Vector) register. 96 * 97 * @param New vector and masked bit. 98 */ 99 static inline void itv_write(__u64 v) 100 { 101 __asm__ volatile ("mov cr.itv = %0\n" : : "r" (v)); 102 } 103 104 /** Write EOI (End Of Interrupt) register. 105 * 106 * @param This value is ignored. 107 */ 108 static inline void eoi_write(__u64 v) 109 { 110 __asm__ volatile ("mov cr.eoi = %0\n" : : "r" (v)); 111 } 112 113 /** Read TPR (Task Priority Register). 114 * 115 * @return Current value of TPR. 116 */ 117 static inline __u64 tpr_read(void) 118 { 119 __u64 v; 120 121 __asm__ volatile ("mov %0 = cr.tpr\n" : "=r" (v)); 122 123 return v; 124 } 125 126 /** Write TPR (Task Priority Register). 127 * 128 * @param New value of TPR. 129 */ 130 static inline void tpr_write(__u64 v) 131 { 132 __asm__ volatile ("mov cr.tpr = %0\n" : : "r" (v)); 133 } 134 135 /** Disable interrupts. 136 * 137 * Disable interrupts and return previous 138 * value of PSR. 139 * 140 * @return Old interrupt priority level. 141 */ 142 static ipl_t interrupts_disable(void) 143 { 144 __u64 v; 145 146 __asm__ volatile ( 147 "mov %0 = psr\n" 148 "rsm %1\n" 149 : "=r" (v) 150 : "i" (PSR_I_MASK) 151 ); 152 153 return (ipl_t) v; 154 } 155 156 /** Enable interrupts. 157 * 158 * Enable interrupts and return previous 159 * value of PSR. 160 * 161 * @return Old interrupt priority level. 162 */ 163 static ipl_t interrupts_enable(void) 164 { 165 __u64 v; 166 167 __asm__ volatile ( 168 "mov %0 = psr\n" 169 "ssm %1\n" 170 ";;\n" 171 "srlz.d\n" 172 : "=r" (v) 173 : "i" (PSR_I_MASK) 174 ); 175 176 return (ipl_t) v; 177 } 178 179 /** Restore interrupt priority level. 180 * 181 * Restore PSR. 182 * 183 * @param ipl Saved interrupt priority level. 184 */ 185 static inline void interrupts_restore(ipl_t ipl) 186 { 187 __asm__ volatile ( 188 "mov psr.l = %0\n" 189 ";;\n" 190 "srlz.d\n" 191 : : "r" ((__u64) ipl) 192 ); 193 } 194 195 /** Return interrupt priority level. 196 * 197 * @return PSR. 198 */ 199 static inline ipl_t interrupts_read(void) 200 { 201 __u64 v; 202 203 __asm__ volatile ("mov %0 = psr\n" : "=r" (v)); 204 205 return (ipl_t) v; 206 } 68 207 69 208 #define set_shadow_register(reg,val) {__u64 v = val; __asm__ volatile("mov r15 = %0;;\n""bsw.0;;\n""mov " #reg " = r15;;\n""bsw.1;;\n" : : "r" (v) : "r15" ); } … … 74 213 #define get_psr(val) {__u64 v ; __asm__ volatile("mov r15 = psr;;\n" "mov %0 = r15;;\n" : "=r" (v) : : "r15" ); val=v; } 75 214 76 77 void cpu_halt(void); 78 79 80 215 extern void cpu_halt(void); 216 extern void cpu_sleep(void); 217 extern void asm_delay_loop(__u32 t); 81 218 82 219 #endif -
arch/ia64/include/barrier.h
rdbd1059 r0259524 33 33 * TODO: Implement true IA-64 memory barriers for macros below. 34 34 */ 35 #define CS_ENTER_BARRIER() __asm__ volatile ("" ::: "memory")36 #define CS_LEAVE_BARRIER() __asm__ volatile ("" ::: "memory")35 #define CS_ENTER_BARRIER() memory_barrier() 36 #define CS_LEAVE_BARRIER() memory_barrier() 37 37 38 #define memory_barrier() 39 #define read_barrier() 40 #define write_barrier() 38 #define memory_barrier() __asm__ volatile ("mf\n" ::: "memory") 39 #define read_barrier() memory_barrier() 40 #define write_barrier() memory_barrier() 41 41 42 42 #define srlz_i() __asm__ volatile (";; srlz.i ;;\n" ::: "memory") 43 #define srlz_d() __asm__ volatile (";; srlz.d ;;\n" ::: "memory")43 #define srlz_d() __asm__ volatile (";; srlz.d\n" ::: "memory") 44 44 45 45 #endif -
arch/ia64/src/dummy.s
rdbd1059 r0259524 36 36 .global cpu_identify 37 37 .global cpu_print_report 38 .global interrupts_disable39 .global interrupts_enable40 .global interrupts_read41 .global interrupts_restore42 38 .global cpu_sleep 43 39 .global dummy … … 53 49 cpu_identify: 54 50 cpu_print_report: 55 interrupts_disable:56 interrupts_enable:57 interrupts_read:58 interrupts_restore:59 51 cpu_sleep: 60 52 fpu_init: -
arch/ia64/src/interrupt.c
rdbd1059 r0259524 33 33 #include <arch/asm.h> 34 34 #include <arch/barrier.h> 35 #include <arch/register.h> 35 36 36 37 void external_interrupt(void) … … 39 40 40 41 srlz_d(); 41 ivr = read_ivr();42 ivr = ivr_read() & CR_IVR_MASK; 42 43 srlz_d(); 43 44
Note:
See TracChangeset
for help on using the changeset viewer.