Changeset d5f8f19 in mainline for kernel/arch


Ignore:
Timestamp:
2009-08-08T13:17:08Z (16 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
42cfd91, 54d0ddc
Parents:
a7de7907 (diff), 8688a6e (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 mainline changes.

Location:
kernel/arch
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/include/cpu.h

    ra7de7907 rd5f8f19  
    3636#define KERN_amd64_CPU_H_
    3737
    38 #define RFLAGS_IF  (1 << 9)
    39 #define RFLAGS_DF  (1 << 10)
    40 #define RFLAGS_RF  (1 << 16)
     38#define RFLAGS_CF       (1 << 0)
     39#define RFLAGS_PF       (1 << 2)
     40#define RFLAGS_AF       (1 << 4)
     41#define RFLAGS_ZF       (1 << 6)
     42#define RFLAGS_SF       (1 << 7)
     43#define RFLAGS_TF       (1 << 8)
     44#define RFLAGS_IF       (1 << 9)
     45#define RFLAGS_DF       (1 << 10)
     46#define RFLAGS_OF       (1 << 11)
     47#define RFLAGS_RF       (1 << 16)
    4148
    4249#define EFER_MSR_NUM    0xc0000080
  • kernel/arch/amd64/src/userspace.c

    ra7de7907 rd5f8f19  
    3434
    3535#include <userspace.h>
     36#include <arch/cpu.h>
    3637#include <arch/pm.h>
    3738#include <arch/types.h>
     
    5051        ipl_t ipl = interrupts_disable();
    5152       
    52         /* Clear CF, PF, AF, ZF, SF, DF, OF */
    53         ipl &= ~(0xcd4);
     53        ipl &= ~(RFLAGS_CF | RFLAGS_PF | RFLAGS_AF | RFLAGS_ZF | RFLAGS_SF |
     54            RFLAGS_DF | RFLAGS_OF);
    5455       
    5556        asm volatile (
    56                         "pushq %[udata_des]\n"
    57                         "pushq %[stack_size]\n"
    58                         "pushq %[ipl]\n"
    59                         "pushq %[utext_des]\n"
    60                         "pushq %[entry]\n"
    61                         "movq %[uarg], %%rax\n"
     57                "pushq %[udata_des]\n"
     58                "pushq %[stack_size]\n"
     59                "pushq %[ipl]\n"
     60                "pushq %[utext_des]\n"
     61                "pushq %[entry]\n"
     62                "movq %[uarg], %%rax\n"
    6263                       
    63                         /* %rdi is defined to hold pcb_ptr - set it to 0 */
    64                         "xorq %%rdi, %%rdi\n"
    65                         "iretq\n"
    66                         :: [udata_des] "i" (gdtselector(UDATA_DES) | PL_USER),
    67                            [stack_size] "r" (kernel_uarg->uspace_stack + THREAD_STACK_SIZE),
    68                            [ipl] "r" (ipl),
    69                            [utext_des] "i" (gdtselector(UTEXT_DES) | PL_USER),
    70                            [entry] "r" (kernel_uarg->uspace_entry),
    71                            [uarg] "r" (kernel_uarg->uspace_uarg)
    72                         : "rax"
    73                 );
     64                /* %rdi is defined to hold pcb_ptr - set it to 0 */
     65                "xorq %%rdi, %%rdi\n"
     66                "iretq\n"
     67                :: [udata_des] "i" (gdtselector(UDATA_DES) | PL_USER),
     68                   [stack_size] "r" (kernel_uarg->uspace_stack + THREAD_STACK_SIZE),
     69                   [ipl] "r" (ipl),
     70                   [utext_des] "i" (gdtselector(UTEXT_DES) | PL_USER),
     71                   [entry] "r" (kernel_uarg->uspace_entry),
     72                   [uarg] "r" (kernel_uarg->uspace_uarg)
     73                : "rax"
     74        );
    7475       
    7576        /* Unreachable */
    76         while (1);
     77        while (1)
     78                ;
    7779}
    7880
  • kernel/arch/sparc64/src/sparc64.c

    ra7de7907 rd5f8f19  
    135135void userspace(uspace_arg_t *kernel_uarg)
    136136{
     137        (void) interrupts_disable();
    137138        switch_to_userspace((uintptr_t) kernel_uarg->uspace_entry,
    138139            ((uintptr_t) kernel_uarg->uspace_stack) + STACK_SIZE
Note: See TracChangeset for help on using the changeset viewer.