-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x86: convert almost generic headers to asm-generic version
In x86, mman.h, module.h, scatterlist.h, types.h and ucontext.h can use the asm-generic version by just defining the x86 specific parts locally and falling back on the generic code for the common bits. This patch illustrates the differences between the x86 and asm-generic versions by changing a file that is initially identical to the x86 version to one that is identical to the asm-generic version. Signed-off-by: Arnd Bergmann <arnd@arndb.de> LKML-Reference: <cover.1245354003.git.arnd@arndb.de> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
- Loading branch information
Arnd Bergmann
authored and
H. Peter Anvin
committed
Jun 18, 2009
1 parent
7bfd124
commit 06f5013
Showing
10 changed files
with
73 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,22 @@ | ||
#ifndef _ASM_X86_MODULE_H | ||
#define _ASM_X86_MODULE_H | ||
#ifndef __ASM_GENERIC_MODULE_H | ||
#define __ASM_GENERIC_MODULE_H | ||
|
||
/* x86_32/64 are simple */ | ||
struct mod_arch_specific {}; | ||
/* | ||
* Many architectures just need a simple module | ||
* loader without arch specific data. | ||
*/ | ||
struct mod_arch_specific | ||
{ | ||
}; | ||
|
||
#ifdef CONFIG_X86_32 | ||
# define Elf_Shdr Elf32_Shdr | ||
# define Elf_Sym Elf32_Sym | ||
# define Elf_Ehdr Elf32_Ehdr | ||
#ifdef CONFIG_64BIT | ||
#define Elf_Shdr Elf64_Shdr | ||
#define Elf_Sym Elf64_Sym | ||
#define Elf_Ehdr Elf64_Ehdr | ||
#else | ||
# define Elf_Shdr Elf64_Shdr | ||
# define Elf_Sym Elf64_Sym | ||
# define Elf_Ehdr Elf64_Ehdr | ||
#define Elf_Shdr Elf32_Shdr | ||
#define Elf_Sym Elf32_Sym | ||
#define Elf_Ehdr Elf32_Ehdr | ||
#endif | ||
|
||
#ifdef CONFIG_X86_64 | ||
/* X86_64 does not define MODULE_PROC_FAMILY */ | ||
#elif defined CONFIG_M386 | ||
#define MODULE_PROC_FAMILY "386 " | ||
#elif defined CONFIG_M486 | ||
#define MODULE_PROC_FAMILY "486 " | ||
#elif defined CONFIG_M586 | ||
#define MODULE_PROC_FAMILY "586 " | ||
#elif defined CONFIG_M586TSC | ||
#define MODULE_PROC_FAMILY "586TSC " | ||
#elif defined CONFIG_M586MMX | ||
#define MODULE_PROC_FAMILY "586MMX " | ||
#elif defined CONFIG_MCORE2 | ||
#define MODULE_PROC_FAMILY "CORE2 " | ||
#elif defined CONFIG_M686 | ||
#define MODULE_PROC_FAMILY "686 " | ||
#elif defined CONFIG_MPENTIUMII | ||
#define MODULE_PROC_FAMILY "PENTIUMII " | ||
#elif defined CONFIG_MPENTIUMIII | ||
#define MODULE_PROC_FAMILY "PENTIUMIII " | ||
#elif defined CONFIG_MPENTIUMM | ||
#define MODULE_PROC_FAMILY "PENTIUMM " | ||
#elif defined CONFIG_MPENTIUM4 | ||
#define MODULE_PROC_FAMILY "PENTIUM4 " | ||
#elif defined CONFIG_MK6 | ||
#define MODULE_PROC_FAMILY "K6 " | ||
#elif defined CONFIG_MK7 | ||
#define MODULE_PROC_FAMILY "K7 " | ||
#elif defined CONFIG_MK8 | ||
#define MODULE_PROC_FAMILY "K8 " | ||
#elif defined CONFIG_X86_ELAN | ||
#define MODULE_PROC_FAMILY "ELAN " | ||
#elif defined CONFIG_MCRUSOE | ||
#define MODULE_PROC_FAMILY "CRUSOE " | ||
#elif defined CONFIG_MEFFICEON | ||
#define MODULE_PROC_FAMILY "EFFICEON " | ||
#elif defined CONFIG_MWINCHIPC6 | ||
#define MODULE_PROC_FAMILY "WINCHIPC6 " | ||
#elif defined CONFIG_MWINCHIP3D | ||
#define MODULE_PROC_FAMILY "WINCHIP3D " | ||
#elif defined CONFIG_MCYRIXIII | ||
#define MODULE_PROC_FAMILY "CYRIXIII " | ||
#elif defined CONFIG_MVIAC3_2 | ||
#define MODULE_PROC_FAMILY "VIAC3-2 " | ||
#elif defined CONFIG_MVIAC7 | ||
#define MODULE_PROC_FAMILY "VIAC7 " | ||
#elif defined CONFIG_MGEODEGX1 | ||
#define MODULE_PROC_FAMILY "GEODEGX1 " | ||
#elif defined CONFIG_MGEODE_LX | ||
#define MODULE_PROC_FAMILY "GEODE " | ||
#else | ||
#error unknown processor family | ||
#endif | ||
|
||
#ifdef CONFIG_X86_32 | ||
# ifdef CONFIG_4KSTACKS | ||
# define MODULE_STACKSIZE "4KSTACKS " | ||
# else | ||
# define MODULE_STACKSIZE "" | ||
# endif | ||
# define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_STACKSIZE | ||
#endif | ||
|
||
#endif /* _ASM_X86_MODULE_H */ | ||
#endif /* __ASM_GENERIC_MODULE_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,8 @@ | ||
#ifndef _ASM_X86_MMAN_H | ||
#define _ASM_X86_MMAN_H | ||
|
||
#include <asm-generic/mman-common.h> | ||
|
||
#define MAP_32BIT 0x40 /* only give out 32bit addresses */ | ||
|
||
#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ | ||
#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ | ||
#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ | ||
#define MAP_LOCKED 0x2000 /* pages are locked */ | ||
#define MAP_NORESERVE 0x4000 /* don't check for reservations */ | ||
#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ | ||
#define MAP_NONBLOCK 0x10000 /* do not block on IO */ | ||
#define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */ | ||
|
||
#define MCL_CURRENT 1 /* lock all current mappings */ | ||
#define MCL_FUTURE 2 /* lock all future mappings */ | ||
#include <asm/generic-mman.h> | ||
|
||
#endif /* _ASM_X86_MMAN_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,8 @@ | ||
#ifndef _ASM_X86_SCATTERLIST_H | ||
#define _ASM_X86_SCATTERLIST_H | ||
|
||
#include <asm/types.h> | ||
|
||
struct scatterlist { | ||
#ifdef CONFIG_DEBUG_SG | ||
unsigned long sg_magic; | ||
#endif | ||
unsigned long page_link; | ||
unsigned int offset; | ||
unsigned int length; | ||
dma_addr_t dma_address; | ||
unsigned int dma_length; | ||
}; | ||
|
||
#define ARCH_HAS_SG_CHAIN | ||
#define ISA_DMA_THRESHOLD (0x00ffffff) | ||
|
||
/* | ||
* These macros should be used after a pci_map_sg call has been done | ||
* to get bus addresses of each of the SG entries and their lengths. | ||
* You should only work with the number of sg entries pci_map_sg | ||
* returns. | ||
*/ | ||
#define sg_dma_address(sg) ((sg)->dma_address) | ||
#ifdef CONFIG_X86_32 | ||
# define sg_dma_len(sg) ((sg)->length) | ||
#else | ||
# define sg_dma_len(sg) ((sg)->dma_length) | ||
#endif | ||
#include <asm/generic-scatterlist.h> | ||
|
||
#endif /* _ASM_X86_SCATTERLIST_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters