Skip to content

Commit

Permalink
x86/syscall: Unconditionally prototype {ia32,x32}_sys_call_table[]
Browse files Browse the repository at this point in the history
Even if these APIs are disabled, and the arrays therefore do not
exist, having the prototypes allows us to use IS_ENABLED() rather than
using #ifdefs.

If something ends up trying to actually *use* these arrays a linker
error will ensue.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20210510185316.3307264-4-hpa@zytor.com
  • Loading branch information
H. Peter Anvin (Intel) authored and Ingo Molnar committed May 12, 2021
1 parent 3e5e7f7 commit dce0aa3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions arch/x86/include/asm/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ extern const sys_call_ptr_t sys_call_table[];

#if defined(CONFIG_X86_32)
#define ia32_sys_call_table sys_call_table
#endif

#if defined(CONFIG_IA32_EMULATION)
#else
/*
* These may not exist, but still put the prototypes in so we
* can use IS_ENABLED().
*/
extern const sys_call_ptr_t ia32_sys_call_table[];
#endif

#ifdef CONFIG_X86_X32_ABI
extern const sys_call_ptr_t x32_sys_call_table[];
#endif

Expand Down

0 comments on commit dce0aa3

Please sign in to comment.