Subversion Repositories freemyipod

Rev

Rev 445 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 445 Rev 450
Line 17... Line 17...
17
#include <linux/types.h>
17
#include <linux/types.h>
18
#include <asm/flat.h>
18
#include <asm/flat.h>
19
#endif
19
#endif
20
#include <stdint.h>
20
#include <stdint.h>
21
 
21
 
22
#define	FLAT_VERSION			0x00000004L
-
 
23
 
22
 
24
#ifdef CONFIG_BINFMT_SHARED_FLAT
23
#ifdef CONFIG_BINFMT_SHARED_FLAT
25
#define	MAX_SHARED_LIBS			(4)
24
#define	MAX_SHARED_LIBS			(4)
26
#else
25
#else
27
#define	MAX_SHARED_LIBS			(1)
26
#define	MAX_SHARED_LIBS			(1)
Line 30... Line 29...
30
/*
29
/*
31
 * To make everything easier to port and manage cross platform
30
 * To make everything easier to port and manage cross platform
32
 * development,  all fields are in network byte order.
31
 * development,  all fields are in network byte order.
33
 */
32
 */
34
 
33
 
-
 
34
#define	EMCOREAPP_HEADER_VERSION 1
35
struct flat_hdr {
35
struct emcoreapp_header
-
 
36
{
36
    char magic[4];
37
	char signature[8];
37
    uint32_t rev;          /* version (as above) */
38
	uint32_t version version;
38
    uint32_t entry;        /* Offset of first executable instruction
-
 
39
                              with text segment from beginning of file */
-
 
40
    uint32_t data_start;   /* Offset of data segment from beginning of
-
 
41
                              file */
39
    off_t textstart;
42
    uint32_t data_end;     /* Offset of end of data segment from beginning
-
 
43
                              of file */
40
    size_t textsize;
44
    uint32_t bss_end;      /* Offset of end of bss segment from beginning
-
 
45
                              of file */
41
    size_t bsssize;
46
 
-
 
47
    /* (It is assumed that data_end through bss_end forms the bss segment.) */
-
 
48
 
-
 
49
    uint32_t stack_size;   /* Size of stack, in bytes */
42
    size_t stacksize;
50
    uint32_t reloc_start;  /* Offset of relocation records from beginning
43
	off_t entrypoint;
51
                              of file */
44
	off_t relocstart;
52
    uint32_t reloc_count;  /* Number of relocation records */
45
	uint32_t reloccount;
53
    uint32_t flags;       
46
	uint32_t flags;
54
    uint32_t build_date;   /* When the program/library was built */
-
 
55
    uint32_t filler[5];    /* Reservered, set to zero */
47
    uint32_t creationtime;
56
};
48
};
57
 
49
 
58
#define FLAT_FLAG_RAM    0x0001 /* load program entirely into RAM */
-
 
59
#define FLAT_FLAG_GOTPIC 0x0002 /* program is PIC with GOT */
-
 
60
#define FLAT_FLAG_GZIP   0x0004 /* all but the header is compressed */
50
#define HEADER_FLAG_UCL 0x00000001 /* all but the header is compressed */
61
#define FLAT_FLAG_GZDATA 0x0008 /* only data/relocs are compressed (for XIP) */
-
 
62
#define FLAT_FLAG_KTRACE 0x0010 /* output useful kernel trace for debugging */
-
 
63
#define FLAT_FLAG_L1STK  0x0020 /* use a 4k stack in L1 scratch memory.  */
-
 
64
 
51
 
65
#ifdef __KERNEL__ /* so systems without linux headers can compile the apps */
52
#ifdef __KERNEL__ /* so systems without linux headers can compile the apps */
66
/*
53
/*
67
 * While it would be nice to keep this header clean,  users of older
54
 * While it would be nice to keep this header clean,  users of older
68
 * tools still need this support in the kernel.  So this section is
55
 * tools still need this support in the kernel.  So this section is