source: trunk/packages/xen-3.1/xen-3.1/tools/firmware/vmxassist/util.h @ 34

Last change on this file since 34 was 34, checked in by hartmans, 17 years ago

Add xen and xen-common

File size: 1.7 KB
Line 
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__
22
23#include <stdarg.h>
24#include <vm86.h>
25
26#include <xen/hvm/e820.h>
27#define E820_MAP_NR ((unsigned char *)E820_MAP_PAGE + E820_MAP_NR_OFFSET)
28#define E820_MAP    ((struct e820entry *)(E820_MAP_PAGE + E820_MAP_OFFSET))
29
30#define offsetof(type, member)  ((unsigned) &((type *)0)->member)
31
32struct vmx_assist_context;
33
34extern void cpuid_addr_value(uint64_t addr, uint64_t *value);
35extern void hexdump(unsigned char *, int);
36extern void dump_regs(struct regs *);
37extern void dump_vmx_context(struct vmx_assist_context *);
38extern void print_e820_map(struct e820entry *, int);
39extern void dump_dtr(unsigned long, unsigned long);
40extern void *memcpy(void *, const void *, unsigned);
41extern void *memset(void *, int, unsigned);
42extern int printf(const char *fmt, ...);
43extern int vprintf(const char *fmt, va_list ap);
44extern void panic(const char *format, ...);
45extern void halt(void);
46
47#endif /* __UTIL_H__ */
Note: See TracBrowser for help on using the repository browser.