Module Name: src Committed By: matt Date: Fri Aug 21 17:17:01 UTC 2009
Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: elf_machdep.h Log Message: Add prototypes for mips_netbsd_elfXX_probe to verify the current kernel and cpu support the ABI and architecture specified in the elf header. Add prototypes for moredump_elfXX_setup which will set the core dump elf flags to the current abi and what the architecture of the current cpu. To generate a diff of this commit: cvs rdiff -u -r1.10.96.2 -r1.10.96.3 src/sys/arch/mips/include/elf_machdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/mips/include/elf_machdep.h diff -u src/sys/arch/mips/include/elf_machdep.h:1.10.96.2 src/sys/arch/mips/include/elf_machdep.h:1.10.96.3 --- src/sys/arch/mips/include/elf_machdep.h:1.10.96.2 Thu Aug 20 07:48:43 2009 +++ src/sys/arch/mips/include/elf_machdep.h Fri Aug 21 17:17:01 2009 @@ -1,16 +1,24 @@ -/* $NetBSD: elf_machdep.h,v 1.10.96.2 2009/08/20 07:48:43 matt Exp $ */ +/* $NetBSD: elf_machdep.h,v 1.10.96.3 2009/08/21 17:17:01 matt Exp $ */ +#ifndef _MIPS_ELF_MACHDEP_H_ +#define _MIPS_ELF_MACHDEP_H_ + +#if defined(ELFSIZE) +#if ELFSIZE == 32 #define ELF32_MACHDEP_ID_CASES \ case EM_MIPS: \ break; +#define ELF32_MACHDEP_ID EM_MIPS +#endif +#if ELFSIZE == 64 #define ELF64_MACHDEP_ID_CASES \ case EM_MIPS: \ break; - -#define ELF32_MACHDEP_ID EM_MIPS #define ELF64_MACHDEP_ID EM_MIPS +#endif +#endif /* defined(ELFSIZE) */ #ifdef _LP64 #define ARCH_ELFSIZE 64 /* MD native binary size */ @@ -155,4 +163,23 @@ */ #define ELF_INTERP_NON_RELOCATABLE #endif /* COMPAT_16 */ + +/* + * We need to be able to include the ELF header so we can pick out the + * ABI being used. + */ +#ifdef ELFSIZE +#define ELF_MD_PROBE_FUNC ELFNAME2(mips_netbsd,probe) +#define ELF_MD_COREDUMP_SETUP ELFNAME2(coredump,setup) +#endif + +int mips_netbsd_elf32_probe(struct lwp *, struct exec_package *, void *, char *, + vaddr_t *); +void coredump_elf32_setup(struct lwp *, void *); + +int mips_netbsd_elf64_probe(struct lwp *, struct exec_package *, void *, char *, + vaddr_t *); +void coredump_elf64_setup(struct lwp *, void *); #endif /* _KERNEL */ + +#endif /* _MIPS_ELF_MACHDEP_H_ */