We need to id-remap our own inmate. Therefore it needs to know its own base address. Currently, the base address is determined by CONFIG_INMATE_BASE in config.h.
So far, only linker scripts used this definition. Now we need it for both: the linker script and in the code. Move it to inmate_common.h Signed-off-by: Ralf Ramsauer <[email protected]> --- inmates/lib/arm/inmate.lds.S | 6 +----- inmates/lib/arm64/inmate.lds.S | 6 +----- inmates/lib/inmate_common.h | 6 ++++++ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/inmates/lib/arm/inmate.lds.S b/inmates/lib/arm/inmate.lds.S index e2d994cb..7783485d 100644 --- a/inmates/lib/arm/inmate.lds.S +++ b/inmates/lib/arm/inmate.lds.S @@ -38,11 +38,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include <jailhouse/config.h> - -#ifndef CONFIG_INMATE_BASE -#define CONFIG_INMATE_BASE 0x0 -#endif +#include "../inmate_common.h" SECTIONS { . = CONFIG_INMATE_BASE; diff --git a/inmates/lib/arm64/inmate.lds.S b/inmates/lib/arm64/inmate.lds.S index a2db6ac3..df9406e9 100644 --- a/inmates/lib/arm64/inmate.lds.S +++ b/inmates/lib/arm64/inmate.lds.S @@ -36,11 +36,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include <jailhouse/config.h> - -#ifndef CONFIG_INMATE_BASE -#define CONFIG_INMATE_BASE 0x0 -#endif +#include "../inmate_common.h" SECTIONS { . = CONFIG_INMATE_BASE; diff --git a/inmates/lib/inmate_common.h b/inmates/lib/inmate_common.h index bee4e64b..6f74d02a 100644 --- a/inmates/lib/inmate_common.h +++ b/inmates/lib/inmate_common.h @@ -36,6 +36,12 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ +#include <jailhouse/config.h> + +#ifndef CONFIG_INMATE_BASE +#define CONFIG_INMATE_BASE 0x0 +#endif + #define NULL ((void *)0) #define NS_PER_USEC 1000UL -- 2.17.0 -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
