.. | .. |
---|
10 | 10 | #ifndef _LINUX_FLAT_H |
---|
11 | 11 | #define _LINUX_FLAT_H |
---|
12 | 12 | |
---|
13 | | -#include <uapi/linux/flat.h> |
---|
14 | | -#include <asm/flat.h> |
---|
| 13 | +#define FLAT_VERSION 0x00000004L |
---|
| 14 | + |
---|
| 15 | +/* |
---|
| 16 | + * To make everything easier to port and manage cross platform |
---|
| 17 | + * development, all fields are in network byte order. |
---|
| 18 | + */ |
---|
| 19 | + |
---|
| 20 | +struct flat_hdr { |
---|
| 21 | + char magic[4]; |
---|
| 22 | + __be32 rev; /* version (as above) */ |
---|
| 23 | + __be32 entry; /* Offset of first executable instruction |
---|
| 24 | + with text segment from beginning of file */ |
---|
| 25 | + __be32 data_start; /* Offset of data segment from beginning of |
---|
| 26 | + file */ |
---|
| 27 | + __be32 data_end; /* Offset of end of data segment from beginning |
---|
| 28 | + of file */ |
---|
| 29 | + __be32 bss_end; /* Offset of end of bss segment from beginning |
---|
| 30 | + of file */ |
---|
| 31 | + |
---|
| 32 | + /* (It is assumed that data_end through bss_end forms the bss segment.) */ |
---|
| 33 | + |
---|
| 34 | + __be32 stack_size; /* Size of stack, in bytes */ |
---|
| 35 | + __be32 reloc_start; /* Offset of relocation records from beginning of |
---|
| 36 | + file */ |
---|
| 37 | + __be32 reloc_count; /* Number of relocation records */ |
---|
| 38 | + __be32 flags; |
---|
| 39 | + __be32 build_date; /* When the program/library was built */ |
---|
| 40 | + __u32 filler[5]; /* Reservered, set to zero */ |
---|
| 41 | +}; |
---|
| 42 | + |
---|
| 43 | +#define FLAT_FLAG_RAM 0x0001 /* load program entirely into RAM */ |
---|
| 44 | +#define FLAT_FLAG_GOTPIC 0x0002 /* program is PIC with GOT */ |
---|
| 45 | +#define FLAT_FLAG_GZIP 0x0004 /* all but the header is compressed */ |
---|
| 46 | +#define FLAT_FLAG_GZDATA 0x0008 /* only data/relocs are compressed (for XIP) */ |
---|
| 47 | +#define FLAT_FLAG_KTRACE 0x0010 /* output useful kernel trace for debugging */ |
---|
15 | 48 | |
---|
16 | 49 | /* |
---|
17 | 50 | * While it would be nice to keep this header clean, users of older |
---|
.. | .. |
---|
22 | 55 | * with the format above, except to fix bugs with old format support. |
---|
23 | 56 | */ |
---|
24 | 57 | |
---|
25 | | -#include <asm/byteorder.h> |
---|
26 | | - |
---|
27 | 58 | #define OLD_FLAT_VERSION 0x00000002L |
---|
28 | 59 | #define OLD_FLAT_RELOC_TYPE_TEXT 0 |
---|
29 | 60 | #define OLD_FLAT_RELOC_TYPE_DATA 1 |
---|
30 | 61 | #define OLD_FLAT_RELOC_TYPE_BSS 2 |
---|
31 | 62 | |
---|
32 | 63 | typedef union { |
---|
33 | | - unsigned long value; |
---|
| 64 | + u32 value; |
---|
34 | 65 | struct { |
---|
35 | | -# if defined(mc68000) && !defined(CONFIG_COLDFIRE) |
---|
36 | | - signed long offset : 30; |
---|
37 | | - unsigned long type : 2; |
---|
38 | | -# define OLD_FLAT_FLAG_RAM 0x1 /* load program entirely into RAM */ |
---|
| 66 | +#if defined(__LITTLE_ENDIAN_BITFIELD) || \ |
---|
| 67 | + (defined(mc68000) && !defined(CONFIG_COLDFIRE)) |
---|
| 68 | + s32 offset : 30; |
---|
| 69 | + u32 type : 2; |
---|
39 | 70 | # elif defined(__BIG_ENDIAN_BITFIELD) |
---|
40 | | - unsigned long type : 2; |
---|
41 | | - signed long offset : 30; |
---|
42 | | -# define OLD_FLAT_FLAG_RAM 0x1 /* load program entirely into RAM */ |
---|
43 | | -# elif defined(__LITTLE_ENDIAN_BITFIELD) |
---|
44 | | - signed long offset : 30; |
---|
45 | | - unsigned long type : 2; |
---|
46 | | -# define OLD_FLAT_FLAG_RAM 0x1 /* load program entirely into RAM */ |
---|
| 71 | + u32 type : 2; |
---|
| 72 | + s32 offset : 30; |
---|
47 | 73 | # else |
---|
48 | 74 | # error "Unknown bitfield order for flat files." |
---|
49 | 75 | # endif |
---|