]> xenbits.xensource.com Git - people/andrewcoop/hwloc.git/commitdiff
tests/ports: add cross-testing
authorBrice Goglin <Brice.Goglin@inria.fr>
Mon, 6 Jan 2014 18:01:28 +0000 (18:01 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 13 Feb 2014 13:10:22 +0000 (13:10 +0000)
config/hwloc_internal.m4
tests/ports/Makefile.am
tests/ports/include/xen/xenctrl.h [new file with mode: 0644]

index e81e2ca70f3804101dcfb341bbaca894cbf560d2..db8b3f76255a4a989a77c14cccd22d58e4ab7ced 100644 (file)
@@ -422,6 +422,7 @@ int foo(void) {
        hwloc_config_prefix[tests/ports/topology-netbsd.c]:hwloc_config_prefix[src/topology-netbsd.c]
        hwloc_config_prefix[tests/ports/topology-hpux.c]:hwloc_config_prefix[src/topology-hpux.c]
        hwloc_config_prefix[tests/ports/topology-bgq.c]:hwloc_config_prefix[src/topology-bgq.c]
+       hwloc_config_prefix[tests/ports/topology-xen.c]:hwloc_config_prefix[src/topology-xen.c]
        hwloc_config_prefix[tests/ports/topology-opencl.c]:hwloc_config_prefix[src/topology-opencl.c]
        hwloc_config_prefix[tests/ports/topology-cuda.c]:hwloc_config_prefix[src/topology-cuda.c]
        hwloc_config_prefix[tests/ports/topology-nvml.c]:hwloc_config_prefix[src/topology-nvml.c]
index 7bbdbfe0064afd0694e5ff2c9dd440917ce91a0d..b6cc5c36d689c36ba3c3aeac6256786bcfc280bd 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright © 2009-2012 Inria.  All rights reserved.
+# Copyright © 2009-2014 Inria.  All rights reserved.
 # Copyright © 2009, 2011-2012 Université Bordeaux 1
 # Copyright © 2009-2010 Cisco Systems, Inc.  All rights reserved.
 # See COPYING in top-level directory.
@@ -20,6 +20,7 @@ check_LTLIBRARIES = \
        libhwloc-port-osf.la \
        libhwloc-port-solaris.la \
        libhwloc-port-windows.la \
+       libhwloc-port-xen.la \
        libhwloc-port-opencl.la \
        libhwloc-port-cuda.la \
        libhwloc-port-nvml.la \
@@ -138,6 +139,13 @@ libhwloc_port_windows_la_CPPFLAGS = $(common_CPPFLAGS) \
        -DHWLOC_WIN_SYS \
        -DHAVE__SC_LARGE_PAGESIZE -D_SC_LARGE_PAGESIZE=33
 
+nodist_libhwloc_port_xen_la_SOURCES = topology-xen.c
+libhwloc_port_xen_la_SOURCES = \
+       include/xen/xenctrl.h
+libhwloc_port_xen_la_CPPFLAGS = $(common_CPPFLAGS) \
+       -I$(HWLOC_top_srcdir)/tests/ports/include/xen \
+       -DHWLOC_XEN_SYS
+
 nodist_libhwloc_port_opencl_la_SOURCES = topology-opencl.c
 libhwloc_port_opencl_la_SOURCES = \
        include/opencl/CL/cl_ext.h
diff --git a/tests/ports/include/xen/xenctrl.h b/tests/ports/include/xen/xenctrl.h
new file mode 100644 (file)
index 0000000..1fc9ad8
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright © 2014 Inria.  All rights reserved.
+ * Copyright © 2014 Citrix Systems Ltd.
+ * See COPYING in top-level directory.
+ */
+
+#ifndef HWLOC_PORT_XEN_XENCTRL_H
+#define HWLOC_PORT_XEN_XENCTRL_H
+
+typedef struct xc_interface_core xc_interface;
+
+xc_interface *xc_interface_open(void *, void *, unsigned);
+int xc_interface_close(xc_interface *);
+
+struct xen_sysctl_physinfo {
+    uint32_t threads_per_core;
+    uint32_t cores_per_socket;
+    uint32_t nr_cpus;
+    uint32_t max_cpu_id;
+    uint32_t nr_nodes;
+    uint32_t max_node_id;
+};
+typedef struct xen_sysctl_physinfo xen_sysctl_physinfo_t;
+typedef xen_sysctl_physinfo_t xc_physinfo_t;
+
+typedef enum xentoollog_level {
+    XTL_NONE,
+    XTL_DEBUG,
+    XTL_VERBOSE,
+    XTL_DETAIL,
+    XTL_PROGRESS,
+    XTL_INFO,
+    XTL_NOTICE,
+    XTL_WARN,
+    XTL_ERROR,
+    XTL_CRITICAL,
+    XTL_NUM_LEVELS
+} xentoollog_level;
+
+typedef struct xentoollog_logger xentoollog_logger;
+struct xentoollog_logger {
+    void (*vmessage)(struct xentoollog_logger *,
+                     xentoollog_level, int,
+                     const char *, const char *, va_list)
+         __attribute__((format(printf,5,0)));
+    void (*progress)(struct xentoollog_logger *,
+                     const char *, const char *,
+                     int, unsigned long, unsigned long );
+    void (*destroy)(struct xentoollog_logger *);
+};
+
+
+int xc_physinfo(xc_interface *, xc_physinfo_t *);
+
+int xc_topologyinfo_bounced(xc_interface *, uint32_t *, uint32_t *, uint32_t *, uint32_t *);
+
+int xc_numainfo_bounced(xc_interface *, uint32_t *, uint64_t *, uint64_t *, uint32_t *);
+
+#endif /* HWLOC_PORT_XEN_XENCTRL_H */