direct-io.hg

view tools/firmware/vmxassist/util.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 63c1bb85fcea
children 21240dc9f2e8
line source
1 /*
2 * util.h: Useful utility functions.
3 *
4 * Leendert van Doorn, leendert@watson.ibm.com
5 * Copyright (c) 2005, International Business Machines Corporation.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms and conditions of the GNU General Public License,
9 * version 2, as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18 * Place - Suite 330, Boston, MA 02111-1307 USA.
19 */
20 #ifndef __UTIL_H__
21 #define __UTIL_H__
23 #include <stdarg.h>
24 #include <vm86.h>
27 #define LINUX_E820_MAP_NR ((unsigned char *)0x901E8)
28 #define LINUX_E820_MAP ((struct e820entry *)0x902D0)
30 #define E820_RAM 1
31 #define E820_RESERVED 2
32 #define E820_ACPI 3
33 #define E820_NVS 4
34 #define E820_IO 16
35 #define E820_SHARED 17
37 struct e820entry {
38 unsigned long long addr;
39 unsigned long long size;
40 unsigned long type;
41 } __attribute__((packed));
44 #define offsetof(type, member) ((unsigned) &((type *)0)->member)
46 struct vmx_assist_context;
48 extern void hexdump(unsigned char *, int);
49 extern void dump_regs(struct regs *);
50 extern void dump_vmx_context(struct vmx_assist_context *);
51 extern void print_e820_map(struct e820entry *, int);
52 extern void dump_dtr(unsigned long, unsigned long);
53 extern void *memcpy(void *, const void *, unsigned);
54 extern void *memset(void *, int, unsigned);
55 extern int printf(const char *fmt, ...);
56 extern int vprintf(const char *fmt, va_list ap);
57 extern void panic(const char *format, ...);
58 extern void halt(void);
60 #endif /* __UTIL_H__ */