diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2008-12-26 15:35:41 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-26 15:35:41 -0800 |
commit | e1648a8194117c7afeb432afb0d10896e10cbea4 (patch) | |
tree | 8d8940aa54c06b471b6aa942716064b83bfe7a7f /arch/sparc/include/asm/module.h | |
parent | fe6875ec5c3ca7f6bcb399b6649ba2b64744df51 (diff) | |
download | blackbird-op-linux-e1648a8194117c7afeb432afb0d10896e10cbea4.tar.gz blackbird-op-linux-e1648a8194117c7afeb432afb0d10896e10cbea4.zip |
sparc: unify module.h
Use some preprocessor magic in combination with the
newly introduced CONFIG_BITS to unify module.h.
A few additional symbols are added as they are needed in a follow-up patch
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/include/asm/module.h')
-rw-r--r-- | arch/sparc/include/asm/module.h | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/arch/sparc/include/asm/module.h b/arch/sparc/include/asm/module.h index e82cf9a3e60e..ff8e02d80334 100644 --- a/arch/sparc/include/asm/module.h +++ b/arch/sparc/include/asm/module.h @@ -1,8 +1,24 @@ -#ifndef ___ASM_SPARC_MODULE_H -#define ___ASM_SPARC_MODULE_H -#if defined(__sparc__) && defined(__arch64__) -#include <asm/module_64.h> -#else -#include <asm/module_32.h> -#endif -#endif +#ifndef __SPARC_MODULE_H +#define __SPARC_MODULE_H +struct mod_arch_specific { }; + +/* + * Use some preprocessor magic to define the correct symbol + * for sparc32 and sparc64. + * Elf_Addr becomes Elf32_Addr for sparc32 and Elf64_Addr for sparc64 + */ +#define ___ELF(a, b, c) a##b##c +#define __ELF(a, b, c) ___ELF(a, b, c) +#define _Elf(t) __ELF(Elf, CONFIG_BITS, t) +#define _ELF(t) __ELF(ELF, CONFIG_BITS, t) + +#define Elf_Shdr _Elf(_Shdr) +#define Elf_Sym _Elf(_Sym) +#define Elf_Ehdr _Elf(_Ehdr) +#define Elf_Rela _Elf(_Rela) +#define Elf_Addr _Elf(_Addr) + +#define ELF_R_SYM _ELF(_R_SYM) +#define ELF_R_TYPE _ELF(_R_TYPE) + +#endif /* __SPARC_MODULE_H */ |