Subversion Repositories freemyipod

Rev

Rev 445 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
445 theseven 1
/*
2
 * Copyright (C) 2002-2005  David McCullough <davidm@snapgear.com>
3
 * Copyright (C) 1998       Kenneth Albanowski <kjahds@kjahds.com>
4
 *                          The Silver Hammer Group, Ltd.
5
 *
6
 * This file provides the definitions and structures needed to
7
 * support uClinux flat-format executables.
8
 *
9
 * This is Free Software, under the GNU Public Licence v2 or greater.
10
 *
11
 */
12
 
13
#ifndef _LINUX_FLAT_H
14
#define _LINUX_FLAT_H
15
 
16
#ifdef __KERNEL__
17
#include <linux/types.h>
18
#include <asm/flat.h>
19
#endif
20
#include <stdint.h>
21
 
22
 
23
#ifdef CONFIG_BINFMT_SHARED_FLAT
24
#define	MAX_SHARED_LIBS			(4)
25
#else
26
#define	MAX_SHARED_LIBS			(1)
27
#endif
28
 
29
/*
30
 * To make everything easier to port and manage cross platform
31
 * development,  all fields are in network byte order.
32
 */
33
 
450 theseven 34
#define	EMCOREAPP_HEADER_VERSION 1
35
struct emcoreapp_header
36
{
37
	char signature[8];
38
	uint32_t version version;
39
    off_t textstart;
40
    size_t textsize;
41
    size_t bsssize;
42
    size_t stacksize;
43
	off_t entrypoint;
44
	off_t relocstart;
45
	uint32_t reloccount;
46
	uint32_t flags;
47
    uint32_t creationtime;
48
};
445 theseven 49
 
450 theseven 50
#define HEADER_FLAG_UCL 0x00000001 /* all but the header is compressed */
445 theseven 51
 
52
#ifdef __KERNEL__ /* so systems without linux headers can compile the apps */
53
/*
54
 * While it would be nice to keep this header clean,  users of older
55
 * tools still need this support in the kernel.  So this section is
56
 * purely for compatibility with old tool chains.
57
 *
58
 * DO NOT make changes or enhancements to the old format please,  just work
59
 *        with the format above,  except to fix bugs with old format support.
60
 */
61
 
62
#include <asm/byteorder.h>
63
 
64
#define	OLD_FLAT_VERSION		0x00000002L
65
#define OLD_FLAT_RELOC_TYPE_TEXT	0
66
#define OLD_FLAT_RELOC_TYPE_DATA	1
67
#define OLD_FLAT_RELOC_TYPE_BSS		2
68
 
69
typedef union {
70
    uint32_t        value;
71
    struct {
72
# if defined(mc68000) && !defined(CONFIG_COLDFIRE)
73
        int32_t     offset : 30;
74
        uint32_t    type   : 2;
75
#   	define OLD_FLAT_FLAG_RAM    0x1 /* load program entirely into RAM */
76
# elif defined(__BIG_ENDIAN_BITFIELD)
77
        uint32_t    type   : 2;
78
        int32_t     offset : 30;
79
#   	define OLD_FLAT_FLAG_RAM    0x1 /* load program entirely into RAM */
80
# elif defined(__LITTLE_ENDIAN_BITFIELD)
81
        int32_t     offset : 30;
82
        uint32_t    type   : 2;
83
#   	define OLD_FLAT_FLAG_RAM    0x1 /* load program entirely into RAM */
84
# else
85
#   	error "Unknown bitfield order for flat files."
86
# endif
87
    } reloc;
88
} flat_v2_reloc_t;
89
 
90
#endif /* __KERNEL__ */
91
 
92
#endif /* _LINUX_FLAT_H */
93
 
94
/* this __MUST__ be at the VERY end of the file - do NOT move!!
95
 * Local Variables:
96
 * c-basic-offset: 4
97
 * tab-width: 8
98
 * end:
99
 * vi: tabstop=8 shiftwidth=4 textwidth=79 noexpandtab
100
 */