direct-io.hg

view tools/misc/mbootpack/mbootpack.h @ 7477:5a7baecb1c70

Fix an issue for passing arguement from control panel to deivce model
for some arguemnt like 'localtime', 'isa', device model need an argument
"-localtime", instead of "-localtime 1"
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Sun Oct 23 16:51:47 2005 +0100 (2005-10-23)
parents 06d84bf87159
children
line source
1 /*
2 * mbootpack.h
3 *
4 * Common definitions for mbootpack
5 *
6 * Copyright (C) 2003-2004 Tim Deegan (tjd21@cl.cam.ac.uk)
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of the
11 * License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 * 02111-1307, USA.
22 *
23 * $Id: mbootpack.h,v 1.2 2005/03/23 10:38:37 tjd21 Exp $
24 *
25 */
27 #ifndef __MBOOTPACK__H__
28 #define __MBOOTPACK__H__
30 #ifndef __MB_ASM
32 #undef NDEBUG
33 #include <stdio.h>
35 #include <endian.h>
36 #include <byteswap.h>
37 #if __BYTE_ORDER == __LITTLE_ENDIAN
38 #define eswap(x) (x)
39 #else
40 #define eswap(x) \
41 ({ \
42 typeof(x) y = (x); \
43 switch(sizeof(y)) \
44 { \
45 case 2: y = __bswap_16(y); break; \
46 case 4: y = __bswap_32(y); break; \
47 case 8: y = __bswap_64(y); break; \
48 } \
49 y; \
50 })
51 #endif
53 /* Flags */
54 extern int quiet;
56 /* Types */
57 typedef unsigned long address_t;
59 typedef struct section_t {
60 char *buffer;
61 address_t start;
62 long int size;
63 struct section_t *prev;
64 struct section_t *next;
65 } section_t;
67 /* buildimage.c */
68 extern void make_bzImage(section_t *sections,
69 address_t entry,
70 address_t mbi,
71 FILE *fp);
73 address_t place_mbi(long int size);
76 /* trampoline.S */
77 extern unsigned char mb_trampoline[];
78 extern unsigned char mb_trampoline_end[];
79 extern volatile address_t mb_mbi_address, mb_entry_address;
81 /* Macros */
82 #define MIN(_x,_y) (((_x)<=(_y))?(_x):(_y))
83 #define MAX(_x,_y) (((_x)<=(_y))?(_y):(_x))
84 #define ROUNDUP_P2(_x, _a) (((_x)+((_a)-1))&(~((_a)-1)))
86 #endif
88 /* x86 memory: such fun */
89 #define MEM_HOLE_START 0xa0000
90 #define MEM_HOLE_END 0x100000
91 #define HIGHMEM_START MEM_HOLE_END
92 #define X86_PAGE_SIZE 0x1000
94 /* How much command line we'll take from the bootloader. */
95 #define CMD_LINE_SPACE 0x300
97 /* Number of 512-byte sectors to load in low memory (max 7) */
98 #define SETUPSECTS 7
101 /* Who are we? */
102 #define MBOOTPACK_VERSION_STRING "v0.2 (alpha)"
104 #endif /* __MBOOTPACK__H__ */
106 /*
107 * EOF (mbootpack.h)
108 */