Skip to content

Commit

Permalink
kernel: Remove _IntLibInit function
Browse files Browse the repository at this point in the history
There were many platforms where this function was doing nothing. Just
merging its functionality with _PrepC function.

Signed-off-by: Flavio Ceolin <[email protected]>
  • Loading branch information
Flavio Ceolin authored and andrewboie committed Nov 28, 2018
1 parent a0b9e70 commit 46715fa
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 51 deletions.
5 changes: 0 additions & 5 deletions arch/arc/include/kernel_arch_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ static ALWAYS_INLINE int _INTERRUPT_CAUSE(void)
extern void _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,
void *p2, void *p3, u32_t stack, u32_t size);

Expand Down
3 changes: 3 additions & 0 deletions arch/arm/core/cortex_m/prep_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ extern FUNC_NORETURN void _Cstart(void);
* @return N/A
*/

extern void _IntLibInit(void);

#ifdef CONFIG_BOOT_TIME_MEASUREMENT
extern u64_t __start_time_stamp;
#endif
Expand All @@ -117,6 +119,7 @@ void _PrepC(void)
#ifdef CONFIG_BOOT_TIME_MEASUREMENT
__start_time_stamp = 0;
#endif
_IntLibInit();
_Cstart();
CODE_UNREACHABLE;
}
3 changes: 0 additions & 3 deletions arch/arm/include/kernel_arch_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ extern void k_cpu_atomic_idle(unsigned int key);

#define _is_in_isr() _IsInIsr()

extern void _IntLibInit(void);


extern FUNC_NORETURN void _arm_userspace_enter(k_thread_entry_t user_entry,
void *p1, void *p2, void *p3,
u32_t stack_end,
Expand Down
5 changes: 0 additions & 5 deletions arch/nios2/include/kernel_arch_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ _set_thread_return_value(struct k_thread *thread, unsigned int 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)

#ifdef CONFIG_IRQ_OFFLOAD
Expand Down
2 changes: 1 addition & 1 deletion arch/posix/core/posix_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
void posix_init_multithreading(void)
Expand Down
10 changes: 0 additions & 10 deletions arch/posix/include/kernel_arch_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,6 @@ _set_thread_return_value(struct k_thread *thread, unsigned int 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
}
#endif
Expand Down
3 changes: 3 additions & 0 deletions arch/riscv32/core/prep_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ void _PrepC(void)
_bss_zero();
#ifdef CONFIG_XIP
_data_copy();
#endif
#if defined(CONFIG_RISCV_SOC_INTERRUPT_INIT)
soc_interrupt_init();
#endif
_Cstart();
CODE_UNREACHABLE;
Expand Down
7 changes: 0 additions & 7 deletions arch/riscv32/include/kernel_arch_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ _set_thread_return_value(struct k_thread *thread, unsigned int 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,
const NANO_ESF *esf);

Expand Down
10 changes: 0 additions & 10 deletions arch/x86/include/kernel_arch_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,6 @@ static inline void write_x2apic(unsigned int reg, u32_t val)
}
#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,
void *p1, void *p2, void *p3,
u32_t stack_end,
Expand Down
8 changes: 0 additions & 8 deletions arch/xtensa/include/kernel_arch_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,6 @@ _set_thread_return_value(struct k_thread *thread, unsigned int value)

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 */

#ifdef __cplusplus
Expand Down
2 changes: 0 additions & 2 deletions kernel/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,6 @@ FUNC_NORETURN void _Cstart(void)
* drivers are initialized.
*/

_IntLibInit();

if (IS_ENABLED(CONFIG_LOG)) {
log_core_init();
}
Expand Down
2 changes: 2 additions & 0 deletions soc/posix/inf_clock/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ static void *zephyr_wrapper(void *a)
zephyr_thread);
#endif

posix_init_multithreading();

/* Start Zephyr: */
_Cstart();
CODE_UNREACHABLE;
Expand Down

0 comments on commit 46715fa

Please sign in to comment.