Skip to content

Commit 2afa799

Browse files
Thomas Zimmermannbp3tk0v
authored andcommitted
x86/setup: Move internal setup_data structures into setup_data.h
Move struct_efi_setup_data in order to unify duplicated definition of the data structure in a single place. Also silence clang's warnings about GNU extensions in real-mode code which might occur from the changed includes. [ bp: Massage commit message. ] Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20240112095000.8952-3-tzimmermann@suse.de
1 parent efd7def commit 2afa799

File tree

5 files changed

+35
-31
lines changed

5 files changed

+35
-31
lines changed

arch/x86/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ REALMODE_CFLAGS += -fno-stack-protector
5353
REALMODE_CFLAGS += -Wno-address-of-packed-member
5454
REALMODE_CFLAGS += $(cc_stack_align4)
5555
REALMODE_CFLAGS += $(CLANG_FLAGS)
56+
ifdef CONFIG_CC_IS_CLANG
57+
REALMODE_CFLAGS += -Wno-gnu
58+
endif
5659
export REALMODE_CFLAGS
5760

5861
# BITS is used as extension for files which are available in a 32 bit

arch/x86/boot/compressed/efi.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,6 @@ typedef struct {
9797
u32 tables;
9898
} efi_system_table_32_t;
9999

100-
/* kexec external ABI */
101-
struct efi_setup_data {
102-
u64 fw_vendor;
103-
u64 __unused;
104-
u64 tables;
105-
u64 smbios;
106-
u64 reserved[8];
107-
};
108-
109100
struct efi_unaccepted_memory {
110101
u32 version;
111102
u32 unit_size;

arch/x86/include/asm/efi.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,6 @@ extern void efi_free_boot_services(void);
143143
void arch_efi_call_virt_setup(void);
144144
void arch_efi_call_virt_teardown(void);
145145

146-
/* kexec external ABI */
147-
struct efi_setup_data {
148-
u64 fw_vendor;
149-
u64 __unused;
150-
u64 tables;
151-
u64 smbios;
152-
u64 reserved[8];
153-
};
154-
155146
extern u64 efi_setup;
156147

157148
#ifdef CONFIG_EFI

arch/x86/include/asm/pci.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <linux/numa.h>
1111
#include <asm/io.h>
1212
#include <asm/memtype.h>
13-
#include <asm/setup_data.h>
1413

1514
struct pci_sysdata {
1615
int domain; /* PCI domain */
@@ -124,16 +123,4 @@ cpumask_of_pcibus(const struct pci_bus *bus)
124123
}
125124
#endif
126125

127-
struct pci_setup_rom {
128-
struct setup_data data;
129-
uint16_t vendor;
130-
uint16_t devid;
131-
uint64_t pcilen;
132-
unsigned long segment;
133-
unsigned long bus;
134-
unsigned long device;
135-
unsigned long function;
136-
uint8_t romdata[];
137-
};
138-
139126
#endif /* _ASM_X86_PCI_H */

arch/x86/include/asm/setup_data.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _ASM_X86_SETUP_DATA_H
3+
#define _ASM_X86_SETUP_DATA_H
4+
5+
#include <uapi/asm/setup_data.h>
6+
7+
#ifndef __ASSEMBLY__
8+
9+
struct pci_setup_rom {
10+
struct setup_data data;
11+
uint16_t vendor;
12+
uint16_t devid;
13+
uint64_t pcilen;
14+
unsigned long segment;
15+
unsigned long bus;
16+
unsigned long device;
17+
unsigned long function;
18+
uint8_t romdata[];
19+
};
20+
21+
/* kexec external ABI */
22+
struct efi_setup_data {
23+
u64 fw_vendor;
24+
u64 __unused;
25+
u64 tables;
26+
u64 smbios;
27+
u64 reserved[8];
28+
};
29+
30+
#endif /* __ASSEMBLY__ */
31+
32+
#endif /* _ASM_X86_SETUP_DATA_H */

0 commit comments

Comments
 (0)