Patchwork [26/40] xenner: kernel: xen-names

login
register
mail settings
Submitter Alexander Graf
Date Nov. 1, 2010, 3:01 p.m.
Message ID <1288623713-28062-27-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/69788/
State New
Headers show

Comments

Alexander Graf - Nov. 1, 2010, 3:01 p.m.
To resolve various names, we keep a generated version of xen-names around.
This helps with debug output.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 pc-bios/xenner/xen-names.c |  141 ++++++++++++++++++++++++++++++++++++++++++++
 pc-bios/xenner/xen-names.h |   68 +++++++++++++++++++++
 2 files changed, 209 insertions(+), 0 deletions(-)
 create mode 100644 pc-bios/xenner/xen-names.c
 create mode 100644 pc-bios/xenner/xen-names.h

Patch

diff --git a/pc-bios/xenner/xen-names.c b/pc-bios/xenner/xen-names.c
new file mode 100644
index 0000000..3448539
--- /dev/null
+++ b/pc-bios/xenner/xen-names.c
@@ -0,0 +1,141 @@ 
+/*
+ * don't edit, generated by xen/nametable.sh
+ */
+
+#include <inttypes.h>
+
+#include <xen/xen.h>
+#include <xen/version.h>
+#include <xen/sched.h>
+#include <xen/memory.h>
+#include <xen/nmi.h>
+#include <xen/callback.h>
+#include <xen/physdev.h>
+#include <xen/vcpu.h>
+#include <xen/grant_table.h>
+
+/* --- __HYPERVISOR --- */
+const char *__hypervisor_names[] = {
+    [ __HYPERVISOR_multicall           ] = "multicall",
+    [ __HYPERVISOR_iret                ] = "iret",
+    [ __HYPERVISOR_sysctl              ] = "sysctl",
+    [ __HYPERVISOR_domctl              ] = "domctl",
+    [ __HYPERVISOR_mmuext_op           ] = "mmuext_op",
+};
+const int __hypervisor_count = sizeof(__hypervisor_names)/sizeof(__hypervisor_names[0]);
+
+/* --- XENVER --- */
+const char *xenver_names[] = {
+    [ XENVER_version                   ] = "version",
+    [ XENVER_extraversion              ] = "extraversion",
+    [ XENVER_capabilities              ] = "capabilities",
+    [ XENVER_changeset                 ] = "changeset",
+    [ XENVER_pagesize                  ] = "pagesize",
+    [ XENVER_commandline               ] = "commandline",
+};
+const int xenver_count = sizeof(xenver_names)/sizeof(xenver_names[0]);
+
+/* --- VMASST_TYPE --- */
+const char *vmasst_type_names[] = {
+};
+const int vmasst_type_count = sizeof(vmasst_type_names)/sizeof(vmasst_type_names[0]);
+
+/* --- VMASST_CMD --- */
+const char *vmasst_cmd_names[] = {
+    [ VMASST_CMD_enable                ] = "enable",
+    [ VMASST_CMD_disable               ] = "disable",
+};
+const int vmasst_cmd_count = sizeof(vmasst_cmd_names)/sizeof(vmasst_cmd_names[0]);
+
+/* --- SCHEDOP --- */
+const char *schedop_names[] = {
+    [ SCHEDOP_yield                    ] = "yield",
+    [ SCHEDOP_block                    ] = "block",
+    [ SCHEDOP_shutdown                 ] = "shutdown",
+    [ SCHEDOP_poll                     ] = "poll",
+};
+const int schedop_count = sizeof(schedop_names)/sizeof(schedop_names[0]);
+
+/* --- CONSOLEIO --- */
+const char *consoleio_names[] = {
+    [ CONSOLEIO_write                  ] = "write",
+    [ CONSOLEIO_read                   ] = "read",
+};
+const int consoleio_count = sizeof(consoleio_names)/sizeof(consoleio_names[0]);
+
+/* --- XENMEM --- */
+const char *xenmem_names[] = {
+    [ XENMEM_exchange                  ] = "exchange",
+};
+const int xenmem_count = sizeof(xenmem_names)/sizeof(xenmem_names[0]);
+
+/* --- XENNMI --- */
+const char *xennmi_names[] = {
+};
+const int xennmi_count = sizeof(xennmi_names)/sizeof(xennmi_names[0]);
+
+/* --- CALLBACKOP --- */
+const char *callbackop_names[] = {
+    [ CALLBACKOP_register              ] = "register",
+    [ CALLBACKOP_unregister            ] = "unregister",
+};
+const int callbackop_count = sizeof(callbackop_names)/sizeof(callbackop_names[0]);
+
+/* --- CALLBACKTYPE --- */
+const char *callbacktype_names[] = {
+    [ CALLBACKTYPE_event               ] = "event",
+    [ CALLBACKTYPE_failsafe            ] = "failsafe",
+    [ CALLBACKTYPE_syscall             ] = "syscall",
+    [ CALLBACKTYPE_nmi                 ] = "nmi",
+    [ CALLBACKTYPE_sysenter            ] = "sysenter",
+    [ CALLBACKTYPE_syscall32           ] = "syscall32",
+};
+const int callbacktype_count = sizeof(callbacktype_names)/sizeof(callbacktype_names[0]);
+
+/* --- MMUEXT --- */
+const char *mmuext_names[] = {
+};
+const int mmuext_count = sizeof(mmuext_names)/sizeof(mmuext_names[0]);
+
+/* --- PHYSDEVOP --- */
+const char *physdevop_names[] = {
+    [ PHYSDEVOP_eoi                    ] = "eoi",
+};
+const int physdevop_count = sizeof(physdevop_names)/sizeof(physdevop_names[0]);
+
+/* --- VCPUOP --- */
+const char *vcpuop_names[] = {
+    [ VCPUOP_initialise                ] = "initialise",
+    [ VCPUOP_up                        ] = "up",
+    [ VCPUOP_down                      ] = "down",
+};
+const int vcpuop_count = sizeof(vcpuop_names)/sizeof(vcpuop_names[0]);
+
+/* --- EVTCHNOP --- */
+const char *evtchnop_names[] = {
+    [ EVTCHNOP_close                   ] = "close",
+    [ EVTCHNOP_send                    ] = "send",
+    [ EVTCHNOP_status                  ] = "status",
+    [ EVTCHNOP_unmask                  ] = "unmask",
+    [ EVTCHNOP_reset                   ] = "reset",
+};
+const int evtchnop_count = sizeof(evtchnop_names)/sizeof(evtchnop_names[0]);
+
+/* --- VIRQ --- */
+const char *virq_names[] = {
+    [ VIRQ_TIMER                       ] = "TIMER",
+    [ VIRQ_DEBUG                       ] = "DEBUG",
+    [ VIRQ_CONSOLE                     ] = "CONSOLE",
+    [ VIRQ_TBUF                        ] = "TBUF",
+    [ VIRQ_DEBUGGER                    ] = "DEBUGGER",
+    [ VIRQ_XENOPROF                    ] = "XENOPROF",
+};
+const int virq_count = sizeof(virq_names)/sizeof(virq_names[0]);
+
+/* --- GNTTABOP --- */
+const char *gnttabop_names[] = {
+    [ GNTTABOP_transfer                ] = "transfer",
+    [ GNTTABOP_copy                    ] = "copy",
+};
+const int gnttabop_count = sizeof(gnttabop_names)/sizeof(gnttabop_names[0]);
+
diff --git a/pc-bios/xenner/xen-names.h b/pc-bios/xenner/xen-names.h
new file mode 100644
index 0000000..cf41fc5
--- /dev/null
+++ b/pc-bios/xenner/xen-names.h
@@ -0,0 +1,68 @@ 
+/*
+ * don't edit, generated by xen/nametable.sh
+ */
+
+extern const char *__hypervisor_names[];
+extern const int __hypervisor_count;
+#define __hypervisor_name(i) (((i) < __hypervisor_count && __hypervisor_names[i]) ? __hypervisor_names[i] : "UNKNOWN")
+
+extern const char *xenver_names[];
+extern const int xenver_count;
+#define xenver_name(i) (((i) < xenver_count && xenver_names[i]) ? xenver_names[i] : "UNKNOWN")
+
+extern const char *vmasst_type_names[];
+extern const int vmasst_type_count;
+#define vmasst_type_name(i) (((i) < vmasst_type_count && vmasst_type_names[i]) ? vmasst_type_names[i] : "UNKNOWN")
+
+extern const char *vmasst_cmd_names[];
+extern const int vmasst_cmd_count;
+#define vmasst_cmd_name(i) (((i) < vmasst_cmd_count && vmasst_cmd_names[i]) ? vmasst_cmd_names[i] : "UNKNOWN")
+
+extern const char *schedop_names[];
+extern const int schedop_count;
+#define schedop_name(i) (((i) < schedop_count && schedop_names[i]) ? schedop_names[i] : "UNKNOWN")
+
+extern const char *consoleio_names[];
+extern const int consoleio_count;
+#define consoleio_name(i) (((i) < consoleio_count && consoleio_names[i]) ? consoleio_names[i] : "UNKNOWN")
+
+extern const char *xenmem_names[];
+extern const int xenmem_count;
+#define xenmem_name(i) (((i) < xenmem_count && xenmem_names[i]) ? xenmem_names[i] : "UNKNOWN")
+
+extern const char *xennmi_names[];
+extern const int xennmi_count;
+#define xennmi_name(i) (((i) < xennmi_count && xennmi_names[i]) ? xennmi_names[i] : "UNKNOWN")
+
+extern const char *callbackop_names[];
+extern const int callbackop_count;
+#define callbackop_name(i) (((i) < callbackop_count && callbackop_names[i]) ? callbackop_names[i] : "UNKNOWN")
+
+extern const char *callbacktype_names[];
+extern const int callbacktype_count;
+#define callbacktype_name(i) (((i) < callbacktype_count && callbacktype_names[i]) ? callbacktype_names[i] : "UNKNOWN")
+
+extern const char *mmuext_names[];
+extern const int mmuext_count;
+#define mmuext_name(i) (((i) < mmuext_count && mmuext_names[i]) ? mmuext_names[i] : "UNKNOWN")
+
+extern const char *physdevop_names[];
+extern const int physdevop_count;
+#define physdevop_name(i) (((i) < physdevop_count && physdevop_names[i]) ? physdevop_names[i] : "UNKNOWN")
+
+extern const char *vcpuop_names[];
+extern const int vcpuop_count;
+#define vcpuop_name(i) (((i) < vcpuop_count && vcpuop_names[i]) ? vcpuop_names[i] : "UNKNOWN")
+
+extern const char *evtchnop_names[];
+extern const int evtchnop_count;
+#define evtchnop_name(i) (((i) < evtchnop_count && evtchnop_names[i]) ? evtchnop_names[i] : "UNKNOWN")
+
+extern const char *virq_names[];
+extern const int virq_count;
+#define virq_name(i) (((i) < virq_count && virq_names[i]) ? virq_names[i] : "UNKNOWN")
+
+extern const char *gnttabop_names[];
+extern const int gnttabop_count;
+#define gnttabop_name(i) (((i) < gnttabop_count && gnttabop_names[i]) ? gnttabop_names[i] : "UNKNOWN")
+