Changes in kernel/arch/ia32/src/asm.S [0f17bff:8d427a3] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/asm.S
r0f17bff r8d427a3 31 31 */ 32 32 33 #include <abi/asmtool.h>34 33 #include <arch/pm.h> 35 34 #include <arch/cpu.h> 36 35 #include <arch/mm/page.h> 37 36 #include <arch/istate_struct.h> 38 #include <arch/smp/apic.h>39 37 40 38 .text 39 .global paging_on 40 .global enable_l_apic_in_msr 41 .global memcpy_from_uspace 42 .global memcpy_from_uspace_failover_address 43 .global memcpy_to_uspace 44 .global memcpy_to_uspace_failover_address 45 .global early_putchar 41 46 42 47 #define MEMCPY_DST 4 … … 59 64 * 60 65 */ 61 FUNCTION_BEGIN(memcpy_from_uspace) 62 FUNCTION_BEGIN(memcpy_to_uspace) 66 memcpy_from_uspace: 67 memcpy_to_uspace: 63 68 movl %edi, %edx /* save %edi */ 64 69 movl %esi, %eax /* save %esi */ … … 88 93 movl MEMCPY_DST(%esp), %eax 89 94 ret 90 FUNCTION_END(memcpy_from_uspace)91 FUNCTION_END(memcpy_to_uspace)92 95 93 96 /* … … 95 98 * above had caused a page fault. 96 99 */ 97 SYMBOL(memcpy_from_uspace_failover_address) 98 SYMBOL(memcpy_to_uspace_failover_address) 100 memcpy_from_uspace_failover_address: 101 memcpy_to_uspace_failover_address: 99 102 movl %edx, %edi 100 103 movl %eax, %esi … … 109 112 * 110 113 */ 111 FUNCTION_BEGIN(paging_on) 114 paging_on: 112 115 movl %cr0, %edx 113 orl $ CR0_PG, %edx /* paging on */116 orl $(1 << 31), %edx /* paging on */ 114 117 115 118 /* Clear Cache Disable and not Write Though */ 116 andl $~( CR0_CD | CR0_NW), %edx119 andl $~((1 << 30) | (1 << 29)), %edx 117 120 movl %edx, %cr0 118 121 jmp 0f … … 120 123 0: 121 124 ret 122 FUNCTION_END(paging_on)123 125 124 126 /** Enable local APIC … … 127 129 * 128 130 */ 129 FUNCTION_BEGIN(enable_l_apic_in_msr) 130 movl $ IA32_MSR_APIC_BASE, %ecx131 enable_l_apic_in_msr: 132 movl $0x1b, %ecx 131 133 rdmsr 132 orl $(L_APIC_BASE | IA32_APIC_BASE_GE), %eax 134 orl $(1 << 11), %eax 135 orl $(0xfee00000), %eax 133 136 wrmsr 134 137 ret 135 FUNCTION_END(enable_l_apic_in_msr)136 138 137 139 /* … … 150 152 * entirely in registers. 151 153 */ 152 SYMBOL(sysenter_handler) 154 .global sysenter_handler 155 sysenter_handler: 153 156 154 157 /* … … 183 186 184 187 /* 188 * Save TLS. 189 */ 190 movl %gs, %edx 191 movl %edx, ISTATE_OFFSET_GS(%esp) 192 193 /* 185 194 * Switch to kernel selectors. 186 195 */ 187 movl $(GDT_SELECTOR(KDATA_DES)), %eax 188 movl %eax, %ds 189 movl %eax, %es 190 movl $(GDT_SELECTOR(VREG_DES)), %eax 191 movl %eax, %gs 196 movw $(GDT_SELECTOR(KDATA_DES)), %ax 197 movw %ax, %ds 198 movw %ax, %es 192 199 193 200 /* … … 209 216 210 217 /* 218 * Restore TLS. 219 */ 220 movl ISTATE_OFFSET_GS(%esp), %edx 221 movl %edx, %gs 222 223 /* 211 224 * Prepare return address and userspace stack for SYSEXIT. 212 225 */ … … 219 232 * This is the legacy syscall handler using the interrupt mechanism. 220 233 */ 221 SYMBOL(int_syscall) 234 .global int_syscall 235 int_syscall: 222 236 subl $(ISTATE_SOFT_SIZE + 4), %esp 223 237 … … 242 256 243 257 /* 244 * Save the se gmentregisters.258 * Save the selector registers. 245 259 */ 246 260 movl %gs, %ecx … … 262 276 movl %eax, %ds 263 277 movl %eax, %es 264 movl $(GDT_SELECTOR(VREG_DES)), %eax265 movl %eax, %gs266 278 267 279 movl $0, ISTATE_OFFSET_EBP_FRAME(%esp) … … 276 288 277 289 /* 278 * Restore the se gmentregisters.290 * Restore the selector registers. 279 291 */ 280 292 movl ISTATE_OFFSET_GS(%esp), %ecx … … 307 319 308 320 .macro handler i 309 SYMBOL(int_\i) 321 .global int_\i 322 int_\i: 310 323 /* 311 324 * This macro distinguishes between two versions of ia32 … … 346 359 347 360 /* 348 * Save the se gmentregisters.361 * Save the selector registers. 349 362 */ 350 363 movl %gs, %ecx … … 366 379 movl %eax, %ds 367 380 movl %eax, %es 368 movl $(GDT_SELECTOR(VREG_DES)), %eax369 movl %eax, %gs370 381 371 382 /* … … 451 462 * 452 463 */ 453 FUNCTION_BEGIN(early_putchar) 464 early_putchar: 454 465 455 466 #if ((defined(CONFIG_EGA)) && (!defined(CONFIG_FB))) … … 583 594 584 595 ret 585 FUNCTION_END(early_putchar) 586 596
Note:
See TracChangeset
for help on using the changeset viewer.