[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] arm: compile libxl


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Wed, 30 May 2012 13:22:15 +0000
  • Delivery-date: Wed, 30 May 2012 13:22:21 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
# Date 1338364669 -3600
# Node ID c3cbe6fb3f166aca231eda4ab86e10cfb862da84
# Parent  d3fe4a0d942a24878ea9ba4f7a3cb398879d1a35
arm: compile libxl

libxl_cpuid_destroy has been renamed to libxl_cpuid_dispose; also cpuid
functions are only available on x86, so move them to libxl_cpuid.c.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r d3fe4a0d942a -r c3cbe6fb3f16 tools/libxl/Makefile
--- a/tools/libxl/Makefile      Wed May 30 08:57:48 2012 +0100
+++ b/tools/libxl/Makefile      Wed May 30 08:57:49 2012 +0100
@@ -36,6 +36,7 @@ LIBXL_OBJS-y += libxl_noblktap2.o
 endif
 LIBXL_OBJS-$(CONFIG_X86) += libxl_cpuid.o
 LIBXL_OBJS-$(CONFIG_IA64) += libxl_nocpuid.o
+LIBXL_OBJS-$(CONFIG_ARM) += libxl_nocpuid.o
 
 ifeq ($(CONFIG_NetBSD),y)
 LIBXL_OBJS-y += libxl_netbsd.o
diff -r d3fe4a0d942a -r c3cbe6fb3f16 tools/libxl/libxl_cpuid.c
--- a/tools/libxl/libxl_cpuid.c Wed May 30 08:57:48 2012 +0100
+++ b/tools/libxl/libxl_cpuid.c Wed May 30 08:57:49 2012 +0100
@@ -333,6 +333,66 @@ void libxl_cpuid_set(libxl_ctx *ctx, uin
                      (const char**)(cpuid[i].policy), cpuid_res);
 }
 
+yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
+                                libxl_cpuid_policy_list *pcpuid)
+{
+    libxl_cpuid_policy_list cpuid = *pcpuid;
+    yajl_gen_status s;
+    const char *input_names[2] = { "leaf", "subleaf" };
+    const char *policy_names[4] = { "eax", "ebx", "ecx", "edx" };
+    int i, j;
+
+    /*
+     * Aiming for:
+     * [
+     *     { 'leaf':    'val-eax',
+     *       'subleaf': 'val-ecx',
+     *       'eax':     'filter',
+     *       'ebx':     'filter',
+     *       'ecx':     'filter',
+     *       'edx':     'filter' },
+     *     { 'leaf':    'val-eax', ..., 'eax': 'filter', ... },
+     *     ... etc ...
+     * ]
+     */
+
+    s = yajl_gen_array_open(hand);
+    if (s != yajl_gen_status_ok) goto out;
+
+    if (cpuid == NULL) goto empty;
+
+    for (i = 0; cpuid[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
+        s = yajl_gen_map_open(hand);
+        if (s != yajl_gen_status_ok) goto out;
+
+        for (j = 0; j < 2; j++) {
+            if (cpuid[i].input[j] != XEN_CPUID_INPUT_UNUSED) {
+                s = libxl__yajl_gen_asciiz(hand, input_names[j]);
+                if (s != yajl_gen_status_ok) goto out;
+                s = yajl_gen_integer(hand, cpuid[i].input[j]);
+                if (s != yajl_gen_status_ok) goto out;
+            }
+        }
+
+        for (j = 0; j < 4; j++) {
+            if (cpuid[i].policy[j] != NULL) {
+                s = libxl__yajl_gen_asciiz(hand, policy_names[j]);
+                if (s != yajl_gen_status_ok) goto out;
+                s = yajl_gen_string(hand,
+                               (const unsigned char *)cpuid[i].policy[j], 32);
+                if (s != yajl_gen_status_ok) goto out;
+            }
+        }
+        s = yajl_gen_map_close(hand);
+        if (s != yajl_gen_status_ok) goto out;
+    }
+
+empty:
+    s = yajl_gen_array_close(hand);
+out:
+    return s;
+}
+
 /*
  * Local variables:
  * mode: C
diff -r d3fe4a0d942a -r c3cbe6fb3f16 tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c  Wed May 30 08:57:48 2012 +0100
+++ b/tools/libxl/libxl_json.c  Wed May 30 08:57:49 2012 +0100
@@ -146,66 +146,6 @@ out:
     return s;
 }
 
-yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
-                                libxl_cpuid_policy_list *pcpuid)
-{
-    libxl_cpuid_policy_list cpuid = *pcpuid;
-    yajl_gen_status s;
-    const char *input_names[2] = { "leaf", "subleaf" };
-    const char *policy_names[4] = { "eax", "ebx", "ecx", "edx" };
-    int i, j;
-
-    /*
-     * Aiming for:
-     * [
-     *     { 'leaf':    'val-eax',
-     *       'subleaf': 'val-ecx',
-     *       'eax':     'filter',
-     *       'ebx':     'filter',
-     *       'ecx':     'filter',
-     *       'edx':     'filter' },
-     *     { 'leaf':    'val-eax', ..., 'eax': 'filter', ... },
-     *     ... etc ...
-     * ]
-     */
-
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok) goto out;
-
-    if (cpuid == NULL) goto empty;
-
-    for (i = 0; cpuid[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
-        s = yajl_gen_map_open(hand);
-        if (s != yajl_gen_status_ok) goto out;
-
-        for (j = 0; j < 2; j++) {
-            if (cpuid[i].input[j] != XEN_CPUID_INPUT_UNUSED) {
-                s = libxl__yajl_gen_asciiz(hand, input_names[j]);
-                if (s != yajl_gen_status_ok) goto out;
-                s = yajl_gen_integer(hand, cpuid[i].input[j]);
-                if (s != yajl_gen_status_ok) goto out;
-            }
-        }
-
-        for (j = 0; j < 4; j++) {
-            if (cpuid[i].policy[j] != NULL) {
-                s = libxl__yajl_gen_asciiz(hand, policy_names[j]);
-                if (s != yajl_gen_status_ok) goto out;
-                s = yajl_gen_string(hand,
-                               (const unsigned char *)cpuid[i].policy[j], 32);
-                if (s != yajl_gen_status_ok) goto out;
-            }
-        }
-        s = yajl_gen_map_close(hand);
-        if (s != yajl_gen_status_ok) goto out;
-    }
-
-empty:
-    s = yajl_gen_array_close(hand);
-out:
-    return s;
-}
-
 yajl_gen_status libxl_string_list_gen_json(yajl_gen hand, libxl_string_list 
*pl)
 {
     libxl_string_list l = *pl;
diff -r d3fe4a0d942a -r c3cbe6fb3f16 tools/libxl/libxl_nocpuid.c
--- a/tools/libxl/libxl_nocpuid.c       Wed May 30 08:57:48 2012 +0100
+++ b/tools/libxl/libxl_nocpuid.c       Wed May 30 08:57:49 2012 +0100
@@ -14,7 +14,7 @@
 
 #include "libxl_internal.h"
 
-void libxl_cpuid_destroy(libxl_cpuid_policy_list *p_cpuid_list)
+void libxl_cpuid_dispose(libxl_cpuid_policy_list *p_cpuid_list)
 {
 }
 
@@ -38,6 +38,12 @@ void libxl_cpuid_set(libxl_ctx *ctx, uin
 {
 }
 
+yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
+                                libxl_cpuid_policy_list *pcpuid)
+{
+    return 0;
+}
+
 /*
  * Local variables:
  * mode: C

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.