arch/x86_64: add addrenv support

this commit adds simple addrenv support for x86_64

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
This commit is contained in:
p-szafonimateusz 2024-03-01 10:42:09 +01:00 committed by Xiang Xiao
parent 7d95bec148
commit 83abf9bd27

View File

@ -26,8 +26,27 @@
#include <nuttx/board.h>
#include <arch/board/board.h>
#ifdef CONFIG_DEV_SIMPLE_ADDRENV
# include <nuttx/drivers/addrenv.h>
#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