Changes in kernel/arch/ia32/src/pm.c [ff586e06:d99c1d2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/pm.c
rff586e06 rd99c1d2 75 75 /* VESA Init descriptor */ 76 76 #ifdef CONFIG_FB 77 { 0xffff, 0, VESA_INIT_SEGMENT >>12, AR_PRESENT | AR_CODE | DPL_KERNEL, 0xf, 0, 0, 0, 0, 0 }78 #endif 77 { 0xffff, 0, VESA_INIT_SEGMENT>>12, AR_PRESENT | AR_CODE | DPL_KERNEL, 0xf, 0, 0, 0, 0, 0 } 78 #endif 79 79 }; 80 80 … … 86 86 87 87 /* gdtr is changed by kmp before next CPU is initialized */ 88 ptr_16_32_t gdtr = { 89 .limit = sizeof(gdt), 90 .base = (uintptr_t) gdt 91 }; 88 ptr_16_32_t bootstrap_gdtr = { .limit = sizeof(gdt), .base = KA2PA((uintptr_t) gdt) }; 89 ptr_16_32_t gdtr = { .limit = sizeof(gdt), .base = (uintptr_t) gdt }; 92 90 93 91 void gdt_setbase(descriptor_t *d, uintptr_t base) … … 130 128 131 129 d->unused = 0; 132 d->selector = GDT_SELECTOR(KTEXT_DES); 130 d->selector = gdtselector(KTEXT_DES); 131 132 d->access = AR_PRESENT | AR_INTERRUPT; /* masking interrupt */ 133 133 134 134 if (i == VECTOR_SYSCALL) { 135 135 /* 136 * The syscall trap gate must be callable from137 * userland. Interrupts will remain enabled.136 * The syscall interrupt gate must be calleable from 137 * userland. 138 138 */ 139 d->access = AR_PRESENT | AR_TRAP | DPL_USER; 140 } else { 141 /* 142 * Other interrupts use interrupt gates which 143 * disable interrupts. 144 */ 145 d->access = AR_PRESENT | AR_INTERRUPT; 139 d->access |= DPL_USER; 146 140 } 141 142 idt_setoffset(d, ((uintptr_t) interrupt_handlers) + 143 i * interrupt_handler_size); 147 144 } 148 149 d = &idt[0]; 150 idt_setoffset(d++, (uintptr_t) &int_0); 151 idt_setoffset(d++, (uintptr_t) &int_1); 152 idt_setoffset(d++, (uintptr_t) &int_2); 153 idt_setoffset(d++, (uintptr_t) &int_3); 154 idt_setoffset(d++, (uintptr_t) &int_4); 155 idt_setoffset(d++, (uintptr_t) &int_5); 156 idt_setoffset(d++, (uintptr_t) &int_6); 157 idt_setoffset(d++, (uintptr_t) &int_7); 158 idt_setoffset(d++, (uintptr_t) &int_8); 159 idt_setoffset(d++, (uintptr_t) &int_9); 160 idt_setoffset(d++, (uintptr_t) &int_10); 161 idt_setoffset(d++, (uintptr_t) &int_11); 162 idt_setoffset(d++, (uintptr_t) &int_12); 163 idt_setoffset(d++, (uintptr_t) &int_13); 164 idt_setoffset(d++, (uintptr_t) &int_14); 165 idt_setoffset(d++, (uintptr_t) &int_15); 166 idt_setoffset(d++, (uintptr_t) &int_16); 167 idt_setoffset(d++, (uintptr_t) &int_17); 168 idt_setoffset(d++, (uintptr_t) &int_18); 169 idt_setoffset(d++, (uintptr_t) &int_19); 170 idt_setoffset(d++, (uintptr_t) &int_20); 171 idt_setoffset(d++, (uintptr_t) &int_21); 172 idt_setoffset(d++, (uintptr_t) &int_22); 173 idt_setoffset(d++, (uintptr_t) &int_23); 174 idt_setoffset(d++, (uintptr_t) &int_24); 175 idt_setoffset(d++, (uintptr_t) &int_25); 176 idt_setoffset(d++, (uintptr_t) &int_26); 177 idt_setoffset(d++, (uintptr_t) &int_27); 178 idt_setoffset(d++, (uintptr_t) &int_28); 179 idt_setoffset(d++, (uintptr_t) &int_29); 180 idt_setoffset(d++, (uintptr_t) &int_30); 181 idt_setoffset(d++, (uintptr_t) &int_31); 182 idt_setoffset(d++, (uintptr_t) &int_32); 183 idt_setoffset(d++, (uintptr_t) &int_33); 184 idt_setoffset(d++, (uintptr_t) &int_34); 185 idt_setoffset(d++, (uintptr_t) &int_35); 186 idt_setoffset(d++, (uintptr_t) &int_36); 187 idt_setoffset(d++, (uintptr_t) &int_37); 188 idt_setoffset(d++, (uintptr_t) &int_38); 189 idt_setoffset(d++, (uintptr_t) &int_39); 190 idt_setoffset(d++, (uintptr_t) &int_40); 191 idt_setoffset(d++, (uintptr_t) &int_41); 192 idt_setoffset(d++, (uintptr_t) &int_42); 193 idt_setoffset(d++, (uintptr_t) &int_43); 194 idt_setoffset(d++, (uintptr_t) &int_44); 195 idt_setoffset(d++, (uintptr_t) &int_45); 196 idt_setoffset(d++, (uintptr_t) &int_46); 197 idt_setoffset(d++, (uintptr_t) &int_47); 198 idt_setoffset(d++, (uintptr_t) &int_48); 199 idt_setoffset(d++, (uintptr_t) &int_49); 200 idt_setoffset(d++, (uintptr_t) &int_50); 201 idt_setoffset(d++, (uintptr_t) &int_51); 202 idt_setoffset(d++, (uintptr_t) &int_52); 203 idt_setoffset(d++, (uintptr_t) &int_53); 204 idt_setoffset(d++, (uintptr_t) &int_54); 205 idt_setoffset(d++, (uintptr_t) &int_55); 206 idt_setoffset(d++, (uintptr_t) &int_56); 207 idt_setoffset(d++, (uintptr_t) &int_57); 208 idt_setoffset(d++, (uintptr_t) &int_58); 209 idt_setoffset(d++, (uintptr_t) &int_59); 210 idt_setoffset(d++, (uintptr_t) &int_60); 211 idt_setoffset(d++, (uintptr_t) &int_61); 212 idt_setoffset(d++, (uintptr_t) &int_62); 213 idt_setoffset(d++, (uintptr_t) &int_63); 214 215 idt_setoffset(&idt[VECTOR_SYSCALL], (uintptr_t) &int_syscall); 216 } 145 } 146 217 147 218 148 /* Clean IOPL(12,13) and NT(14) flags in EFLAGS register */ … … 285 215 * to its own TSS. We just need to load the TR register. 286 216 */ 287 tr_load( GDT_SELECTOR(TSS_DES));217 tr_load(gdtselector(TSS_DES)); 288 218 289 219 clean_IOPL_NT_flags(); /* Disable I/O on nonprivileged levels and clear NT flag. */
Note:
See TracChangeset
for help on using the changeset viewer.