kernel: abolish __syscall_inline
This used to exist because in earlier versions of the system call interfaces, an "extern" declaration of the system call implementation function would precede the real inline version of the implementation. The compiler would not like this and would throw "static declaration of ‘foo’ follows non-static declaration". So alternate macros were needed which declare the implementation function as 'static inline' instead of extern. However, currently the inline version of these system call implementations appear first, the K_SYSCALL_DECLARE() macros appear in the header generated by gen_syscalls.py, which is always included at the end of the header file. The compiler does not complain if a static inline function is succeeded by an extern prototype of the same function. This lets us simplify the generated system call macros and just use __syscall everywhere. The disassembly of this was checked on x86 to ensure that for kernel-only or CONFIG_USERSPACE=n scenarios, everything is still being inlined as expected. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
89f28ac7c8
commit
990bf16206
4 changed files with 14 additions and 24 deletions
|
@ -2571,7 +2571,7 @@ __syscall void k_sem_give(struct k_sem *sem);
|
|||
*
|
||||
* @return N/A
|
||||
*/
|
||||
__syscall_inline void k_sem_reset(struct k_sem *sem);
|
||||
__syscall void k_sem_reset(struct k_sem *sem);
|
||||
|
||||
static inline void _impl_k_sem_reset(struct k_sem *sem)
|
||||
{
|
||||
|
@ -2587,7 +2587,7 @@ static inline void _impl_k_sem_reset(struct k_sem *sem)
|
|||
*
|
||||
* @return Current semaphore count.
|
||||
*/
|
||||
__syscall_inline unsigned int k_sem_count_get(struct k_sem *sem);
|
||||
__syscall unsigned int k_sem_count_get(struct k_sem *sem);
|
||||
|
||||
static inline unsigned int _impl_k_sem_count_get(struct k_sem *sem)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue