Changeset 4003861 in mainline for kernel/arch/ia32/src
- Timestamp:
- 2010-07-14T13:11:59Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 074c9bd, aa0d227
- Parents:
- 6b1a85c (diff), f77e591d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- kernel/arch/ia32/src
- Files:
-
- 3 edited
-
asm.S (modified) (4 diffs)
-
interrupt.c (modified) (1 diff)
-
proc/scheduler.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/asm.S
r6b1a85c r4003861 175 175 176 176 /* 177 * Size of the entire istate structure including the error word and the178 * hardware-saved part.179 */180 #define ISTATE_REAL_SIZE (ISTATE_SOFT_SIZE + 24)181 182 /*183 177 * The SYSENTER syscall mechanism can be used for syscalls with 184 178 * four or fewer arguments. To pass these four arguments, we … … 191 185 .global sysenter_handler 192 186 sysenter_handler: 193 subl $(ISTATE_REAL_SIZE), %esp 187 188 /* 189 * Note that the space needed for the istate structure has been 190 * preallocated on the stack by before_thread_runs_arch(). 191 */ 194 192 195 193 /* … … 260 258 movl ISTATE_OFFSET_ESP(%esp), %ecx 261 259 262 addl $(ISTATE_REAL_SIZE), %esp263 264 260 sysexit /* return to userspace */ 265 261 … … 353 349 #define ERROR_WORD_INTERRUPT_LIST 0x00027d00 354 350 355 /** Declare interrupt handlers356 *357 * Declare interrupt handlers for n interrupt358 * vectors starting at vector i.359 *360 */361 351 .macro handler i 362 352 .global int_\i -
kernel/arch/ia32/src/interrupt.c
r6b1a85c r4003861 65 65 void istate_decode(istate_t *istate) 66 66 { 67 printf(" error_word=%p\n", istate->error_word);68 printf("eflags=%p\n", istate->eflags);69 70 printf(" cs =%p\tds =%p\tes =%p\n", istate->cs, istate->ds, istate->es);71 printf("fs =%p\tgs =%p", istate->fs, istate->gs);67 printf("cs =%p\teip=%p\tefl=%p\terr=%p\n", 68 istate->cs, istate->eip, istate->eflags, istate->error_word); 69 70 printf("ds =%p\tes =%p\tfs =%p\tgs =%p\n", 71 istate->ds, istate->es, istate->fs, istate->gs); 72 72 if (istate_from_uspace(istate)) 73 printf("\tss =%p\n", istate->ss); 74 else 75 printf("\n"); 76 77 printf("eax=%p\tebx=%p\tecx=%p\n", istate->eax, istate->ebx, 78 istate->ecx); 79 printf("edx=%p\tedi=%p\tesi=%p\n", istate->edx, istate->edi, 80 istate->esi); 81 printf("ebp=%p\tesp=%p\teip=%p\n", istate->ebp, 82 istate_from_uspace(istate) ? istate->esp : (uintptr_t) &istate->esp, 83 istate->eip); 73 printf("ss =%p\n", istate->ss); 74 75 printf("eax=%p\tebx=%p\tecx=%p\tedx=%p\n", 76 istate->eax, istate->ebx, istate->ecx, istate->edx); 77 printf("esi=%p\tedi=%p\tebp=%p\tesp=%p\n", 78 istate->esi, istate->edi, istate->ebp, 79 istate_from_uspace(istate) ? istate->esp : (uintptr_t)&istate->esp); 84 80 } 85 81 -
kernel/arch/ia32/src/proc/scheduler.c
r6b1a85c r4003861 38 38 #include <proc/thread.h> 39 39 #include <arch.h> 40 #include <arch/ context.h> /* SP_DELTA */40 #include <arch/interrupt.h> 41 41 #include <arch/pm.h> 42 42 #include <arch/asm.h> … … 58 58 void before_thread_runs_arch(void) 59 59 { 60 uintptr_t kstk = (uintptr_t) &THREAD->kstack[THREAD_STACK_SIZE - 61 SP_DELTA]; 60 uintptr_t kstk = (uintptr_t) &THREAD->kstack[THREAD_STACK_SIZE]; 62 61 63 62 if (CPU->arch.fi.bits.sep) { 64 63 /* Set kernel stack for CP3 -> CPL0 switch via SYSENTER */ 65 write_msr(IA32_MSR_SYSENTER_ESP, kstk );64 write_msr(IA32_MSR_SYSENTER_ESP, kstk - sizeof(istate_t)); 66 65 } 67 66
Note:
See TracChangeset
for help on using the changeset viewer.
