kernel: Remove _IntLibInit function
There were many platforms where this function was doing nothing. Just merging its functionality with _PrepC function. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
a0b9e70e10
commit
46715faa5c
12 changed files with 9 additions and 51 deletions
|
@ -61,11 +61,6 @@ static ALWAYS_INLINE int _INTERRUPT_CAUSE(void)
|
||||||
extern void _thread_entry_wrapper(void);
|
extern void _thread_entry_wrapper(void);
|
||||||
extern void _user_thread_entry_wrapper(void);
|
extern void _user_thread_entry_wrapper(void);
|
||||||
|
|
||||||
static inline void _IntLibInit(void)
|
|
||||||
{
|
|
||||||
/* nothing needed, here because the kernel requires it */
|
|
||||||
}
|
|
||||||
|
|
||||||
extern void _arc_userspace_enter(k_thread_entry_t user_entry, void *p1,
|
extern void _arc_userspace_enter(k_thread_entry_t user_entry, void *p1,
|
||||||
void *p2, void *p3, u32_t stack, u32_t size);
|
void *p2, void *p3, u32_t stack, u32_t size);
|
||||||
|
|
||||||
|
|
|
@ -105,6 +105,8 @@ extern FUNC_NORETURN void _Cstart(void);
|
||||||
* @return N/A
|
* @return N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
extern void _IntLibInit(void);
|
||||||
|
|
||||||
#ifdef CONFIG_BOOT_TIME_MEASUREMENT
|
#ifdef CONFIG_BOOT_TIME_MEASUREMENT
|
||||||
extern u64_t __start_time_stamp;
|
extern u64_t __start_time_stamp;
|
||||||
#endif
|
#endif
|
||||||
|
@ -117,6 +119,7 @@ void _PrepC(void)
|
||||||
#ifdef CONFIG_BOOT_TIME_MEASUREMENT
|
#ifdef CONFIG_BOOT_TIME_MEASUREMENT
|
||||||
__start_time_stamp = 0;
|
__start_time_stamp = 0;
|
||||||
#endif
|
#endif
|
||||||
|
_IntLibInit();
|
||||||
_Cstart();
|
_Cstart();
|
||||||
CODE_UNREACHABLE;
|
CODE_UNREACHABLE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,9 +127,6 @@ extern void k_cpu_atomic_idle(unsigned int key);
|
||||||
|
|
||||||
#define _is_in_isr() _IsInIsr()
|
#define _is_in_isr() _IsInIsr()
|
||||||
|
|
||||||
extern void _IntLibInit(void);
|
|
||||||
|
|
||||||
|
|
||||||
extern FUNC_NORETURN void _arm_userspace_enter(k_thread_entry_t user_entry,
|
extern FUNC_NORETURN void _arm_userspace_enter(k_thread_entry_t user_entry,
|
||||||
void *p1, void *p2, void *p3,
|
void *p1, void *p2, void *p3,
|
||||||
u32_t stack_end,
|
u32_t stack_end,
|
||||||
|
|
|
@ -41,11 +41,6 @@ _set_thread_return_value(struct k_thread *thread, unsigned int value)
|
||||||
thread->callee_saved.retval = value;
|
thread->callee_saved.retval = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void _IntLibInit(void)
|
|
||||||
{
|
|
||||||
/* No special initialization of the interrupt subsystem required */
|
|
||||||
}
|
|
||||||
|
|
||||||
#define _is_in_isr() (_kernel.nested != 0U)
|
#define _is_in_isr() (_kernel.nested != 0U)
|
||||||
|
|
||||||
#ifdef CONFIG_IRQ_OFFLOAD
|
#ifdef CONFIG_IRQ_OFFLOAD
|
||||||
|
|
|
@ -385,7 +385,7 @@ void posix_new_thread(posix_thread_status_t *ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called from _IntLibInit()
|
* Called from zephyr_wrapper()
|
||||||
* prepare whatever needs to be prepared to be able to start threads
|
* prepare whatever needs to be prepared to be able to start threads
|
||||||
*/
|
*/
|
||||||
void posix_init_multithreading(void)
|
void posix_init_multithreading(void)
|
||||||
|
|
|
@ -49,16 +49,6 @@ _set_thread_return_value(struct k_thread *thread, unsigned int value)
|
||||||
thread->callee_saved.retval = value;
|
thread->callee_saved.retval = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _IntLibInit() is called from the non-arch specific function,
|
|
||||||
* prepare_multithreading().
|
|
||||||
*/
|
|
||||||
static inline void _IntLibInit(void)
|
|
||||||
{
|
|
||||||
posix_init_multithreading();
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -34,6 +34,9 @@ void _PrepC(void)
|
||||||
_bss_zero();
|
_bss_zero();
|
||||||
#ifdef CONFIG_XIP
|
#ifdef CONFIG_XIP
|
||||||
_data_copy();
|
_data_copy();
|
||||||
|
#endif
|
||||||
|
#if defined(CONFIG_RISCV_SOC_INTERRUPT_INIT)
|
||||||
|
soc_interrupt_init();
|
||||||
#endif
|
#endif
|
||||||
_Cstart();
|
_Cstart();
|
||||||
CODE_UNREACHABLE;
|
CODE_UNREACHABLE;
|
||||||
|
|
|
@ -37,13 +37,6 @@ _set_thread_return_value(struct k_thread *thread, unsigned int value)
|
||||||
thread->arch.swap_return_value = value;
|
thread->arch.swap_return_value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void _IntLibInit(void)
|
|
||||||
{
|
|
||||||
#if defined(CONFIG_RISCV_SOC_INTERRUPT_INIT)
|
|
||||||
soc_interrupt_init();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
FUNC_NORETURN void _NanoFatalErrorHandler(unsigned int reason,
|
FUNC_NORETURN void _NanoFatalErrorHandler(unsigned int reason,
|
||||||
const NANO_ESF *esf);
|
const NANO_ESF *esf);
|
||||||
|
|
||||||
|
|
|
@ -118,16 +118,6 @@ static inline void write_x2apic(unsigned int reg, u32_t val)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* _IntLibInit() is called from the non-arch specific function,
|
|
||||||
* prepare_multithreading(). The IA-32 kernel does not require any special
|
|
||||||
* initialization of the interrupt subsystem. However, we still need to
|
|
||||||
* provide an _IntLibInit() of some sort to prevent build errors.
|
|
||||||
*/
|
|
||||||
static inline void _IntLibInit(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
extern FUNC_NORETURN void _x86_userspace_enter(k_thread_entry_t user_entry,
|
extern FUNC_NORETURN void _x86_userspace_enter(k_thread_entry_t user_entry,
|
||||||
void *p1, void *p2, void *p3,
|
void *p1, void *p2, void *p3,
|
||||||
u32_t stack_end,
|
u32_t stack_end,
|
||||||
|
|
|
@ -118,14 +118,6 @@ _set_thread_return_value(struct k_thread *thread, unsigned int value)
|
||||||
|
|
||||||
extern void k_cpu_atomic_idle(unsigned int key);
|
extern void k_cpu_atomic_idle(unsigned int key);
|
||||||
|
|
||||||
/*
|
|
||||||
* Required by the core kernel even though we don't have to do anything on this
|
|
||||||
* arch.
|
|
||||||
*/
|
|
||||||
static inline void _IntLibInit(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <stddef.h> /* For size_t */
|
#include <stddef.h> /* For size_t */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -463,8 +463,6 @@ FUNC_NORETURN void _Cstart(void)
|
||||||
* drivers are initialized.
|
* drivers are initialized.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
_IntLibInit();
|
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_LOG)) {
|
if (IS_ENABLED(CONFIG_LOG)) {
|
||||||
log_core_init();
|
log_core_init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,6 +183,8 @@ static void *zephyr_wrapper(void *a)
|
||||||
zephyr_thread);
|
zephyr_thread);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
posix_init_multithreading();
|
||||||
|
|
||||||
/* Start Zephyr: */
|
/* Start Zephyr: */
|
||||||
_Cstart();
|
_Cstart();
|
||||||
CODE_UNREACHABLE;
|
CODE_UNREACHABLE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue