diff --git a/arch/x86/include/ia32/kernel_arch_func.h b/arch/x86/include/ia32/kernel_arch_func.h index 574c441fdb9..c9580d352b2 100644 --- a/arch/x86/include/ia32/kernel_arch_func.h +++ b/arch/x86/include/ia32/kernel_arch_func.h @@ -12,6 +12,8 @@ #ifndef _ASMLANGUAGE +#include /* For size_t */ + #ifdef __cplusplus extern "C" { #endif @@ -92,8 +94,6 @@ static inline struct x86_mmu_pdpt *z_x86_pdpt_get(struct k_thread *thread) /* ASM code to fiddle with registers to enable the MMU with PAE paging */ void z_x86_enable_paging(void); -#include /* For size_t */ - #ifdef __cplusplus } #endif diff --git a/include/arch/x86/ia32/arch.h b/include/arch/x86/ia32/arch.h index 1c0f1a24767..6c2848716d3 100644 --- a/include/arch/x86/ia32/arch.h +++ b/include/arch/x86/ia32/arch.h @@ -25,13 +25,12 @@ #include #ifndef _ASMLANGUAGE +#include /* for size_t */ + #include #include -#endif -#ifdef __cplusplus -extern "C" { -#endif +#endif /* _ASMLANGUAGE */ /* GDT layout */ #define CODE_SEG 0x08 @@ -53,9 +52,13 @@ extern "C" { #ifndef _ASMLANGUAGE -/* interrupt/exception/error related definitions */ +#ifdef __cplusplus +extern "C" { +#endif +/* interrupt/exception/error related definitions */ + /* * The TCS must be aligned to the same boundary as that used by the floating * point register set. This applies even for threads that don't initially @@ -315,10 +318,6 @@ struct _x86_syscall_stack_frame { u32_t ss; }; -#endif /* !_ASMLANGUAGE */ - -#ifndef _ASMLANGUAGE - /** * * @internal @@ -561,8 +560,6 @@ extern void k_float_enable(struct k_thread *thread, unsigned int options); * @} */ -#include /* for size_t */ - extern void k_cpu_idle(void); extern u32_t z_timer_cycle_get_32(void); @@ -809,10 +806,10 @@ int z_x86_mmu_validate(struct x86_mmu_pdpt *pdpt, void *addr, size_t size, int write); #endif /* CONFIG_X86_MMU */ -#endif /* !_ASMLANGUAGE */ - #ifdef __cplusplus } #endif +#endif /* !_ASMLANGUAGE */ + #endif /* ZEPHYR_INCLUDE_ARCH_X86_IA32_ARCH_H_ */