Changeset 4003861 in mainline for kernel/arch/ia32/src


Ignore:
Timestamp:
2010-07-14T13:11:59Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
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.
Message:

Merge from lp:~jakub/helenos/upa

Location:
kernel/arch/ia32/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/asm.S

    r6b1a85c r4003861  
    175175
    176176/*
    177  * Size of the entire istate structure including the error word and the
    178  * hardware-saved part.
    179  */
    180 #define ISTATE_REAL_SIZE  (ISTATE_SOFT_SIZE + 24)
    181 
    182 /*
    183177 * The SYSENTER syscall mechanism can be used for syscalls with
    184178 * four or fewer arguments. To pass these four arguments, we
     
    191185.global sysenter_handler
    192186sysenter_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         */
    194192
    195193        /*
     
    260258        movl ISTATE_OFFSET_ESP(%esp), %ecx
    261259
    262         addl $(ISTATE_REAL_SIZE), %esp
    263        
    264260        sysexit   /* return to userspace */
    265261
     
    353349#define ERROR_WORD_INTERRUPT_LIST  0x00027d00
    354350
    355 /** Declare interrupt handlers
    356  *
    357  * Declare interrupt handlers for n interrupt
    358  * vectors starting at vector i.
    359  *
    360  */
    361351.macro handler i
    362352.global int_\i
  • kernel/arch/ia32/src/interrupt.c

    r6b1a85c r4003861  
    6565void istate_decode(istate_t *istate)
    6666{
    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);
    7272        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);
    8480}
    8581
  • kernel/arch/ia32/src/proc/scheduler.c

    r6b1a85c r4003861  
    3838#include <proc/thread.h>
    3939#include <arch.h>
    40 #include <arch/context.h>  /* SP_DELTA */
     40#include <arch/interrupt.h>
    4141#include <arch/pm.h>
    4242#include <arch/asm.h>
     
    5858void before_thread_runs_arch(void)
    5959{
    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];
    6261       
    6362        if (CPU->arch.fi.bits.sep) {
    6463                /* 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));
    6665        }
    6766       
Note: See TracChangeset for help on using the changeset viewer.