Changeset 75e1db0 in mainline
- 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
- Files:
-
- 8 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; -
arch/sparc64/include/context.h
r031e264 r75e1db0 67 67 __address sp; /* %o6 */ 68 68 __address pc; /* %o7 */ 69 __address fp; 69 __address fp; /* %i6 */ 70 __address i7; 70 71 ipl_t ipl; 71 72 }; -
arch/sparc64/include/context_offset.h
r031e264 r75e1db0 9 9 #define OFFSET_PC 0x30 10 10 #define OFFSET_FP 0x38 11 #define OFFSET_I7 0x40 -
arch/sparc64/include/register.h
r031e264 r75e1db0 47 47 typedef union ver_reg ver_reg_t; 48 48 49 /** Processor State Register. */ 50 union pstate_reg { 51 __u64 value; 52 struct { 53 __u64 : 52; 54 unsigned ig : 1; /**< Interrupt Globals. */ 55 unsigned mg : 1; /**< MMU Globals. */ 56 unsigned cle : 1; /**< Current Little Endian. */ 57 unsigned tle : 1; /**< Trap Little Endian. */ 58 unsigned mm : 2; /**< Memory Model. */ 59 unsigned red : 1; /**< RED state. */ 60 unsigned pef : 1; /**< Enable floating-point. */ 61 unsigned am : 1; /**< 32-bit Address Mask. */ 62 unsigned priv : 1; /**< Privileged Mode. */ 63 unsigned ie : 1; /**< Interrupt Enable. */ 64 unsigned ag : 1; /**< Alternate Globals*/ 65 } __attribute__ ((packed)); 66 }; 67 typedef union pstate_reg pstate_reg_t; 68 49 69 #endif -
arch/sparc64/src/context.S
r031e264 r75e1db0 52 52 stx %sp, [\r + OFFSET_SP] 53 53 stx %fp, [\r + OFFSET_FP] 54 stx %i7, [\r + OFFSET_I7] 54 55 .endm 55 56 … … 63 64 ldx [\r + OFFSET_SP], %sp 64 65 ldx [\r + OFFSET_FP], %fp 66 ldx [\r + OFFSET_I7], %i7 65 67 .endm 66 68 -
arch/sparc64/src/dummy.s
r031e264 r75e1db0 59 59 userspace: 60 60 61 62 61 dummy: 63 0:64 62 retl 65 63 nop -
generic/include/debug.h
r031e264 r75e1db0 51 51 */ 52 52 #ifdef CONFIG_DEBUG 53 # define ASSERT(expr) if (!(expr)) { panic("assertion failed (%s) ", #expr); }53 # define ASSERT(expr) if (!(expr)) { panic("assertion failed (%s), caller=%P\n", #expr, CALLER); } 54 54 #else 55 55 # define ASSERT(expr) -
generic/src/proc/scheduler.c
r031e264 r75e1db0 295 295 296 296 spinlock_lock(&CPU->lock); 297 if(CPU->fpu_owner==THREAD) CPU->fpu_owner=NULL; 297 if(CPU->fpu_owner==THREAD) 298 CPU->fpu_owner=NULL; 298 299 spinlock_unlock(&CPU->lock); 299 300
Note:
See TracChangeset
for help on using the changeset viewer.