Changes in / [d7365604:50989793] in mainline


Ignore:
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/cpu/cpu.c

    rd7365604 r50989793  
    130130        CPU->arch.vendor = VendorUnknown;
    131131        if (has_cpuid()) {
    132                 cpuid(INTEL_CPUID_LEVEL, &info);
     132                cpuid(0, &info);
    133133
    134134                /*
     
    150150                }
    151151                               
    152                 cpuid(INTEL_CPUID_STANDARD, &info);
     152                cpuid(1, &info);
    153153                CPU->arch.family = (info.cpuid_eax >> 8) & 0xf;
    154154                CPU->arch.model = (info.cpuid_eax >> 4) & 0xf;
  • kernel/arch/ia32/include/cpu.h

    rd7365604 r50989793  
    5050#include <arch/pm.h>
    5151#include <arch/asm.h>
    52 #include <arch/cpuid.h>
    5352
    5453typedef struct {
     
    5756        unsigned int model;
    5857        unsigned int stepping;
    59         cpuid_feature_info fi;
    60 
    6158        tss_t *tss;
    6259       
  • kernel/arch/ia32/include/cpuid.h

    rd7365604 r50989793  
    6363
    6464struct __cpuid_feature_info {
    65         unsigned      : 11;
    66         unsigned sep  :  1;
    67         unsigned      : 11;
     65        unsigned                        : 23;
    6866        unsigned mmx  :  1;
    6967        unsigned fxsr :  1;
  • kernel/arch/ia32/src/boot/boot.S

    rd7365604 r50989793  
    8585        pse_supported:
    8686       
     87        bt $(INTEL_SEP), %edx
     88        jc sep_supported
     89       
     90                movl $sep_msg, %esi
     91                jmp error_halt
     92       
     93        sep_supported:
     94
    8795#include "vesa_prot.inc"
    8896
     
    217225        .asciz "Page Size Extension not supported. System halted."
    218226
     227sep_msg:
     228        .asciz "SYSENTER/SYSEXIT not supported. System halted."
  • kernel/arch/ia32/src/cpu/cpu.c

    rd7365604 r50989793  
    9292void cpu_arch_init(void)
    9393{
     94        cpuid_feature_info fi;
    9495        cpuid_extended_feature_info efi;
    9596        cpu_info_t info;
     
    101102        CPU->fpu_owner = NULL;
    102103       
    103         cpuid(INTEL_CPUID_STANDARD, &info);
     104        cpuid(1, &info);
    104105       
    105         CPU->arch.fi.word = info.cpuid_edx;
     106        fi.word = info.cpuid_edx;
    106107        efi.word = info.cpuid_ecx;
    107108       
    108         if (CPU->arch.fi.bits.fxsr)
     109        if (fi.bits.fxsr)
    109110                fpu_fxsr();
    110111        else
    111112                fpu_fsr();
    112113       
    113         if (CPU->arch.fi.bits.sse) {
     114        if (fi.bits.sse) {
    114115                asm volatile (
    115116                        "mov %%cr4, %[help]\n"
     
    121122        }
    122123       
    123         if (CPU->arch.fi.bits.sep) {
    124                 /* Setup fast SYSENTER/SYSEXIT syscalls */
    125                 syscall_setup_cpu();
    126         }
     124        /* Setup fast SYSENTER/SYSEXIT syscalls */
     125        syscall_setup_cpu();
    127126}
    128127
     
    133132        CPU->arch.vendor = VendorUnknown;
    134133        if (has_cpuid()) {
    135                 cpuid(INTEL_CPUID_LEVEL, &info);
     134                cpuid(0, &info);
    136135
    137136                /*
     
    151150                        CPU->arch.vendor = VendorIntel;
    152151               
    153                 cpuid(INTEL_CPUID_STANDARD, &info);
     152                cpuid(1, &info);
    154153                CPU->arch.family = (info.cpuid_eax >> 8) & 0x0f;
    155154                CPU->arch.model = (info.cpuid_eax >> 4) & 0x0f;
  • kernel/arch/ia32/src/proc/scheduler.c

    rd7365604 r50989793  
    6161            SP_DELTA];
    6262       
    63         if (CPU->arch.fi.bits.sep) {
    64                 /* Set kernel stack for CP3 -> CPL0 switch via SYSENTER */
    65                 write_msr(IA32_MSR_SYSENTER_ESP, kstk);
    66         }
     63        /* Set kernel stack for CP3 -> CPL0 switch via SYSENTER */
     64        write_msr(IA32_MSR_SYSENTER_ESP, kstk);
    6765       
    6866        /* Set kernel stack for CPL3 -> CPL0 switch via interrupt */
  • kernel/arch/ia32/src/userspace.c

    rd7365604 r50989793  
    7070                "movl %[uarg], %%eax\n"
    7171               
    72                 /* %edi is defined to hold pcb_ptr - set it to 0 */
    73                 "xorl %%edi, %%edi\n"
     72                /* %ebx is defined to hold pcb_ptr - set it to 0 */
     73                "xorl %%ebx, %%ebx\n"
    7474               
    7575                "iret\n"
  • uspace/lib/libc/arch/ia32/include/syscall.h

    rd7365604 r50989793  
    4040#include <kernel/syscall/syscall.h>
    4141
    42 #define __syscall0      __syscall_fast_func
    43 #define __syscall1      __syscall_fast_func
    44 #define __syscall2      __syscall_fast_func
    45 #define __syscall3      __syscall_fast_func
    46 #define __syscall4      __syscall_fast_func
    47 #define __syscall5      __syscall_slow
    48 #define __syscall6      __syscall_slow
     42#define __syscall0      __syscall_sysenter
     43#define __syscall1      __syscall_sysenter
     44#define __syscall2      __syscall_sysenter
     45#define __syscall3      __syscall_sysenter
     46#define __syscall4      __syscall_sysenter
     47#define __syscall5      __syscall_int
     48#define __syscall6      __syscall_int
    4949
    5050extern sysarg_t
    51 (* __syscall_fast_func)(const sysarg_t, const sysarg_t, const sysarg_t,
    52     const sysarg_t, const sysarg_t, const sysarg_t, const syscall_t);
     51__syscall_sysenter(const sysarg_t, const sysarg_t, const sysarg_t, const sysarg_t,
     52    const sysarg_t, const sysarg_t, const syscall_t);
    5353
    5454extern sysarg_t
    55 __syscall_slow(const sysarg_t, const sysarg_t, const sysarg_t, const sysarg_t,
    56     const sysarg_t, const sysarg_t, const syscall_t);
     55__syscall_int(const sysarg_t, const sysarg_t, const sysarg_t, const sysarg_t,
     56     const sysarg_t, const sysarg_t, const syscall_t);
    5757
    5858#endif
  • uspace/lib/libc/arch/ia32/src/entry.s

    rd7365604 r50989793  
    2727#
    2828
    29 INTEL_CPUID_STANDARD = 1
    30 INTEL_SEP = 11
    31 
    3229.section .init, "ax"
    3330
     
    3835## User-space task entry point
    3936#
    40 # %edi contains the PCB pointer
     37# %ebx contains the PCB pointer
    4138#
    4239__entry:
     
    4744        # Do not set %gs, it contains descriptor that can see TLS
    4845
    49         # Detect the mechanism used for making syscalls
    50         movl $(INTEL_CPUID_STANDARD), %eax
    51         cpuid
    52         bt $(INTEL_SEP), %edx
    53         jnc 0f
    54         leal __syscall_fast_func, %eax
    55         movl $__syscall_fast, (%eax)
    56 0:
    57 
    5846        # Pass the PCB pointer to __main as the first argument
    59         pushl %edi
     47        pushl %ebx
    6048        call __main
    6149
  • uspace/lib/libc/arch/ia32/src/syscall.S

    rd7365604 r50989793  
    2727#
    2828
    29 .data
    30 
    31 .global __syscall_fast_func
    32 __syscall_fast_func:
    33         .long __syscall_slow
    34 
    3529.text
    3630
     
    4135 * could benefit from this and not save unused registers on the stack.
    4236 */
    43 .global __syscall_slow
    44 __syscall_slow:
     37.global __syscall_int
     38__syscall_int:
    4539        pushl %ebx
    4640        pushl %esi
     
    7064 * segment, otherwise the SYSENTER wouldn't work in the first place).
    7165 */
    72 .global __syscall_fast
    73 __syscall_fast:
     66.global __syscall_sysenter
     67__syscall_sysenter:
    7468        pushl %ebx
    7569        pushl %esi
  • uspace/srv/loader/arch/ia32/ia32.s

    rd7365604 r50989793  
    4040        movl 0x8(%ebp), %eax
    4141
    42         # %edi := pcb
    43         # pcb is passed to the entry point in %edi
    44         mov 0xc(%ebp), %edi
     42        # %ebx := pcb
     43        # pcb is passed to the entry point int %ebx
     44        mov 0xc(%ebp), %ebx
    4545
    4646        # Save a tiny bit of stack space
Note: See TracChangeset for help on using the changeset viewer.