diff --git a/arch/x86_64/src/common/x86_64_initialize.c b/arch/x86_64/src/common/x86_64_initialize.c index f59dc5106be..5a960c617dc 100644 --- a/arch/x86_64/src/common/x86_64_initialize.c +++ b/arch/x86_64/src/common/x86_64_initialize.c @@ -26,8 +26,27 @@ #include #include +#ifdef CONFIG_DEV_SIMPLE_ADDRENV +# include +#endif + #include "x86_64_internal.h" +/**************************************************************************** + * Private Data + ****************************************************************************/ + +#ifdef CONFIG_DEV_SIMPLE_ADDRENV +/* Map 1:1 with 0x100000000 offset */ + +struct simple_addrenv_s g_addrenv = +{ + .va = X86_64_LOAD_OFFSET, + .pa = 0, + .size = 0xffffffffffffffff +}; +#endif + /**************************************************************************** * Private Functions ****************************************************************************/ @@ -59,6 +78,21 @@ static void up_calibratedelay(void) # define up_calibratedelay() #endif +/**************************************************************************** + * Name: up_addrenv_init + * + * Description: + * Initialize addrenv. + * + ****************************************************************************/ + +static void x86_64_addrenv_init(void) +{ +#ifdef CONFIG_DEV_SIMPLE_ADDRENV + simple_addrenv_initialize(&g_addrenv); +#endif +} + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -86,6 +120,10 @@ void up_initialize(void) x86_64_addregion(); + /* Initialzie addrenv */ + + x86_64_addrenv_init(); + #ifdef CONFIG_PM /* Initialize the power management subsystem. This MCU-specific function * must be called *very* early in the initialization sequence *before* any