Skip to content

Commit

Permalink
x86, espfix: Move espfix definitions into a separate header file
Browse files Browse the repository at this point in the history
Sparse warns that the percpu variables aren't declared before they are
defined.  Rather than hacking around it, move espfix definitions into
a proper header file.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
  • Loading branch information
H. Peter Anvin committed May 1, 2014
1 parent 246f2d2 commit e1fe9ed
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
16 changes: 16 additions & 0 deletions arch/x86/include/asm/espfix.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifdef _ASM_X86_ESPFIX_H
#define _ASM_X86_ESPFIX_H

#ifdef CONFIG_X86_64

#include <asm/percpu.h>

DECLARE_PER_CPU_READ_MOSTLY(unsigned long, espfix_stack);
DECLARE_PER_CPU_READ_MOSTLY(unsigned long, espfix_waddr);

extern void init_espfix_bsp(void);
extern void init_espfix_ap(void);

#endif /* CONFIG_X86_64 */

#endif /* _ASM_X86_ESPFIX_H */
5 changes: 2 additions & 3 deletions arch/x86/include/asm/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ extern void x86_ce4100_early_setup(void);
static inline void x86_ce4100_early_setup(void) { }
#endif

extern void init_espfix_bsp(void);
extern void init_espfix_ap(void);

#ifndef _SETUP

#include <asm/espfix.h>

/*
* This is set up by the setup-routine at boot-time
*/
Expand Down
1 change: 1 addition & 0 deletions arch/x86/kernel/espfix_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <asm/pgtable.h>
#include <asm/pgalloc.h>
#include <asm/setup.h>
#include <asm/espfix.h>

/*
* Note: we only need 6*8 = 48 bytes for the espfix stack, but round
Expand Down

0 comments on commit e1fe9ed

Please sign in to comment.