Changeset 138 for trunk/hal/x86_64/core
- Timestamp:
- Jul 4, 2017, 12:05:39 PM (7 years ago)
- Location:
- trunk/hal/x86_64/core
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_apic.c
r137 r138 280 280 hal_lapic_write(LAPIC_TPR, 0); 281 281 hal_lapic_write(LAPIC_EOI, 0); 282 hal_lapic_write(LAPIC_SVR, LAPIC_SVR_ENABLE| LAPIC_SPURIOUS_VECTOR);282 hal_lapic_write(LAPIC_SVR, LAPIC_SVR_ENABLE|VECTOR_APIC_SPURIOU); 283 283 284 284 /* Explicitly disable (mask) each vector */ -
trunk/hal/x86_64/core/hal_apic.h
r137 r138 30 30 /* 31 31 ******************************************************************************* 32 * IOAPIC32 * Fake APIC status, used by XCU (soft) 33 33 ******************************************************************************* 34 34 */ 35 36 37 35 #define APIC_FAKE_STATUS_HWI 0x1000 36 #define APIC_FAKE_STATUS_WTI 0x2000 37 #define APIC_FAKE_STATUS_PTI 0x4000 38 38 39 39 /* … … 42 42 ******************************************************************************* 43 43 */ 44 45 #define LAPIC_SPURIOUS_VECTOR LAPICVEC_MIN46 #define LAPIC_TIMER_VECTOR (LAPICVEC_MIN + 1)47 #define IOAPIC_KEYBOARD_VECTOR (LAPICVEC_MIN + 2)48 44 49 45 #define LAPIC_ID 0x020 /* ID. RW */ -
trunk/hal/x86_64/core/hal_init.c
r137 r138 95 95 dev->channels = 1; 96 96 97 #if NOTYET 97 98 /* 98 99 * Give 20% of the pins to HWI, 80% to WTI. … … 100 101 dev->param0 = (ioapic_pins * 20) / 100; /* hwi_nr */ 101 102 dev->param1 = ioapic_pins - dev->param0; /* wti_nr */ 103 #else 104 dev->param0 = 1; /* hwi_nr */ 105 dev->param1 = 1; /* wti_nr */ 106 #endif 102 107 103 108 /* … … 421 426 } 422 427 423 /* LAPICinterrupts */424 for (i = LAPICVEC_MIN; i < LAPICVEC_MAX; i++) {425 idt_set_seg(&idt[i], (void *)x86_intrs[i - LAPICVEC_MIN], 0,428 /* Dynamically configured interrupts */ 429 for (i = DYNVEC_MIN; i < DYNVEC_MAX; i++) { 430 idt_set_seg(&idt[i], (void *)x86_intrs[i - DYNVEC_MIN], 0, 426 431 SDT_SYS386IGT, SEL_KPL, GDT_FIXED_SEL(GDT_KCODE_SEL, SEL_KPL)); 427 432 } -
trunk/hal/x86_64/core/hal_kentry.S
r89 r138 156 156 iretq 157 157 158 /* 159 * The XCU interrupt entries. 160 */ 161 162 #define XCU_WTI_ENTRY(n) \ 163 ASM_ENTRY(x86_xcu_wti_ ## n) \ 164 pushq $0 ; \ 165 pushq $T_ASTFLT ; \ 166 INTR_SAVE_REGS ; \ 167 ; \ 168 movq $(APIC_FAKE_STATUS_WTI|n),CPUVAR(APIC_FAKE_STATUS); \ 169 call hal_do_interrupt; \ 170 ; \ 171 INTR_RESTORE_REGS ; \ 172 addq $16,%rsp ; \ 173 iretq 174 175 #define XCU_HWI_ENTRY(n) \ 176 ASM_ENTRY(x86_xcu_hwi_ ## n) \ 177 pushq $0 ; \ 178 pushq $T_ASTFLT ; \ 179 INTR_SAVE_REGS ; \ 180 ; \ 181 movq $(APIC_FAKE_STATUS_HWI|n),CPUVAR(APIC_FAKE_STATUS); \ 182 call hal_do_interrupt; \ 183 ; \ 184 INTR_RESTORE_REGS ; \ 185 addq $16,%rsp ; \ 186 iretq 187 188 #define XCU_PTI_ENTRY(n) \ 189 ASM_ENTRY(x86_xcu_pti_ ## n) \ 190 pushq $0 ; \ 191 pushq $T_ASTFLT ; \ 192 INTR_SAVE_REGS ; \ 193 ; \ 194 movq $(APIC_FAKE_STATUS_PTI|n),CPUVAR(APIC_FAKE_STATUS); \ 195 call hal_do_interrupt; \ 196 ; \ 197 INTR_RESTORE_REGS ; \ 198 addq $16,%rsp ; \ 199 iretq 200 201 XCU_WTI_ENTRY(0) 202 XCU_HWI_ENTRY(0) 203 XCU_PTI_ENTRY(0) 204 158 205 /* 159 206 * Arguments pushed on the stack: … … 198 245 x86_intrs: 199 246 .quad x86_lapic_spurious 247 .quad x86_xcu_wti_0 248 .quad x86_xcu_hwi_0 249 .quad x86_xcu_pti_0 250 200 251 .quad x86_lapic_timer 201 252 .quad x86_ioapic_keyboard -
trunk/hal/x86_64/core/hal_kentry.h
r109 r138 44 44 /* Trap's coming from user mode */ 45 45 #define T_USER 0x100 46 47 #define CPU_INFO_APIC_FAKE_STATUS 8 48 #define CPUVAR(off) %gs:CPU_INFO_ ## off 46 49 47 50 #define TF_REGSIZE (19 * 8) -
trunk/hal/x86_64/core/hal_segmentation.h
r89 r138 193 193 #define CPUVEC_MIN 0 194 194 #define CPUVEC_MAX 32 /* reserved entries for CPU exceptions */ 195 #define LAPICVEC_MIN CPUVEC_MAX 196 #define LAPICVEC_MAX (LAPICVEC_MIN + 3) 195 196 #define DYNVEC_MIN CPUVEC_MAX 197 #define DYNVEC_MAX (DYNVEC_MIN + 6) 198 199 #define VECTOR_APIC_SPURIOU (DYNVEC_MIN + 0) 200 #define VECTOR_APIC_XCU_WTI (DYNVEC_MIN + 1) 201 #define VECTOR_APIC_XCU_HWI (DYNVEC_MIN + 2) 202 #define VECTOR_APIC_XCU_PTI (DYNVEC_MIN + 3) 203 204 /* debug only, will be removed soon */ 205 #define LAPIC_TIMER_VECTOR (DYNVEC_MIN + 4) 206 #define IOAPIC_KEYBOARD_VECTOR (DYNVEC_MIN + 5) 197 207 198 208 #define NIDT 256 /* total number of IDT entries */ -
trunk/hal/x86_64/core/hal_special.c
r125 r138 31 31 struct thread_s; 32 32 33 typedefstruct cpu_info {33 struct cpu_info { 34 34 void *ci_self; 35 uint64_t apic_fake_status; 35 36 uint32_t ci_gid; 36 37 uint32_t ci_lid; 37 38 struct thread_s *ci_thr; 38 } cpu_info_t; 39 } __packed; 40 typedef struct cpu_info cpu_info_t; 39 41 40 42 cpu_info_t cpu0 __in_kdata; … … 104 106 { 105 107 curcpu()->ci_thr = thread; 108 } 109 110 uint8_t hal_get_apic_fake_status() 111 { 112 return curcpu()->apic_fake_status; 106 113 } 107 114
Note: See TracChangeset
for help on using the changeset viewer.