Changeset 7d3d641 in mainline for kernel/arch/xen32/src
- Timestamp:
- 2006-08-01T20:45:26Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5b23a82
- Parents:
- 3e5cc686
- Location:
- kernel/arch/xen32/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/xen32/src/asm.S
r3e5cc686 r7d3d641 35 35 .text 36 36 37 .global xen_callback 38 .global xen_failsafe_callback 37 39 .global enable_l_apic_in_msr 38 40 .global interrupt_handlers … … 42 44 .global memcpy_to_uspace 43 45 .global memcpy_to_uspace_failover_address 46 47 48 xen_callback: 49 iret 50 51 xen_failsafe_callback: 52 iret 44 53 45 54 -
kernel/arch/xen32/src/pm.c
r3e5cc686 r7d3d641 76 76 }; 77 77 78 static idescriptor_t idt[IDT_ITEMS];78 static trap_info_t traps[IDT_ITEMS + 1]; 79 79 80 80 static tss_t tss; … … 99 99 } 100 100 101 void idt_setoffset(idescriptor_t *d, uintptr_t offset)102 {103 /*104 * Offset is a linear address.105 */106 d->offset_0_15 = offset & 0xffff;107 d->offset_16_31 = offset >> 16;108 }109 110 101 void tss_initialize(tss_t *t) 111 102 { … … 113 104 } 114 105 115 /* 116 * This function takes care of proper setup of IDT and IDTR. 117 */ 118 void idt_init(void) 119 { 120 idescriptor_t *d; 121 int i; 122 106 void traps_init(void) 107 { 108 index_t i; 109 123 110 for (i = 0; i < IDT_ITEMS; i++) { 124 d = &idt[i]; 125 126 d->unused = 0; 127 d->selector = selector(KTEXT_DES); 128 129 d->access = AR_PRESENT | AR_INTERRUPT; /* masking interrupt */ 130 131 if (i == VECTOR_SYSCALL) { 132 /* 133 * The syscall interrupt gate must be calleable from userland. 134 */ 135 d->access |= DPL_USER; 136 } 111 traps[i].vector = i; 137 112 138 idt_setoffset(d, ((uintptr_t) interrupt_handlers) + i*interrupt_handler_size); 113 if (i == VECTOR_SYSCALL) 114 traps[i].flags = 3; 115 else 116 traps[i].flags = 0; 117 118 traps[i].cs = XEN_CS; 119 traps[i].address = ((uintptr_t) interrupt_handlers) + i * interrupt_handler_size; 139 120 exc_register(i, "undef", (iroutine) null_interrupt); 140 121 } 122 traps[IDT_ITEMS].vector = 0; 123 traps[IDT_ITEMS].flags = 0; 124 traps[IDT_ITEMS].cs = 0; 125 traps[IDT_ITEMS].address = NULL; 126 141 127 exc_register(13, "gp_fault", (iroutine) gp_fault); 142 128 exc_register( 7, "nm_fault", (iroutine) nm_fault); … … 173 159 { 174 160 descriptor_t *gdt_p = (descriptor_t *) gdtr.base; 175 ptr_16_32_t idtr; 176 177 /* 178 * Update addresses in GDT and IDT to their virtual counterparts. 179 */ 180 idtr.limit = sizeof(idt); 181 idtr.base = (uintptr_t) idt; 161 182 162 // gdtr_load(&gdtr); 183 // idtr_load(&idtr); 184 185 /* 186 * Each CPU has its private GDT and TSS. 187 * All CPUs share one IDT. 188 */ 189 190 // if (config.cpu_active == 1) { 191 // idt_init(); 192 // /* 193 // * NOTE: bootstrap CPU has statically allocated TSS, because 194 // * the heap hasn't been initialized so far. 195 // */ 163 164 if (config.cpu_active == 1) { 165 traps_init(); 166 xen_set_trap_table(traps); 167 /* 168 * NOTE: bootstrap CPU has statically allocated TSS, because 169 * the heap hasn't been initialized so far. 170 */ 196 171 tss_p = &tss; 197 // } 198 // else { 199 // tss_p = (tss_t *) malloc(sizeof(tss_t), FRAME_ATOMIC); 200 // if (!tss_p) 201 // panic("could not allocate TSS\n"); 202 // } 172 } else { 173 tss_p = (tss_t *) malloc(sizeof(tss_t), FRAME_ATOMIC); 174 if (!tss_p) 175 panic("could not allocate TSS\n"); 176 } 203 177 204 178 // tss_initialize(tss_p); -
kernel/arch/xen32/src/proc/scheduler.c
r3e5cc686 r7d3d641 27 27 */ 28 28 29 /** @addtogroup ia32proc29 /** @addtogroup xen32proc 30 30 * @{ 31 31 */ … … 78 78 } 79 79 80 80 /** @} 81 81 */ 82 -
kernel/arch/xen32/src/proc/task.c
r3e5cc686 r7d3d641 27 27 */ 28 28 29 /** @addtogroup ia32proc29 /** @addtogroup xen32proc 30 30 * @{ 31 31 */ … … 58 58 } 59 59 60 60 /** @} 61 61 */ 62 -
kernel/arch/xen32/src/proc/thread.c
r3e5cc686 r7d3d641 27 27 */ 28 28 29 /** @addtogroup ia32proc29 /** @addtogroup xen32proc 30 30 * @{ 31 31 */ … … 35 35 #include <proc/thread.h> 36 36 37 /** Perform ia32 specific thread initialization.37 /** Perform xen32 specific thread initialization. 38 38 * 39 39 * @param t Thread to be initialized. … … 44 44 } 45 45 46 46 /** @} 47 47 */ 48 -
kernel/arch/xen32/src/xen32.c
r3e5cc686 r7d3d641 65 65 memzone_t meminfo; 66 66 67 extern void xen_callback(void); 68 extern void xen_failsafe_callback(void); 69 67 70 void arch_pre_main(void) 68 71 { … … 76 79 pte.frame_address = ADDR2PFN((uintptr_t) start_info.shared_info); 77 80 xen_update_va_mapping(&shared_info, pte, UVMF_INVLPG); 81 82 xen_set_callbacks(XEN_CS, xen_callback, XEN_CS, xen_failsafe_callback); 78 83 79 84 /* Create identity mapping */ … … 117 122 // bios_init(); 118 123 119 //exc_register(VECTOR_SYSCALL, "syscall", (iroutine) syscall);124 exc_register(VECTOR_SYSCALL, "syscall", (iroutine) syscall); 120 125 121 126 #ifdef CONFIG_SMP 122 //exc_register(VECTOR_TLB_SHOOTDOWN_IPI, "tlb_shootdown",123 //(iroutine) tlb_shootdown_ipi);127 exc_register(VECTOR_TLB_SHOOTDOWN_IPI, "tlb_shootdown", 128 (iroutine) tlb_shootdown_ipi); 124 129 #endif /* CONFIG_SMP */ 125 130 }
Note:
See TracChangeset
for help on using the changeset viewer.