Home | History | Annotate | Line # | Download | only in common
      1 /*
      2  *	definitions for exec_kernel()
      3  *
      4  *	written by ITOH Yasufumi
      5  *	public domain
      6  *
      7  *	$NetBSD: execkern.h,v 1.5 2011/02/21 02:31:58 itohy Exp $
      8  */
      9 
     10 #ifndef X68K_BOOT_EXECKERN_H
     11 #define X68K_BOOT_EXECKERN_H
     12 
     13 /*
     14  * Max number of ``sections''.
     15  * Currently this includes: .text, .data, size sym, Elf32_Ehdr, Elf32_Shdr x 4,
     16  *	.shstrtab, .symtab, .strtab, .stab
     17  */
     18 #define XK_NSEC			12
     19 
     20 #ifndef __ASSEMBLER__
     21 
     22 #include <sys/types.h>
     23 #include <sys/exec_elf.h>
     24 
     25 struct execkern_arg {
     26 	/* Don't change this structure (see exec_sub.c). */
     27 	u_long		load_addr;	/* text start address */
     28 
     29 	struct execkern_section {
     30 		void	*sec_image;	/* section image source address */
     31 		u_long	sec_size;	/* section size */
     32 		u_long	sec_pad;	/* zero fill size after the image */
     33 	} sec[XK_NSEC];
     34 
     35 	unsigned	d5;		/* reserved */
     36 	int		rootdev;
     37 	u_long		boothowto;
     38 	u_long		entry_addr;
     39 	/* end of "Don't change this" */
     40 
     41 	int		elfsymsiz;
     42 	Elf32_Ehdr	ehdr;		/* saved ELF header */
     43 
     44 #define SHSTRTAB_FAKE	"\0.shstrtab\0.symtab\0.strtab\0.stab"
     45 #define SIZE_SHSTRTAB_FAKE_WITH_STAB	33	/* sizeof SHSTRTAB_FAKE */
     46 #define SIZE_SHSTRTAB_FAKE		27	/*   - sizeof ".stab" */
     47 #define SHNAME_OFF_SHSTRTAB		1
     48 #define SHNAME_OFF_SYMTAB		11
     49 #define SHNAME_OFF_STRTAB		19
     50 #define SHNAME_OFF_STAB			27
     51 	char shstrtab_fake[SIZE_SHSTRTAB_FAKE_WITH_STAB];
     52 };
     53 
     54 int xk_load(struct execkern_arg *, void *, u_long);
     55 void __dead exec_kernel(struct execkern_arg *);
     56 
     57 #endif /* __ASSEMBLER__ */
     58 
     59 #endif /* X68K_BOOT_EXECKERN_H */
     60