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