arch: x86: guard some functions based on usage

Found when building with clang..

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2020-05-03 07:37:35 -04:00
parent 602fc2c3d4
commit bc40cbc9b4
2 changed files with 6 additions and 0 deletions

View file

@ -31,6 +31,7 @@ FUNC_NORETURN void arch_system_halt(unsigned int reason)
}
#endif
#ifdef CONFIG_THREAD_STACK_INFO
static inline uintptr_t esf_get_sp(const z_arch_esf_t *esf)
{
#ifdef CONFIG_X86_64
@ -39,7 +40,9 @@ static inline uintptr_t esf_get_sp(const z_arch_esf_t *esf)
return esf->esp;
#endif
}
#endif
#ifdef CONFIG_EXCEPTION_DEBUG
static inline uintptr_t esf_get_code(const z_arch_esf_t *esf)
{
#ifdef CONFIG_X86_64
@ -48,6 +51,7 @@ static inline uintptr_t esf_get_code(const z_arch_esf_t *esf)
return esf->errorCode;
#endif
}
#endif
#ifdef CONFIG_THREAD_STACK_INFO
bool z_x86_check_stack_bounds(uintptr_t addr, size_t size, uint16_t cs)

View file

@ -666,6 +666,7 @@ __aligned(PTABLES_ALIGN) struct x86_page_tables z_x86_user_ptables;
extern char z_shared_kernel_page_start[];
#ifdef CONFIG_X86_KPTI
static inline bool is_within_system_ram(uintptr_t addr)
{
#ifdef CONFIG_X86_64
@ -676,6 +677,7 @@ static inline bool is_within_system_ram(uintptr_t addr)
(addr < (PHYS_RAM_ADDR + PHYS_RAM_SIZE));
#endif
}
#endif
/* Ignored bit posiition at all levels */
#define IGNORED BIT64(11)