Changeset c0699467 in mainline for kernel/arch/mips32
- Timestamp:
- 2011-08-09T18:08:23Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b538ca5c
- Parents:
- 3666d386
- Location:
- kernel/arch/mips32
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/include/context_offset.h
r3666d386 rc0699467 63 63 #ifdef __ASM__ 64 64 65 #ifdef KERNEL 66 65 67 #include <arch/asm/regname.h> 66 68 67 # ctx: address of the structure with saved context 69 #else /* KERNEL */ 70 71 #include <libarch/regname.h> 72 73 #endif /* KERNEL */ 74 75 /* ctx: address of the structure with saved context */ 68 76 .macro CONTEXT_SAVE_ARCH_CORE ctx:req 69 sw $s0, OFFSET_S0(\ctx)70 sw $s1, OFFSET_S1(\ctx)71 sw $s2, OFFSET_S2(\ctx)72 sw $s3, OFFSET_S3(\ctx)73 sw $s4, OFFSET_S4(\ctx)74 sw $s5, OFFSET_S5(\ctx)75 sw $s6, OFFSET_S6(\ctx)76 sw $s7, OFFSET_S7(\ctx)77 sw $s8, OFFSET_S8(\ctx)78 sw $gp, OFFSET_GP(\ctx)79 77 sw $s0, OFFSET_S0(\ctx) 78 sw $s1, OFFSET_S1(\ctx) 79 sw $s2, OFFSET_S2(\ctx) 80 sw $s3, OFFSET_S3(\ctx) 81 sw $s4, OFFSET_S4(\ctx) 82 sw $s5, OFFSET_S5(\ctx) 83 sw $s6, OFFSET_S6(\ctx) 84 sw $s7, OFFSET_S7(\ctx) 85 sw $s8, OFFSET_S8(\ctx) 86 sw $gp, OFFSET_GP(\ctx) 87 80 88 #ifndef KERNEL 81 sw $k1, OFFSET_TLS(\ctx)82 89 sw $k1, OFFSET_TLS(\ctx) 90 83 91 #ifdef CONFIG_FPU 84 mfc1 $t0, $2092 mfc1 $t0, $20 85 93 sw $t0, OFFSET_F20(\ctx) 86 87 mfc1 $t0, $2194 95 mfc1 $t0, $21 88 96 sw $t0, OFFSET_F21(\ctx) 89 90 mfc1 $t0, $2297 98 mfc1 $t0, $22 91 99 sw $t0, OFFSET_F22(\ctx) 92 93 mfc1 $t0, $23100 101 mfc1 $t0, $23 94 102 sw $t0, OFFSET_F23(\ctx) 95 96 mfc1 $t0, $24103 104 mfc1 $t0, $24 97 105 sw $t0, OFFSET_F24(\ctx) 98 99 mfc1 $t0, $25106 107 mfc1 $t0, $25 100 108 sw $t0, OFFSET_F25(\ctx) 101 102 mfc1 $t0, $26109 110 mfc1 $t0, $26 103 111 sw $t0, OFFSET_F26(\ctx) 104 105 mfc1 $t0, $27112 113 mfc1 $t0, $27 106 114 sw $t0, OFFSET_F27(\ctx) 107 108 mfc1 $t0, $28115 116 mfc1 $t0, $28 109 117 sw $t0, OFFSET_F28(\ctx) 110 111 mfc1 $t0, $29118 119 mfc1 $t0, $29 112 120 sw $t0, OFFSET_F29(\ctx) 113 121 114 mfc1 $t0, $30122 mfc1 $t0, $30 115 123 sw $t0, OFFSET_F30(\ctx) 116 124 #endif /* CONFIG_FPU */ 117 125 #endif /* KERNEL */ 118 119 sw $ra, OFFSET_PC(\ctx)120 sw $sp, OFFSET_SP(\ctx)126 127 sw $ra, OFFSET_PC(\ctx) 128 sw $sp, OFFSET_SP(\ctx) 121 129 .endm 122 130 123 # ctx: address of the structure with saved context 131 /* ctx: address of the structure with saved context */ 124 132 .macro CONTEXT_RESTORE_ARCH_CORE ctx:req 125 lw $s0, OFFSET_S0(\ctx)126 lw $s1, OFFSET_S1(\ctx)127 lw $s2, OFFSET_S2(\ctx)128 lw $s3, OFFSET_S3(\ctx)129 lw $s4, OFFSET_S4(\ctx)130 lw $s5, OFFSET_S5(\ctx)131 lw $s6, OFFSET_S6(\ctx)132 lw $s7, OFFSET_S7(\ctx)133 lw $s8, OFFSET_S8(\ctx)134 lw $gp, OFFSET_GP(\ctx)133 lw $s0, OFFSET_S0(\ctx) 134 lw $s1, OFFSET_S1(\ctx) 135 lw $s2, OFFSET_S2(\ctx) 136 lw $s3, OFFSET_S3(\ctx) 137 lw $s4, OFFSET_S4(\ctx) 138 lw $s5, OFFSET_S5(\ctx) 139 lw $s6, OFFSET_S6(\ctx) 140 lw $s7, OFFSET_S7(\ctx) 141 lw $s8, OFFSET_S8(\ctx) 142 lw $gp, OFFSET_GP(\ctx) 135 143 #ifndef KERNEL 136 lw $k1, OFFSET_TLS(\ctx)137 144 lw $k1, OFFSET_TLS(\ctx) 145 138 146 #ifdef CONFIG_FPU 139 147 lw $t0, OFFSET_F20(\ctx) 140 mtc1 $t0, $20141 148 mtc1 $t0, $20 149 142 150 lw $t0, OFFSET_F21(\ctx) 143 mtc1 $t0, $21144 151 mtc1 $t0, $21 152 145 153 lw $t0, OFFSET_F22(\ctx) 146 mtc1 $t0, $22147 154 mtc1 $t0, $22 155 148 156 lw $t0, OFFSET_F23(\ctx) 149 mtc1 $t0, $23150 157 mtc1 $t0, $23 158 151 159 lw $t0, OFFSET_F24(\ctx) 152 mtc1 $t0, $24153 160 mtc1 $t0, $24 161 154 162 lw $t0, OFFSET_F25(\ctx) 155 mtc1 $t0, $25156 163 mtc1 $t0, $25 164 157 165 lw $t0, OFFSET_F26(\ctx) 158 mtc1 $t0, $26159 166 mtc1 $t0, $26 167 160 168 lw $t0, OFFSET_F27(\ctx) 161 mtc1 $t0, $27162 169 mtc1 $t0, $27 170 163 171 lw $t0, OFFSET_F28(\ctx) 164 mtc1 $t0, $28165 172 mtc1 $t0, $28 173 166 174 lw $t0, OFFSET_F29(\ctx) 167 mtc1 $t0, $29168 175 mtc1 $t0, $29 176 169 177 lw $t0, OFFSET_F30(\ctx) 170 mtc1 $t0, $30178 mtc1 $t0, $30 171 179 #endif /* CONFIG_FPU */ 172 180 #endif /* KERNEL */ 173 174 lw $ra, OFFSET_PC(\ctx)175 lw $sp, OFFSET_SP(\ctx)181 182 lw $ra, OFFSET_PC(\ctx) 183 lw $sp, OFFSET_SP(\ctx) 176 184 .endm 177 185 178 #endif 179 186 #endif /* __ASM__ */ 180 187 181 188 #endif -
kernel/arch/mips32/include/cp0.h
r3666d386 rc0699467 36 36 #define KERN_mips32_CP0_H_ 37 37 38 #ifdef KERNEL39 #include <typedefs.h>40 #else41 #include <sys/types.h>42 #endif43 44 38 #define cp0_status_ie_enabled_bit (1 << 0) 45 39 #define cp0_status_exl_exception_bit (1 << 1) … … 49 43 #define cp0_status_fpu_bit (1 << 29) 50 44 51 #define cp0_status_im_shift 52 #define cp0_status_im_mask 45 #define cp0_status_im_shift 8 46 #define cp0_status_im_mask 0xff00 53 47 54 #define cp0_cause_excno(cause) ((cause >> 2) & 0x1f)55 #define cp0_cause_coperr(cause) ((cause >> 28) & 0x3)48 #define cp0_cause_excno(cause) ((cause >> 2) & 0x1f) 49 #define cp0_cause_coperr(cause) ((cause >> 28) & 0x3) 56 50 57 #define fpu_cop_id 151 #define fpu_cop_id 1 58 52 59 53 /* 60 54 * Magic value for use in msim. 61 55 */ 62 #define cp0_compare_value 56 #define cp0_compare_value 100000 63 57 64 #define cp0_mask_all_int() cp0_status_write(cp0_status_read() & ~(cp0_status_im_mask)) 65 #define cp0_unmask_all_int() cp0_status_write(cp0_status_read() | cp0_status_im_mask) 66 #define cp0_mask_int(it) cp0_status_write(cp0_status_read() & ~(1 << (cp0_status_im_shift + (it)))) 67 #define cp0_unmask_int(it) cp0_status_write(cp0_status_read() | (1 << (cp0_status_im_shift + (it)))) 58 #define cp0_mask_all_int() \ 59 cp0_status_write(cp0_status_read() & ~(cp0_status_im_mask)) 68 60 69 #define GEN_READ_CP0(nm,reg) static inline uint32_t cp0_ ##nm##_read(void) \ 70 { \ 71 uint32_t retval; \ 72 asm volatile ("mfc0 %0, $" #reg : "=r"(retval)); \ 73 return retval; \ 74 } 61 #define cp0_unmask_all_int() \ 62 cp0_status_write(cp0_status_read() | cp0_status_im_mask) 75 63 76 #define GEN_WRITE_CP0(nm,reg) static inline void cp0_ ##nm##_write(uint32_t val) \ 77 { \ 78 asm volatile ("mtc0 %0, $" #reg : : "r"(val) ); \ 79 } 64 #define cp0_mask_int(it) \ 65 cp0_status_write(cp0_status_read() & ~(1 << (cp0_status_im_shift + (it)))) 66 67 #define cp0_unmask_int(it) \ 68 cp0_status_write(cp0_status_read() | (1 << (cp0_status_im_shift + (it)))) 69 70 #define GEN_READ_CP0(nm, reg) \ 71 static inline uint32_t cp0_ ##nm##_read(void) \ 72 { \ 73 uint32_t retval; \ 74 \ 75 asm volatile ( \ 76 "mfc0 %0, $" #reg \ 77 : "=r"(retval) \ 78 ); \ 79 \ 80 return retval; \ 81 } 82 83 #define GEN_WRITE_CP0(nm, reg) \ 84 static inline void cp0_ ##nm##_write(uint32_t val) \ 85 { \ 86 asm volatile ( \ 87 "mtc0 %0, $" #reg \ 88 :: "r"(val) \ 89 ); \ 90 } 80 91 81 92 GEN_READ_CP0(index, 0); -
kernel/arch/mips32/include/istate.h
r3666d386 rc0699467 36 36 #define KERN_mips32_ISTATE_H_ 37 37 38 #include <trace.h> 39 40 #ifdef KERNEL 41 38 42 #include <arch/cp0.h> 39 43 40 #ifdef KERNEL 41 #include <typedefs.h> 42 #include <trace.h> 43 #else 44 #include <sys/types.h> 45 #define NO_TRACE 46 #endif 44 #else /* KERNEL */ 45 46 #include <libarch/cp0.h> 47 48 #endif /* KERNEL */ 47 49 48 50 typedef struct istate { -
kernel/arch/mips32/include/mm/frame.h
r3666d386 rc0699467 39 39 #define FRAME_SIZE (1 << FRAME_WIDTH) 40 40 41 #ifdef KERNEL42 41 #ifndef __ASM__ 43 42 … … 46 45 47 46 #endif /* __ASM__ */ 48 #endif /* KERNEL */49 47 50 48 #endif -
kernel/arch/mips32/include/mm/page.h
r3666d386 rc0699467 49 49 # define PA2KA(x) ((x) + 0x80000000) 50 50 #endif 51 52 #ifdef KERNEL53 51 54 52 /* … … 188 186 #endif /* __ASM__ */ 189 187 190 #endif /* KERNEL */191 192 188 #endif 193 189 -
kernel/arch/mips32/src/mips32.c
r3666d386 rc0699467 41 41 #include <memstr.h> 42 42 #include <proc/thread.h> 43 #include < proc/uarg.h>43 #include <abi/proc/uarg.h> 44 44 #include <print.h> 45 45 #include <console/console.h> … … 52 52 #include <arch/debugger.h> 53 53 #include <genarch/fb/fb.h> 54 #include < genarch/fb/visuals.h>54 #include <abi/fb/visuals.h> 55 55 #include <genarch/drivers/dsrln/dsrlnin.h> 56 56 #include <genarch/drivers/dsrln/dsrlnout.h>
Note:
See TracChangeset
for help on using the changeset viewer.