mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-26 08:35:50 +00:00
Fixes sparse warning: CHECK <snip>/zephyr/kernel/thread.c <snip>/zephyr/kernel/thread.c:184:20: error: symbol '_thread_entry' redeclared with different type (originally declared at <snip>/zephyr/kernel/include/nano_internal.h:43) - different modifiers CC kernel/thread.o Change-Id: I2223493cdf97c811c661773f8fd430e6c00cbaa0 Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
90 lines
1.9 KiB
C
90 lines
1.9 KiB
C
/*
|
|
* Copyright (c) 2010-2012, 2014-2015 Wind River Systems, Inc.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @file
|
|
* @brief Architecture-independent private kernel APIs
|
|
*
|
|
* This file contains private kernel APIs that are not architecture-specific.
|
|
*/
|
|
|
|
#ifndef _NANO_INTERNAL__H_
|
|
#define _NANO_INTERNAL__H_
|
|
|
|
#include <kernel.h>
|
|
|
|
#define K_NUM_PRIORITIES \
|
|
(CONFIG_NUM_COOP_PRIORITIES + CONFIG_NUM_PREEMPT_PRIORITIES + 1)
|
|
|
|
#define K_NUM_PRIO_BITMAPS ((K_NUM_PRIORITIES + 31) >> 5)
|
|
|
|
#ifndef _ASMLANGUAGE
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Early boot functions */
|
|
|
|
void _bss_zero(void);
|
|
#ifdef CONFIG_XIP
|
|
void _data_copy(void);
|
|
#else
|
|
static inline void _data_copy(void)
|
|
{
|
|
/* Do nothing */
|
|
}
|
|
#endif
|
|
FUNC_NORETURN void _Cstart(void);
|
|
|
|
extern FUNC_NORETURN void _thread_entry(void (*)(void *, void *, void *),
|
|
void *, void *, void *);
|
|
|
|
extern void _new_thread(struct k_thread *thread, char *pStack, size_t stackSize,
|
|
void (*pEntry)(void *, void *, void *),
|
|
void *p1, void *p2, void *p3,
|
|
int prio, unsigned int options);
|
|
|
|
/* context switching and scheduling-related routines */
|
|
|
|
extern unsigned int __swap(unsigned int key);
|
|
|
|
#if defined(CONFIG_TICKLESS_KERNEL) && defined(CONFIG_TIMESLICING)
|
|
extern void _update_time_slice_before_swap(void);
|
|
|
|
static inline unsigned int _time_slice_swap(unsigned int key)
|
|
{
|
|
_update_time_slice_before_swap();
|
|
return __swap(key);
|
|
}
|
|
|
|
#define _Swap(x) _time_slice_swap(x)
|
|
#else
|
|
#define _Swap(x) __swap(x)
|
|
#endif
|
|
/* set and clear essential fiber/task flag */
|
|
|
|
extern void _thread_essential_set(void);
|
|
extern void _thread_essential_clear(void);
|
|
|
|
/* clean up when a thread is aborted */
|
|
|
|
#if defined(CONFIG_THREAD_MONITOR)
|
|
extern void _thread_monitor_exit(struct k_thread *thread);
|
|
#else
|
|
#define _thread_monitor_exit(thread) \
|
|
do {/* nothing */ \
|
|
} while (0)
|
|
#endif /* CONFIG_THREAD_MONITOR */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* _ASMLANGUAGE */
|
|
|
|
#endif /* _NANO_INTERNAL__H_ */
|