Commit e6126a58720ed8e53de93883c3f1572ad3d7b7c3

Authored by Masahiro Yamada
Committed by Simon Glass
1 parent ba7b38a529

x86: move arch-specific asmlinkage to <asm/linkage.h>

Commit 65dd74a674d6 (x86: ivybridge: Implement SDRAM init) introduced
x86-specific asmlinkage into arch/x86/include/asm/config.h.

Commit ed0a2fbf14f7 (x86: Add a definition of asmlinkage) added the
same macro define again, this time, into include/common.h.
(Please do not add arch-specific stuff to include/common.h any more;
it is already too cluttered.)

The generic asmlinkage is defined in <linux/linkage.h>.  If you want
to override it with an arch-specific one, the best way is to add it
to <asm/linkage.h> like Linux Kernel.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

Showing 7 changed files with 13 additions and 4 deletions Side-by-side Diff

arch/x86/include/asm/arch-ivybridge/pei_data.h
... ... @@ -7,6 +7,8 @@
7 7 #ifndef ASM_ARCH_PEI_DATA_H
8 8 #define ASM_ARCH_PEI_DATA_H
9 9  
  10 +#include <linux/linkage.h>
  11 +
10 12 struct pch_usb3_controller_settings {
11 13 /* 0: Disable, 1: Enable, 2: Auto, 3: Smart Auto */
12 14 uint16_t mode;
arch/x86/include/asm/config.h
... ... @@ -10,7 +10,6 @@
10 10 #define CONFIG_SYS_GENERIC_BOARD
11 11 #define CONFIG_LMB
12 12 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
13   -#define asmlinkage __attribute__((regparm(0)))
14 13  
15 14 #endif
arch/x86/include/asm/linkage.h
  1 +#ifndef _ASM_X86_LINKAGE_H
  2 +#define _ASM_X86_LINKAGE_H
  3 +
  4 +#define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))
  5 +
  6 +#endif /* _ASM_X86_LINKAGE_H */
... ... @@ -9,6 +9,7 @@
9 9 #include <common.h>
10 10 #include <bios_emul.h>
11 11 #include <vbe.h>
  12 +#include <linux/linkage.h>
12 13 #include <asm/cache.h>
13 14 #include <asm/processor.h>
14 15 #include <asm/i8259.h>
... ... @@ -10,6 +10,8 @@
10 10 #ifndef _X86_LIB_BIOS_H
11 11 #define _X86_LIB_BIOS_H
12 12  
  13 +#include <linux/linkage.h>
  14 +
13 15 #define REALMODE_BASE 0x600
14 16  
15 17 #ifdef __ASSEMBLY__
... ... @@ -73,9 +73,6 @@
73 73 #ifdef CONFIG_ARM
74 74 #define asmlinkage /* nothing */
75 75 #endif
76   -#ifdef CONFIG_X86
77   -#define asmlinkage __attribute__((regparm(0)))
78   -#endif
79 76 #ifdef CONFIG_BLACKFIN
80 77 #include <asm/blackfin.h>
81 78 #endif
include/linux/linkage.h
... ... @@ -17,7 +17,9 @@
17 17 #define CPP_ASMLINKAGE
18 18 #endif
19 19  
  20 +#ifndef asmlinkage
20 21 #define asmlinkage CPP_ASMLINKAGE
  22 +#endif
21 23  
22 24 #define SYMBOL_NAME_STR(X) #X
23 25 #define SYMBOL_NAME(X) X