Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Modified boot and vmxassist to handle real/protected transition.
[palacios.git] / bios / vmxassist / util.h
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 #define offsetof(type, member)  ((unsigned) &((type *)0)->member)
27
28 struct vmx_assist_context;
29
30 #include "e820.h"
31
32 extern void cpuid_addr_value(uint64_t addr, uint64_t *value);
33 extern void hexdump(unsigned char *, int);
34 extern void dump_regs(struct regs *);
35 extern void dump_vmx_context(struct vmx_assist_context *);
36 extern void print_e820_map(struct e820entry *, int);
37 extern void dump_dtr(unsigned long, unsigned long);
38 extern void *memcpy(void *, const void *, unsigned);
39 extern void *memset(void *, int, unsigned);
40 extern int printf(const char *fmt, ...);
41 extern int vprintf(const char *fmt, va_list ap);
42 extern void panic(const char *format, ...);
43 extern void halt(void);
44
45 #endif /* __UTIL_H__ */