aboutsummaryrefslogtreecommitdiffstats
path: root/stubdom/grub/osdep.h
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-06-18 09:36:47 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-06-18 09:36:47 +0100
commita2c7db64f561821fd528614e68c4d92718210126 (patch)
tree79c7e1c3ef49b5b4272fd12d36420e6fb8d23cd1 /stubdom/grub/osdep.h
parent7074b13cee246f09b3b0a2a6da139b2e047cf4a4 (diff)
downloadxen-a2c7db64f561821fd528614e68c4d92718210126.tar.gz
xen-a2c7db64f561821fd528614e68c4d92718210126.tar.bz2
xen-a2c7db64f561821fd528614e68c4d92718210126.zip
Add PV-GRUB
This fetches GRUB1 sources, applies the {graphical, print function, save default, and ext3_256byte} patches from debian, and applies a patch to make it work on x86_64 and port it to Mini-OS. By using libxc, PV-GRUB can then "kexec" the loaded kernel from inside the domain itself, hence permitting to avoid the security-concerned pygrub. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Diffstat (limited to 'stubdom/grub/osdep.h')
-rw-r--r--stubdom/grub/osdep.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/stubdom/grub/osdep.h b/stubdom/grub/osdep.h
new file mode 100644
index 0000000000..1d3e50adbf
--- /dev/null
+++ b/stubdom/grub/osdep.h
@@ -0,0 +1,30 @@
+#ifndef __OSDEP_H__
+#define __OSDEP_H__
+
+#include <byteswap.h>
+#define swap32(x) bswap_32(x)
+#define swap16(x) bswap_16(x)
+
+#include <machine/endian.h>
+#if BYTE_ORDER == BIG_ENDIAN
+#define htons(x) (x)
+#define ntohs(x) (x)
+#define htonl(x) (x)
+#define ntohl(x) (x)
+#else
+#define htons(x) swap16(x)
+#define ntohs(x) swap16(x)
+#define htonl(x) swap32(x)
+#define ntohl(x) swap32(x)
+#endif
+
+typedef unsigned long Address;
+
+/* ANSI prototyping macro */
+#ifdef __STDC__
+#define P(x) x
+#else
+#define P(x) ()
+#endif
+
+#endif