Changes in / [d767cb1:c2cf033] in mainline
- Files:
-
- 1 added
- 1 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
HelenOS.config
rd767cb1 rc2cf033 70 70 @ "pentium4" Pentium 4 71 71 @ "pentium3" Pentium 3 72 @ "i486" i48673 72 @ "core" Core Solo/Duo 74 73 @ "athlon_xp" Athlon XP -
kernel/arch/ia32/Makefile.inc
rd767cb1 rc2cf033 64 64 endif 65 65 66 ifeq ($(PROCESSOR),i486)67 CMN2 = -march=i48668 endif69 70 66 ifeq ($(PROCESSOR),core) 71 67 CMN2 = -march=prescott -
kernel/arch/ia32/include/asm.h
rd767cb1 rc2cf033 311 311 } 312 312 313 #ifndef PROCESSOR_i486314 313 /** Write to MSR */ 315 314 NO_TRACE static inline void write_msr(uint32_t msr, uint64_t value) … … 336 335 return ((uint64_t) dx << 32) | ax; 337 336 } 338 #endif339 337 340 338 -
kernel/arch/ia32/include/atomic.h
rd767cb1 rc2cf033 121 121 asm volatile ( 122 122 "0:\n" 123 #ifndef PROCESSOR_i486124 123 "pause\n" /* Pentium 4's HT love this instruction */ 125 #endif126 124 "mov %[count], %[tmp]\n" 127 125 "testl %[tmp], %[tmp]\n" -
kernel/arch/ia32/include/cycle.h
rd767cb1 rc2cf033 40 40 NO_TRACE static inline uint64_t get_cycle(void) 41 41 { 42 #ifdef PROCESSOR_i48643 return 0;44 #else45 42 uint64_t v; 46 43 … … 51 48 52 49 return v; 53 #endif54 50 } 55 51 -
kernel/arch/ia32/src/asm.S
rd767cb1 rc2cf033 405 405 xorl %eax, %eax 406 406 cmpl $(GDT_SELECTOR(KTEXT_DES)), ISTATE_OFFSET_CS(%esp) 407 #ifdef PROCESSOR_i486408 jz 0f409 movl %eax, %ebp410 0:411 #else412 407 cmovnzl %eax, %ebp 413 #endif414 408 415 409 movl %ebp, ISTATE_OFFSET_EBP_FRAME(%esp) -
kernel/arch/ia32/src/boot/boot.S
rd767cb1 rc2cf033 97 97 pm_status $status_prot 98 98 99 movl $(INTEL_CPUID_LEVEL), %eax 100 cpuid 101 cmp $0x0, %eax /* any function > 0? */ 102 jbe pse_unsupported 103 104 movl $(INTEL_CPUID_STANDARD), %eax 105 cpuid 106 bt $(INTEL_PSE), %edx 107 jc pse_supported 108 109 pse_unsupported: 110 111 pm_error $err_pse 112 113 pse_supported: 114 99 115 #include "vesa_prot.inc" 100 116 … … 124 140 jmp hlt0 125 141 126 /** Calculate unmapped address of the end of the kernel. */127 calc_end_of_kernel:128 movl $hardcoded_load_address, %edi129 andl $0x7fffffff, %edi130 movl (%edi), %esi131 andl $0x7fffffff, %esi132 133 movl $hardcoded_ktext_size, %edi134 andl $0x7fffffff, %edi135 addl (%edi), %esi136 andl $0x7fffffff, %esi137 138 movl $hardcoded_kdata_size, %edi139 andl $0x7fffffff, %edi140 addl (%edi), %esi141 andl $0x7fffffff, %esi142 movl %esi, end_of_kernel143 ret144 145 /** Find free 2M (+4k for alignment) region where to store page tables */146 find_mem_for_pt:147 /* Check if multiboot info is present */148 cmpl $0x2BADB002, grub_eax149 je check_multiboot_map150 ret151 check_multiboot_map:152 /* Copy address of the multiboot info to ebx */153 movl grub_ebx, %ebx154 /* Check if memory map flag is present */155 movl (%ebx), %edx156 andl $(1 << 6), %edx157 jnz use_multiboot_map158 ret159 use_multiboot_map:160 /* Copy address of the memory map to edx */161 movl 48(%ebx), %edx162 movl %edx, %ecx163 addl 44(%ebx), %ecx164 /* Find a free region at least 2M in size */165 check_memmap_loop:166 /* Is this a free region? */167 cmp $1, 20(%edx)168 jnz next_region169 /* Check size */170 cmp $0, 16(%edx)171 jnz next_region172 cmpl $(2 * 1024 * 1024 + 4 * 1024), 12(%edx)173 jbe next_region174 cmp $0, 8(%edx)175 jz found_region176 next_region:177 cmp %ecx, %edx178 jbe next_region_do179 ret180 next_region_do:181 addl (%edx), %edx182 addl $4, %edx183 jmp check_memmap_loop184 found_region:185 /* Use end of the found region */186 mov 4(%edx), %ecx187 add 12(%edx), %ecx188 sub $(2 * 1024 * 1024), %ecx189 mov %ecx, free_area190 ret191 192 193 142 /** Setup mapping for the kernel. 194 143 * … … 199 148 .global map_kernel 200 149 map_kernel: 201 /* Paging features */202 150 movl %cr4, %ecx 151 orl $(1 << 4), %ecx /* PSE on */ 203 152 andl $(~(1 << 5)), %ecx /* PAE off */ 204 153 movl %ecx, %cr4 205 154 206 call calc_end_of_kernel207 call find_mem_for_pt208 mov end_of_kernel, %esi209 mov free_area, %ecx210 cmpl %esi, %ecx211 jbe use_end_of_kernel212 mov %ecx, %esi213 /* Align address down to 4k */214 andl $(~4095), %esi215 use_end_of_kernel:216 217 /* Align address to 4k */218 addl $4095, %esi219 andl $(~4095), %esi220 221 /* Allocate space for page tables*/222 movl %esi, pt_loc223 movl $ballocs, %edi224 andl $0x7fffffff, %edi225 movl %esi, (%edi)226 addl $4, %edi227 movl $(2*1024*1024), (%edi)228 229 /* Fill page tables */230 xorl %ecx, %ecx231 xorl %ebx, %ebx232 233 floop_pt:234 movl $((1 << 1) | (1 << 0)), %eax235 orl %ebx, %eax236 movl %eax, (%esi, %ecx, 4)237 addl $(4 * 1024), %ebx238 239 incl %ecx240 cmpl $(512 * 1024), %ecx241 jl floop_pt242 243 /* Fill page directory */244 155 movl $(page_directory + 0), %esi 245 156 movl $(page_directory + 2048), %edi 246 157 xorl %ecx, %ecx 247 movl pt_loc, %ebx158 xorl %ebx, %ebx 248 159 249 160 floop: 250 movl $((1 << 1) | (1 << 0)), %eax161 movl $((1 << 7) | (1 << 1) | (1 << 0)), %eax 251 162 orl %ebx, %eax 252 163 /* Mapping 0x00000000 + %ecx * 4M => 0x00000000 + %ecx * 4M */ … … 254 165 /* Mapping 0x80000000 + %ecx * 4M => 0x00000000 + %ecx * 4M */ 255 166 movl %eax, (%edi, %ecx, 4) 256 addl $(4 * 1024 ), %ebx167 addl $(4 * 1024 * 1024), %ebx 257 168 258 169 incl %ecx … … 612 523 613 524 grub_ebx: 614 .long 0615 616 pt_loc:617 .long 0618 end_of_kernel:619 .long 0620 free_area:621 525 .long 0 622 526 -
kernel/arch/ia32/src/cpu/cpu.c
rd767cb1 rc2cf033 118 118 ); 119 119 } 120 121 #ifndef PROCESSOR_i486 120 122 121 if (CPU->arch.fi.bits.sep) { 123 122 /* Setup fast SYSENTER/SYSEXIT syscalls */ 124 123 syscall_setup_cpu(); 125 124 } 126 #endif127 125 } 128 126 -
kernel/arch/ia32/src/proc/scheduler.c
rd767cb1 rc2cf033 60 60 uintptr_t kstk = (uintptr_t) &THREAD->kstack[STACK_SIZE]; 61 61 62 #ifndef PROCESSOR_i48663 62 if (CPU->arch.fi.bits.sep) { 64 63 /* Set kernel stack for CP3 -> CPL0 switch via SYSENTER */ 65 64 write_msr(IA32_MSR_SYSENTER_ESP, kstk - sizeof(istate_t)); 66 65 } 67 #endif68 66 69 67 /* Set kernel stack for CPL3 -> CPL0 switch via interrupt */ -
kernel/arch/ia32/src/syscall.c
rd767cb1 rc2cf033 39 39 #include <arch/pm.h> 40 40 41 #ifndef PROCESSOR_i48642 41 /** Enable & setup support for SYSENTER/SYSEXIT */ 43 42 void syscall_setup_cpu(void) … … 50 49 write_msr(IA32_MSR_SYSENTER_EIP, (uint32_t) sysenter_handler); 51 50 } 52 #endif53 51 54 52 /** @} -
uspace/lib/c/arch/ia32/Makefile.common
rd767cb1 rc2cf033 28 28 29 29 CLANG_ARCH = i386 30 ifeq ($(PROCESSOR),i486)31 GCC_CFLAGS += -march=i486 -fno-omit-frame-pointer32 else33 30 GCC_CFLAGS += -march=pentium -fno-omit-frame-pointer 34 endif35 31 36 32 ENDIANESS = LE -
uspace/lib/c/arch/ia32/Makefile.inc
rd767cb1 rc2cf033 28 28 29 29 ARCH_SOURCES = \ 30 arch/$(UARCH)/src/entry. S\30 arch/$(UARCH)/src/entry.s \ 31 31 arch/$(UARCH)/src/entryjmp.s \ 32 32 arch/$(UARCH)/src/thread_entry.s \
Note:
See TracChangeset
for help on using the changeset viewer.