aboutsummaryrefslogtreecommitdiffstats
path: root/tools/misc
diff options
context:
space:
mode:
authorsmh22@firebug.cl.cam.ac.uk <smh22@firebug.cl.cam.ac.uk>2005-08-02 10:15:17 +0000
committersmh22@firebug.cl.cam.ac.uk <smh22@firebug.cl.cam.ac.uk>2005-08-02 10:15:17 +0000
commit6b3b33d853bb421a9ab641d5880f6033f09f6688 (patch)
treeaffc294b95d1142226f8e20b554f5f88e398184f /tools/misc
parentbd471dc416fa0c4269ad6d9896b86a0a9c80fbe7 (diff)
downloadxen-6b3b33d853bb421a9ab641d5880f6033f09f6688.tar.gz
xen-6b3b33d853bb421a9ab641d5880f6033f09f6688.tar.bz2
xen-6b3b33d853bb421a9ab641d5880f6033f09f6688.zip
Remainder of ACM patch (hgrrrr).
Signed-off-by: Reiner Sailer <sailer@watson.ibm.com> Signed-off-by: Steven Hand <steven@xensource.com>
Diffstat (limited to 'tools/misc')
-rw-r--r--tools/misc/policyprocessor/Makefile42
-rw-r--r--tools/misc/policyprocessor/c2j_include.c57
2 files changed, 99 insertions, 0 deletions
diff --git a/tools/misc/policyprocessor/Makefile b/tools/misc/policyprocessor/Makefile
new file mode 100644
index 0000000000..f1e34bc842
--- /dev/null
+++ b/tools/misc/policyprocessor/Makefile
@@ -0,0 +1,42 @@
+XEN_ROOT = ../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+CFLAGS += -static
+CFLAGS += -Wall
+CFLAGS += -Werror
+CFLAGS += -O3
+CFLAGS += -fno-strict-aliasing
+CFLAGS += -I.
+
+all: build
+
+build: mk-symlinks
+ $(MAKE) xml_to_bin
+
+default: all
+
+install: all
+
+xml_to_bin : make_include XmlToBin.java XmlToBinInterface.java SsidsEntry.java SecurityLabel.java myHandler.java
+ javac XmlToBin.java
+
+make_include : c2j_include
+ ./c2j_include
+
+c2j_include: c2j_include.c
+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $<
+
+clean:
+ rm -rf *.class xen c2j_include policy_version.java *.bin
+
+
+LINUX_ROOT := $(XEN_ROOT)/linux-2.6-xen-sparse
+mk-symlinks:
+ [ -e xen/linux ] || mkdir -p xen/linux
+ [ -e xen/io ] || mkdir -p xen/io
+ ( cd xen >/dev/null ; \
+ ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
+ ( cd xen/io >/dev/null ; \
+ ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
+ ( cd xen/linux >/dev/null ; \
+ ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )
diff --git a/tools/misc/policyprocessor/c2j_include.c b/tools/misc/policyprocessor/c2j_include.c
new file mode 100644
index 0000000000..cef70509ae
--- /dev/null
+++ b/tools/misc/policyprocessor/c2j_include.c
@@ -0,0 +1,57 @@
+/****************************************************************
+ * c2j_include.c
+ *
+ * Copyright (C) 2005 IBM Corporation
+ *
+ * Authors:
+ * Reiner Sailer <sailer@watson.ibm.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, version 2 of the
+ * License.
+ *
+ * This tool makes some constants from acm.h available to the
+ * java policyprocessor for version checking.
+ */
+#include <stdio.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+typedef uint8_t u8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef uint64_t u64;
+typedef int8_t s8;
+typedef int16_t s16;
+typedef int32_t s32;
+typedef int64_t s64;
+
+#include <xen/acm.h>
+
+char *filename = "policy_version.java";
+
+int main(int argc, char **argv)
+{
+
+ FILE *fd;
+ if ((fd = fopen(filename, "w")) <= 0)
+ {
+ printf("File %s not found.\n", filename);
+ exit(-ENOENT);
+ }
+
+ fprintf(fd, "/*\n * This file was automatically generated\n");
+ fprintf(fd, " * Do not change it manually!\n */\n");
+ fprintf(fd, "public class policy_version {\n");
+ fprintf(fd, " final int ACM_POLICY_VERSION = %x;\n",
+ ACM_POLICY_VERSION);
+ fprintf(fd, " final int ACM_CHWALL_VERSION = %x;\n",
+ ACM_CHWALL_VERSION);
+ fprintf(fd, " final int ACM_STE_VERSION = %x;\n",
+ ACM_STE_VERSION);
+ fprintf(fd, "}\n");
+ fclose(fd);
+ return 0;
+}