Changes in / [d7365604:50989793] in mainline
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/cpu/cpu.c
rd7365604 r50989793 130 130 CPU->arch.vendor = VendorUnknown; 131 131 if (has_cpuid()) { 132 cpuid( INTEL_CPUID_LEVEL, &info);132 cpuid(0, &info); 133 133 134 134 /* … … 150 150 } 151 151 152 cpuid( INTEL_CPUID_STANDARD, &info);152 cpuid(1, &info); 153 153 CPU->arch.family = (info.cpuid_eax >> 8) & 0xf; 154 154 CPU->arch.model = (info.cpuid_eax >> 4) & 0xf; -
kernel/arch/ia32/include/cpu.h
rd7365604 r50989793 50 50 #include <arch/pm.h> 51 51 #include <arch/asm.h> 52 #include <arch/cpuid.h>53 52 54 53 typedef struct { … … 57 56 unsigned int model; 58 57 unsigned int stepping; 59 cpuid_feature_info fi;60 61 58 tss_t *tss; 62 59 -
kernel/arch/ia32/include/cpuid.h
rd7365604 r50989793 63 63 64 64 struct __cpuid_feature_info { 65 unsigned : 11; 66 unsigned sep : 1; 67 unsigned : 11; 65 unsigned : 23; 68 66 unsigned mmx : 1; 69 67 unsigned fxsr : 1; -
kernel/arch/ia32/src/boot/boot.S
rd7365604 r50989793 85 85 pse_supported: 86 86 87 bt $(INTEL_SEP), %edx 88 jc sep_supported 89 90 movl $sep_msg, %esi 91 jmp error_halt 92 93 sep_supported: 94 87 95 #include "vesa_prot.inc" 88 96 … … 217 225 .asciz "Page Size Extension not supported. System halted." 218 226 227 sep_msg: 228 .asciz "SYSENTER/SYSEXIT not supported. System halted." -
kernel/arch/ia32/src/cpu/cpu.c
rd7365604 r50989793 92 92 void cpu_arch_init(void) 93 93 { 94 cpuid_feature_info fi; 94 95 cpuid_extended_feature_info efi; 95 96 cpu_info_t info; … … 101 102 CPU->fpu_owner = NULL; 102 103 103 cpuid( INTEL_CPUID_STANDARD, &info);104 cpuid(1, &info); 104 105 105 CPU->arch.fi.word = info.cpuid_edx;106 fi.word = info.cpuid_edx; 106 107 efi.word = info.cpuid_ecx; 107 108 108 if ( CPU->arch.fi.bits.fxsr)109 if (fi.bits.fxsr) 109 110 fpu_fxsr(); 110 111 else 111 112 fpu_fsr(); 112 113 113 if ( CPU->arch.fi.bits.sse) {114 if (fi.bits.sse) { 114 115 asm volatile ( 115 116 "mov %%cr4, %[help]\n" … … 121 122 } 122 123 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(); 127 126 } 128 127 … … 133 132 CPU->arch.vendor = VendorUnknown; 134 133 if (has_cpuid()) { 135 cpuid( INTEL_CPUID_LEVEL, &info);134 cpuid(0, &info); 136 135 137 136 /* … … 151 150 CPU->arch.vendor = VendorIntel; 152 151 153 cpuid( INTEL_CPUID_STANDARD, &info);152 cpuid(1, &info); 154 153 CPU->arch.family = (info.cpuid_eax >> 8) & 0x0f; 155 154 CPU->arch.model = (info.cpuid_eax >> 4) & 0x0f; -
kernel/arch/ia32/src/proc/scheduler.c
rd7365604 r50989793 61 61 SP_DELTA]; 62 62 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); 67 65 68 66 /* Set kernel stack for CPL3 -> CPL0 switch via interrupt */ -
kernel/arch/ia32/src/userspace.c
rd7365604 r50989793 70 70 "movl %[uarg], %%eax\n" 71 71 72 /* %e diis defined to hold pcb_ptr - set it to 0 */73 "xorl %%e di, %%edi\n"72 /* %ebx is defined to hold pcb_ptr - set it to 0 */ 73 "xorl %%ebx, %%ebx\n" 74 74 75 75 "iret\n" -
uspace/lib/libc/arch/ia32/include/syscall.h
rd7365604 r50989793 40 40 #include <kernel/syscall/syscall.h> 41 41 42 #define __syscall0 __syscall_ fast_func43 #define __syscall1 __syscall_ fast_func44 #define __syscall2 __syscall_ fast_func45 #define __syscall3 __syscall_ fast_func46 #define __syscall4 __syscall_ fast_func47 #define __syscall5 __syscall_ slow48 #define __syscall6 __syscall_ slow42 #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 49 49 50 50 extern 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); 53 53 54 54 extern 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); 57 57 58 58 #endif -
uspace/lib/libc/arch/ia32/src/entry.s
rd7365604 r50989793 27 27 # 28 28 29 INTEL_CPUID_STANDARD = 130 INTEL_SEP = 1131 32 29 .section .init, "ax" 33 30 … … 38 35 ## User-space task entry point 39 36 # 40 # %e dicontains the PCB pointer37 # %ebx contains the PCB pointer 41 38 # 42 39 __entry: … … 47 44 # Do not set %gs, it contains descriptor that can see TLS 48 45 49 # Detect the mechanism used for making syscalls50 movl $(INTEL_CPUID_STANDARD), %eax51 cpuid52 bt $(INTEL_SEP), %edx53 jnc 0f54 leal __syscall_fast_func, %eax55 movl $__syscall_fast, (%eax)56 0:57 58 46 # Pass the PCB pointer to __main as the first argument 59 pushl %e di47 pushl %ebx 60 48 call __main 61 49 -
uspace/lib/libc/arch/ia32/src/syscall.S
rd7365604 r50989793 27 27 # 28 28 29 .data30 31 .global __syscall_fast_func32 __syscall_fast_func:33 .long __syscall_slow34 35 29 .text 36 30 … … 41 35 * could benefit from this and not save unused registers on the stack. 42 36 */ 43 .global __syscall_ slow44 __syscall_ slow:37 .global __syscall_int 38 __syscall_int: 45 39 pushl %ebx 46 40 pushl %esi … … 70 64 * segment, otherwise the SYSENTER wouldn't work in the first place). 71 65 */ 72 .global __syscall_ fast73 __syscall_ fast:66 .global __syscall_sysenter 67 __syscall_sysenter: 74 68 pushl %ebx 75 69 pushl %esi -
uspace/srv/loader/arch/ia32/ia32.s
rd7365604 r50989793 40 40 movl 0x8(%ebp), %eax 41 41 42 # %e di:= pcb43 # pcb is passed to the entry point in %edi44 mov 0xc(%ebp), %e di42 # %ebx := pcb 43 # pcb is passed to the entry point int %ebx 44 mov 0xc(%ebp), %ebx 45 45 46 46 # Save a tiny bit of stack space
Note:
See TracChangeset
for help on using the changeset viewer.