Changeset d7365604 in mainline
- Timestamp:
- 2009-10-22T17:45:31Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- af6cad4
- Parents:
- 50989793 (diff), 5328d63 (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. - Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/cpu/cpu.c
r50989793 rd7365604 130 130 CPU->arch.vendor = VendorUnknown; 131 131 if (has_cpuid()) { 132 cpuid( 0, &info);132 cpuid(INTEL_CPUID_LEVEL, &info); 133 133 134 134 /* … … 150 150 } 151 151 152 cpuid( 1, &info);152 cpuid(INTEL_CPUID_STANDARD, &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
r50989793 rd7365604 50 50 #include <arch/pm.h> 51 51 #include <arch/asm.h> 52 #include <arch/cpuid.h> 52 53 53 54 typedef struct { … … 56 57 unsigned int model; 57 58 unsigned int stepping; 59 cpuid_feature_info fi; 60 58 61 tss_t *tss; 59 62 -
kernel/arch/ia32/include/cpuid.h
r50989793 rd7365604 63 63 64 64 struct __cpuid_feature_info { 65 unsigned : 23; 65 unsigned : 11; 66 unsigned sep : 1; 67 unsigned : 11; 66 68 unsigned mmx : 1; 67 69 unsigned fxsr : 1; -
kernel/arch/ia32/src/boot/boot.S
r50989793 rd7365604 85 85 pse_supported: 86 86 87 bt $(INTEL_SEP), %edx88 jc sep_supported89 90 movl $sep_msg, %esi91 jmp error_halt92 93 sep_supported:94 95 87 #include "vesa_prot.inc" 96 88 … … 225 217 .asciz "Page Size Extension not supported. System halted." 226 218 227 sep_msg:228 .asciz "SYSENTER/SYSEXIT not supported. System halted." -
kernel/arch/ia32/src/cpu/cpu.c
r50989793 rd7365604 92 92 void cpu_arch_init(void) 93 93 { 94 cpuid_feature_info fi;95 94 cpuid_extended_feature_info efi; 96 95 cpu_info_t info; … … 102 101 CPU->fpu_owner = NULL; 103 102 104 cpuid( 1, &info);103 cpuid(INTEL_CPUID_STANDARD, &info); 105 104 106 fi.word = info.cpuid_edx;105 CPU->arch.fi.word = info.cpuid_edx; 107 106 efi.word = info.cpuid_ecx; 108 107 109 if ( fi.bits.fxsr)108 if (CPU->arch.fi.bits.fxsr) 110 109 fpu_fxsr(); 111 110 else 112 111 fpu_fsr(); 113 112 114 if ( fi.bits.sse) {113 if (CPU->arch.fi.bits.sse) { 115 114 asm volatile ( 116 115 "mov %%cr4, %[help]\n" … … 122 121 } 123 122 124 /* Setup fast SYSENTER/SYSEXIT syscalls */ 125 syscall_setup_cpu(); 123 if (CPU->arch.fi.bits.sep) { 124 /* Setup fast SYSENTER/SYSEXIT syscalls */ 125 syscall_setup_cpu(); 126 } 126 127 } 127 128 … … 132 133 CPU->arch.vendor = VendorUnknown; 133 134 if (has_cpuid()) { 134 cpuid( 0, &info);135 cpuid(INTEL_CPUID_LEVEL, &info); 135 136 136 137 /* … … 150 151 CPU->arch.vendor = VendorIntel; 151 152 152 cpuid( 1, &info);153 cpuid(INTEL_CPUID_STANDARD, &info); 153 154 CPU->arch.family = (info.cpuid_eax >> 8) & 0x0f; 154 155 CPU->arch.model = (info.cpuid_eax >> 4) & 0x0f; -
kernel/arch/ia32/src/proc/scheduler.c
r50989793 rd7365604 61 61 SP_DELTA]; 62 62 63 /* Set kernel stack for CP3 -> CPL0 switch via SYSENTER */ 64 write_msr(IA32_MSR_SYSENTER_ESP, kstk); 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 } 65 67 66 68 /* Set kernel stack for CPL3 -> CPL0 switch via interrupt */ -
kernel/arch/ia32/src/userspace.c
r50989793 rd7365604 70 70 "movl %[uarg], %%eax\n" 71 71 72 /* %e bxis defined to hold pcb_ptr - set it to 0 */73 "xorl %%e bx, %%ebx\n"72 /* %edi is defined to hold pcb_ptr - set it to 0 */ 73 "xorl %%edi, %%edi\n" 74 74 75 75 "iret\n" -
uspace/lib/libc/arch/ia32/include/syscall.h
r50989793 rd7365604 40 40 #include <kernel/syscall/syscall.h> 41 41 42 #define __syscall0 __syscall_ sysenter43 #define __syscall1 __syscall_ sysenter44 #define __syscall2 __syscall_ sysenter45 #define __syscall3 __syscall_ sysenter46 #define __syscall4 __syscall_ sysenter47 #define __syscall5 __syscall_ int48 #define __syscall6 __syscall_ int42 #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 49 49 50 50 extern sysarg_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);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); 53 53 54 54 extern sysarg_t 55 __syscall_ int(const sysarg_t, const sysarg_t, const sysarg_t, const sysarg_t,56 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); 57 57 58 58 #endif -
uspace/lib/libc/arch/ia32/src/entry.s
r50989793 rd7365604 27 27 # 28 28 29 INTEL_CPUID_STANDARD = 1 30 INTEL_SEP = 11 31 29 32 .section .init, "ax" 30 33 … … 35 38 ## User-space task entry point 36 39 # 37 # %e bxcontains the PCB pointer40 # %edi contains the PCB pointer 38 41 # 39 42 __entry: … … 44 47 # Do not set %gs, it contains descriptor that can see TLS 45 48 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 46 58 # Pass the PCB pointer to __main as the first argument 47 pushl %e bx59 pushl %edi 48 60 call __main 49 61 -
uspace/lib/libc/arch/ia32/src/syscall.S
r50989793 rd7365604 27 27 # 28 28 29 .data 30 31 .global __syscall_fast_func 32 __syscall_fast_func: 33 .long __syscall_slow 34 29 35 .text 30 36 … … 35 41 * could benefit from this and not save unused registers on the stack. 36 42 */ 37 .global __syscall_ int38 __syscall_ int:43 .global __syscall_slow 44 __syscall_slow: 39 45 pushl %ebx 40 46 pushl %esi … … 64 70 * segment, otherwise the SYSENTER wouldn't work in the first place). 65 71 */ 66 .global __syscall_ sysenter67 __syscall_ sysenter:72 .global __syscall_fast 73 __syscall_fast: 68 74 pushl %ebx 69 75 pushl %esi -
uspace/srv/loader/arch/ia32/ia32.s
r50989793 rd7365604 40 40 movl 0x8(%ebp), %eax 41 41 42 # %e bx:= pcb43 # pcb is passed to the entry point in t %ebx44 mov 0xc(%ebp), %e bx42 # %edi := pcb 43 # pcb is passed to the entry point in %edi 44 mov 0xc(%ebp), %edi 45 45 46 46 # Save a tiny bit of stack space
Note:
See TracChangeset
for help on using the changeset viewer.