Changeset 985e26d2 in mainline for kernel/arch/ia32
- Timestamp:
- 2010-01-07T19:06:59Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8190e63
- Parents:
- 743e17b (diff), eca2435 (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. - Location:
- kernel/arch/ia32
- Files:
-
- 11 edited
-
Makefile.inc (modified) (3 diffs)
-
include/cpu.h (modified) (2 diffs)
-
include/cpuid.h (modified) (1 diff)
-
include/mm/page.h (modified) (1 diff)
-
include/types.h (modified) (1 diff)
-
src/boot/boot.S (modified) (2 diffs)
-
src/cpu/cpu.c (modified) (5 diffs)
-
src/ia32.c (modified) (3 diffs)
-
src/interrupt.c (modified) (2 diffs)
-
src/proc/scheduler.c (modified) (1 diff)
-
src/userspace.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/Makefile.inc
r743e17b r985e26d2 34 34 BFD = binary 35 35 TARGET = i686-pc-linux-gnu 36 CLANG_ARCH = i386 36 37 TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia32 37 38 … … 43 44 ICC_CFLAGS += $(CMN1) 44 45 SUNCC_CFLAGS += $(CMN1) 46 CLANG_CFLAGS += $(CMN1) 45 47 46 48 ## Accepted CPUs … … 71 73 GCC_CFLAGS += $(CMN2) 72 74 ICC_CFLAGS += $(CMN2) 75 CLANG_CFLAGS += $(CMN2) 73 76 74 77 ARCH_SOURCES = \ -
kernel/arch/ia32/include/cpu.h
r743e17b r985e26d2 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
r743e17b r985e26d2 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/include/mm/page.h
r743e17b r985e26d2 146 146 #define PFERR_CODE_RSVD (1 << 3) 147 147 148 static inline int get_pt_flags(pte_t *pt, size_t i) 148 /** Page Table Entry. */ 149 typedef struct { 150 unsigned present : 1; 151 unsigned writeable : 1; 152 unsigned uaccessible : 1; 153 unsigned page_write_through : 1; 154 unsigned page_cache_disable : 1; 155 unsigned accessed : 1; 156 unsigned dirty : 1; 157 unsigned pat : 1; 158 unsigned global : 1; 159 unsigned soft_valid : 1; /**< Valid content even if the present bit is not set. */ 160 unsigned avl : 2; 161 unsigned frame_address : 20; 162 } __attribute__ ((packed)) pte_t; 163 164 static inline unsigned int get_pt_flags(pte_t *pt, size_t i) 149 165 { 150 166 pte_t *p = &pt[i]; -
kernel/arch/ia32/include/types.h
r743e17b r985e26d2 80 80 #define PRIxn "x" /**< Format for hexadecimal (u)native_t. */ 81 81 82 /** Page Table Entry. */83 typedef struct {84 unsigned present : 1;85 unsigned writeable : 1;86 unsigned uaccessible : 1;87 unsigned page_write_through : 1;88 unsigned page_cache_disable : 1;89 unsigned accessed : 1;90 unsigned dirty : 1;91 unsigned pat : 1;92 unsigned global : 1;93 unsigned soft_valid : 1; /**< Valid content even if the present bit is not set. */94 unsigned avl : 2;95 unsigned frame_address : 20;96 } __attribute__ ((packed)) pte_t;97 98 82 #endif 99 83 -
kernel/arch/ia32/src/boot/boot.S
r743e17b r985e26d2 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
r743e17b r985e26d2 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/ia32.c
r743e17b r985e26d2 68 68 #include <sysinfo/sysinfo.h> 69 69 #include <arch/boot/boot.h> 70 #include <memstr.h> 70 71 71 72 #ifdef CONFIG_SMP … … 169 170 i8042_wire(i8042_instance, kbrd); 170 171 trap_virtual_enable_irqs(1 << IRQ_KBD); 172 trap_virtual_enable_irqs(1 << IRQ_MOUSE); 171 173 } 172 174 } … … 176 178 * self-sufficient. 177 179 */ 178 sysinfo_set_item_val("kbd", NULL, true); 179 sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD); 180 sysinfo_set_item_val("kbd.address.physical", NULL, 180 sysinfo_set_item_val("i8042", NULL, true); 181 sysinfo_set_item_val("i8042.inr_a", NULL, IRQ_KBD); 182 sysinfo_set_item_val("i8042.inr_b", NULL, IRQ_MOUSE); 183 sysinfo_set_item_val("i8042.address.physical", NULL, 181 184 (uintptr_t) I8042_BASE); 182 sysinfo_set_item_val(" kbd.address.kernel", NULL,185 sysinfo_set_item_val("i8042.address.kernel", NULL, 183 186 (uintptr_t) I8042_BASE); 184 187 #endif -
kernel/arch/ia32/src/interrupt.c
r743e17b r985e26d2 98 98 } 99 99 100 static void de_fault(int n, istate_t *istate) 101 { 102 fault_if_from_uspace(istate, "Divide error."); 103 104 decode_istate(istate); 105 panic("Divide error."); 106 } 107 100 108 /** General Protection Fault. */ 101 109 static void gp_fault(int n __attribute__((unused)), istate_t *istate) … … 215 223 } 216 224 225 exc_register(0, "de_fault", (iroutine) de_fault); 217 226 exc_register(7, "nm_fault", (iroutine) nm_fault); 218 227 exc_register(12, "ss_fault", (iroutine) ss_fault); -
kernel/arch/ia32/src/proc/scheduler.c
r743e17b r985e26d2 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
r743e17b r985e26d2 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"
Note:
See TracChangeset
for help on using the changeset viewer.
