mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
arch: x86_64: revoke lower 128MB mapping later, ldmxcsr require 32-bit address
This commit is contained in:
committed by
Brennan Ashton
parent
370eb169fd
commit
2936f72651
@@ -581,6 +581,7 @@ int up_map_region(void *base, int size, int flags);
|
|||||||
void x86_64_check_and_enable_capability(void);
|
void x86_64_check_and_enable_capability(void);
|
||||||
|
|
||||||
extern void __enable_sse3(void);
|
extern void __enable_sse3(void);
|
||||||
|
extern void __revoke_low_memory(void);
|
||||||
extern void __enable_pcid(void);
|
extern void __enable_pcid(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -65,6 +65,7 @@
|
|||||||
.global __nxstart
|
.global __nxstart
|
||||||
.global __enable_sse3
|
.global __enable_sse3
|
||||||
.global __enable_pcid
|
.global __enable_pcid
|
||||||
|
.global __revoke_low_memory
|
||||||
.global nx_start /* nx_start is defined elsewhere */
|
.global nx_start /* nx_start is defined elsewhere */
|
||||||
.global up_lowsetup /* up_lowsetup is defined elsewhere */
|
.global up_lowsetup /* up_lowsetup is defined elsewhere */
|
||||||
.global g_idle_topstack /* The end of the idle stack, the start of the heap */
|
.global g_idle_topstack /* The end of the idle stack, the start of the heap */
|
||||||
@@ -133,7 +134,7 @@ start32:
|
|||||||
|
|
||||||
// Popluate the lower 4GB as non-present
|
// Popluate the lower 4GB as non-present
|
||||||
// for ecx = 0...512 * 4 : Loop and setup the page directories
|
// for ecx = 0...512 * 4 : Loop and setup the page directories
|
||||||
mov $0x800, %ecx // 512 * 3
|
mov $0x800, %ecx // 512 * 4
|
||||||
epd_loop:
|
epd_loop:
|
||||||
mov %esi, %edx
|
mov %esi, %edx
|
||||||
or $(X86_PAGE_WR | X86_PAGE_PRESENT), %edx
|
or $(X86_PAGE_WR | X86_PAGE_PRESENT), %edx
|
||||||
@@ -244,20 +245,7 @@ start64:
|
|||||||
.type __nxstart, @function
|
.type __nxstart, @function
|
||||||
|
|
||||||
__nxstart:
|
__nxstart:
|
||||||
/* We are now in high memory, revoke the lower 128MB memory mapping */
|
/* We are now in high memory, will revoke the lower 128MB memory mapping in lowsetup*/
|
||||||
lea pd_low, %edi
|
|
||||||
mov $0, %eax
|
|
||||||
|
|
||||||
// for ecx = 0...64 : Loop and setup 64x 2MB page directories
|
|
||||||
mov $64, %ecx
|
|
||||||
npd_loop:
|
|
||||||
mov %eax, 0(%edi)
|
|
||||||
add $(HUGE_PAGE_SIZE), %eax
|
|
||||||
add $(X86_PAGE_ENTRY_SIZE), %edi
|
|
||||||
|
|
||||||
// end for ecx
|
|
||||||
dec %ecx
|
|
||||||
jnz npd_loop
|
|
||||||
|
|
||||||
//clear out bss section
|
//clear out bss section
|
||||||
movabs $_sbss, %rbx
|
movabs $_sbss, %rbx
|
||||||
@@ -289,6 +277,29 @@ hang:
|
|||||||
jmp hang
|
jmp hang
|
||||||
.size __nxstart, . - __nxstart
|
.size __nxstart, . - __nxstart
|
||||||
|
|
||||||
|
.type __revoke_low_memory, @function
|
||||||
|
__revoke_low_memory:
|
||||||
|
|
||||||
|
/* Revoke the lower 128MB memory mapping */
|
||||||
|
lea pd_low, %edi
|
||||||
|
lea pt_low, %esi
|
||||||
|
|
||||||
|
// for ecx = 0...64 : Loop and setup 64x 2MB page directories
|
||||||
|
mov $64, %ecx
|
||||||
|
npd_loop:
|
||||||
|
mov %esi, %edx
|
||||||
|
or $(X86_PAGE_WR | X86_PAGE_PRESENT), %edx
|
||||||
|
mov %edx, 0(%edi)
|
||||||
|
add $(PAGE_SIZE), %esi
|
||||||
|
add $(X86_PAGE_ENTRY_SIZE), %edi
|
||||||
|
|
||||||
|
// end for ecx
|
||||||
|
dec %ecx
|
||||||
|
jnz npd_loop
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
.size __revoke_low_memory, . - __revoke_low_memory
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: __enable_sse3
|
* Name: __enable_sse3
|
||||||
|
|||||||
@@ -94,6 +94,9 @@ void up_lowsetup(void)
|
|||||||
|
|
||||||
x86_64_check_and_enable_capability();
|
x86_64_check_and_enable_capability();
|
||||||
|
|
||||||
|
/* Revoke the lower memory */
|
||||||
|
__revoke_low_memory();
|
||||||
|
|
||||||
/* perform board-specific initializations */
|
/* perform board-specific initializations */
|
||||||
|
|
||||||
x86_64_boardinitialize();
|
x86_64_boardinitialize();
|
||||||
|
|||||||
Reference in New Issue
Block a user