Changeset df7f5cea in mainline
- Timestamp:
- 2014-08-25T23:03:50Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1c635d6, 3ab2d1e
- Parents:
- 6dbe7f68
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
HelenOS.config
r6dbe7f68 rdf7f5cea 397 397 ! [PLATFORM=ia32|PLATFORM=amd64|PLATFORM=ia64|PLATFORM=sparc64] CONFIG_FPU (y) 398 398 399 % FPU support 400 ! [PLATFORM=ppc32] CONFIG_FPU (n/y) 401 399 402 ## ARMv7 made FPU hardware compulsory 400 403 % FPU support -
kernel/arch/ppc32/include/arch/context_offset.h
r6dbe7f68 rdf7f5cea 54 54 #define OFFSET_CR 0x58 55 55 56 #define OFFSET_FR14 0x0 57 #define OFFSET_FR15 0x8 58 #define OFFSET_FR16 0x10 59 #define OFFSET_FR17 0x18 60 #define OFFSET_FR18 0x20 61 #define OFFSET_FR19 0x28 62 #define OFFSET_FR20 0x30 63 #define OFFSET_FR21 0x38 64 #define OFFSET_FR22 0x40 65 #define OFFSET_FR23 0x48 66 #define OFFSET_FR24 0x50 67 #define OFFSET_FR25 0x58 68 #define OFFSET_FR26 0x60 69 #define OFFSET_FR27 0x68 70 #define OFFSET_FR28 0x70 71 #define OFFSET_FR29 0x78 72 #define OFFSET_FR30 0x80 73 #define OFFSET_FR31 0x88 74 #define OFFSET_FPSCR 0x90 56 #define OFFSET_FR0 0x0 57 #define OFFSET_FR1 0x8 58 #define OFFSET_FR2 0x10 59 #define OFFSET_FR3 0x18 60 #define OFFSET_FR4 0x20 61 #define OFFSET_FR5 0x28 62 #define OFFSET_FR6 0x30 63 #define OFFSET_FR7 0x38 64 #define OFFSET_FR8 0x40 65 #define OFFSET_FR9 0x48 66 #define OFFSET_FR10 0x50 67 #define OFFSET_FR11 0x58 68 #define OFFSET_FR12 0x60 69 #define OFFSET_FR13 0x68 70 #define OFFSET_FR14 0x70 71 #define OFFSET_FR15 0x78 72 #define OFFSET_FR16 0x80 73 #define OFFSET_FR17 0x88 74 #define OFFSET_FR18 0x90 75 #define OFFSET_FR19 0x98 76 #define OFFSET_FR20 0xa0 77 #define OFFSET_FR21 0xa8 78 #define OFFSET_FR22 0xb0 79 #define OFFSET_FR23 0xb8 80 #define OFFSET_FR24 0xc0 81 #define OFFSET_FR25 0xc8 82 #define OFFSET_FR26 0xd0 83 #define OFFSET_FR27 0xd8 84 #define OFFSET_FR28 0xe0 85 #define OFFSET_FR29 0xe8 86 #define OFFSET_FR30 0xf0 87 #define OFFSET_FR31 0xf8 88 #define OFFSET_FPSCR 0x100 75 89 76 90 #ifdef __ASM__ -
kernel/arch/ppc32/include/arch/fpu_context.h
r6dbe7f68 rdf7f5cea 36 36 #define KERN_ppc32_FPU_CONTEXT_H_ 37 37 38 #define FPU_CONTEXT_ALIGN 8 39 38 40 #include <typedefs.h> 39 41 40 42 typedef struct { 43 uint64_t fr0; 44 uint64_t fr1; 45 uint64_t fr2; 46 uint64_t fr3; 47 uint64_t fr4; 48 uint64_t fr5; 49 uint64_t fr6; 50 uint64_t fr7; 51 uint64_t fr8; 52 uint64_t fr9; 53 uint64_t fr10; 54 uint64_t fr11; 55 uint64_t fr12; 56 uint64_t fr13; 41 57 uint64_t fr14; 42 58 uint64_t fr15; … … 57 73 uint64_t fr30; 58 74 uint64_t fr31; 59 uint 32_t fpscr;75 uint64_t fpscr; 60 76 } __attribute__ ((packed)) fpu_context_t; 61 77 -
kernel/arch/ppc32/include/arch/interrupt.h
r6dbe7f68 rdf7f5cea 44 44 #define VECTOR_INSTRUCTION_STORAGE 3 45 45 #define VECTOR_EXTERNAL 4 46 #define VECTOR_FP_UNAVAILABLE 7 46 47 #define VECTOR_DECREMENTER 8 47 48 #define VECTOR_ITLB_MISS 13 -
kernel/arch/ppc32/include/arch/msr.h
r6dbe7f68 rdf7f5cea 39 39 #define MSR_DR (1 << 4) 40 40 #define MSR_IR (1 << 5) 41 #define MSR_FE1 (1 << 8) 42 #define MSR_FE0 (1 << 11) 43 #define MSR_FP (1 << 13) 41 44 #define MSR_PR (1 << 14) 42 45 #define MSR_EE (1 << 15) -
kernel/arch/ppc32/src/cpu/cpu.c
r6dbe7f68 rdf7f5cea 37 37 #include <arch.h> 38 38 #include <print.h> 39 #include <fpu_context.h> 39 40 40 41 void cpu_arch_init(void) 41 42 { 43 #ifdef CONFIG_FPU 44 fpu_enable(); 45 #endif 42 46 } 43 47 … … 52 56 53 57 switch (cpu->arch.version) { 54 55 56 57 58 59 60 61 62 63 64 65 66 67 58 case 8: 59 name = "PowerPC 750"; 60 break; 61 case 9: 62 name = "PowerPC 604e"; 63 break; 64 case 0x81: 65 name = "PowerPC 8260"; 66 break; 67 case 0x8081: 68 name = "PowerPC 826xA"; 69 break; 70 default: 71 name = "unknown"; 68 72 } 69 73 -
kernel/arch/ppc32/src/exception.S
r6dbe7f68 rdf7f5cea 258 258 mtsrr0 r12 259 259 260 mfsrr1 r5 261 andi. r5, r5, MSR_FP 260 262 mfmsr r12 263 or r12, r12, r5 # Propagate MSR_FP from SRR1 to MSR 261 264 ori r12, r12, (MSR_IR | MSR_DR)@l 262 265 mtsrr1 r12 … … 276 279 addi r12, r12, iret_syscall@l 277 280 mtlr r12 278 281 282 mfsrr1 r0 283 andi. r0, r0, MSR_FP 279 284 mfmsr r12 285 or r12, r12, r0 # Propagate MSR_FP from SRR1 to MSR 280 286 ori r12, r12, (MSR_IR | MSR_DR)@l 281 287 mtsrr1 r12 -
kernel/arch/ppc32/src/fpu_context.S
r6dbe7f68 rdf7f5cea 29 29 #include <arch/asm/regname.h> 30 30 #include <arch/context_offset.h> 31 #include <arch/msr.h> 31 32 32 33 .text … … 39 40 40 41 .macro FPU_CONTEXT_STORE r 42 stfd fr0, OFFSET_FR0(\r) 43 stfd fr1, OFFSET_FR1(\r) 44 stfd fr2, OFFSET_FR2(\r) 45 stfd fr3, OFFSET_FR3(\r) 46 stfd fr4, OFFSET_FR4(\r) 47 stfd fr5, OFFSET_FR5(\r) 48 stfd fr6, OFFSET_FR6(\r) 49 stfd fr7, OFFSET_FR7(\r) 50 stfd fr8, OFFSET_FR8(\r) 51 stfd fr9, OFFSET_FR9(\r) 52 stfd fr10, OFFSET_FR10(\r) 53 stfd fr11, OFFSET_FR11(\r) 54 stfd fr12, OFFSET_FR12(\r) 55 stfd fr13, OFFSET_FR13(\r) 41 56 stfd fr14, OFFSET_FR14(\r) 42 57 stfd fr15, OFFSET_FR15(\r) … … 60 75 61 76 .macro FPU_CONTEXT_LOAD r 77 lfd fr0, OFFSET_FR0(\r) 78 lfd fr1, OFFSET_FR1(\r) 79 lfd fr2, OFFSET_FR2(\r) 80 lfd fr3, OFFSET_FR3(\r) 81 lfd fr4, OFFSET_FR4(\r) 82 lfd fr5, OFFSET_FR5(\r) 83 lfd fr6, OFFSET_FR6(\r) 84 lfd fr7, OFFSET_FR7(\r) 85 lfd fr8, OFFSET_FR8(\r) 86 lfd fr9, OFFSET_FR9(\r) 87 lfd fr10, OFFSET_FR10(\r) 88 lfd fr11, OFFSET_FR11(\r) 89 lfd fr12, OFFSET_FR12(\r) 90 lfd fr13, OFFSET_FR13(\r) 62 91 lfd fr14, OFFSET_FR14(\r) 63 92 lfd fr15, OFFSET_FR15(\r) … … 81 110 82 111 fpu_context_save: 83 //FPU_CONTEXT_STORE r384 //85 //mffs fr086 //stfd fr0, OFFSET_FPSCR(r3)112 FPU_CONTEXT_STORE r3 113 114 mffs fr0 115 stfd fr0, OFFSET_FPSCR(r3) 87 116 88 117 blr 89 118 90 119 fpu_context_restore: 91 // FPU_CONTEXT_LOAD r3 92 // 93 // lfd fr0, OFFSET_FPSCR(r3) 94 // mtfsf 7, fr0 120 lfd fr0, OFFSET_FPSCR(r3) 121 mtfsf 7, fr0 122 123 FPU_CONTEXT_LOAD r3 95 124 96 125 blr 97 126 98 127 fpu_init: 128 mfmsr r0 129 ori r0, r0, MSR_FP 130 131 # Disable FPU exceptions 132 li r3, MSR_FE0 | MSR_FE1 133 andc r0, r0, r3 134 135 mtmsr r0 99 136 blr 100 137 101 138 fpu_enable: 139 mfmsr r0 140 ori r0, r0, MSR_FP 141 mtmsr r0 102 142 blr 103 143 104 144 fpu_disable: 145 mfmsr r0 146 li r3, MSR_FP 147 andc r0, r0, r3 148 mtmsr r0 105 149 blr 150 -
kernel/arch/ppc32/src/interrupt.c
r6dbe7f68 rdf7f5cea 112 112 { 113 113 uint8_t inum; 114 114 115 115 while ((inum = pic_get_pending()) != 255) { 116 116 irq_t *irq = irq_dispatch_and_lock(inum); … … 146 146 } 147 147 148 static void exception_fp_unavailable(unsigned int n, istate_t *istate) 149 { 150 #ifdef CONFIG_FPU_LAZY 151 scheduler_fpu_lazy_request(); 152 /* 153 * Propagate MSR_FP from MSR back to istate's SRR1, which will become 154 * the next MSR. 155 */ 156 istate->srr1 |= msr_read() & MSR_FP; 157 #else 158 fault_if_from_uspace(istate, "FPU fault."); 159 panic_badtrap(istate, n, "FPU fault."); 160 #endif 161 } 162 148 163 static void exception_decrementer(unsigned int n, istate_t *istate) 149 164 { … … 161 176 exc_register(VECTOR_EXTERNAL, "external", true, 162 177 exception_external); 178 exc_register(VECTOR_FP_UNAVAILABLE, "fp_unavailable", true, 179 exception_fp_unavailable); 163 180 exc_register(VECTOR_DECREMENTER, "timer", true, 164 181 exception_decrementer); -
uspace/lib/c/arch/ppc32/Makefile.common
r6dbe7f68 rdf7f5cea 27 27 # 28 28 29 GCC_CFLAGS += -mcpu=powerpc -msoft-float -m32 29 30 ifeq ($(CONFIG_FPU),y) 31 FLOATS=hard 32 else 33 FLOATS=soft 34 endif 35 36 GCC_CFLAGS += -mcpu=powerpc -m$(FLOATS)-float -m32 30 37 BASE_LIBS += $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a 31 38 AFLAGS = -a32
Note:
See TracChangeset
for help on using the changeset viewer.