All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen: Minor modifications to platform.h to make it C++-friendly
@ 2015-02-23  9:34 Razvan Cojocaru
  2015-02-23 10:16 ` Jan Beulich
  0 siblings, 1 reply; 9+ messages in thread
From: Razvan Cojocaru @ 2015-02-23  9:34 UTC (permalink / raw)
  To: xen-devel; +Cc: keir, ian.campbell, Razvan Cojocaru, tim, ian.jackson, jbeulich

Moved the definition of struct xenpf_efi_guid up, and rearranged
struct xenpf_efi_time in the containing union to avoid compilation
errors with C++ (structs defined inside unnamed structs become
unavailable outside their scope with C++). The change allows C++
applications to use platform.h with no consequences for current
C clients.

Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
---
 xen/include/public/platform.h |   40 +++++++++++++++++++++-------------------
 1 file changed, 21 insertions(+), 19 deletions(-)

diff --git a/xen/include/public/platform.h b/xen/include/public/platform.h
index e4cf65f..2eca375 100644
--- a/xen/include/public/platform.h
+++ b/xen/include/public/platform.h
@@ -141,6 +141,13 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_platform_quirk_t);
 #define XEN_EFI_query_variable_info           9
 #define XEN_EFI_query_capsule_capabilities   10
 #define XEN_EFI_update_capsule               11
+struct xenpf_efi_guid {
+    uint32_t data1;
+    uint16_t data2;
+    uint16_t data3;
+    uint8_t data4[8];
+};
+
 struct xenpf_efi_runtime_call {
     uint32_t function;
     /*
@@ -152,24 +159,24 @@ struct xenpf_efi_runtime_call {
     xen_ulong_t status;
     union {
 #define XEN_EFI_GET_TIME_SET_CLEARS_NS 0x00000001
+        struct xenpf_efi_time {
+            uint16_t year;
+            uint8_t month;
+            uint8_t day;
+            uint8_t hour;
+            uint8_t min;
+            uint8_t sec;
+            uint32_t ns;
+            int16_t tz;
+            uint8_t daylight;
+        } set_time;
+
         struct {
-            struct xenpf_efi_time {
-                uint16_t year;
-                uint8_t month;
-                uint8_t day;
-                uint8_t hour;
-                uint8_t min;
-                uint8_t sec;
-                uint32_t ns;
-                int16_t tz;
-                uint8_t daylight;
-            } time;
+            struct xenpf_efi_time time;
             uint32_t resolution;
             uint32_t accuracy;
         } get_time;
 
-        struct xenpf_efi_time set_time;
-
 #define XEN_EFI_GET_WAKEUP_TIME_ENABLED 0x00000001
 #define XEN_EFI_GET_WAKEUP_TIME_PENDING 0x00000002
         struct xenpf_efi_time get_wakeup_time;
@@ -185,12 +192,7 @@ struct xenpf_efi_runtime_call {
             XEN_GUEST_HANDLE(void) name;  /* UCS-2/UTF-16 string */
             xen_ulong_t size;
             XEN_GUEST_HANDLE(void) data;
-            struct xenpf_efi_guid {
-                uint32_t data1;
-                uint16_t data2;
-                uint16_t data3;
-                uint8_t data4[8];
-            } vendor_guid;
+            struct xenpf_efi_guid vendor_guid;
         } get_variable, set_variable;
 
         struct {
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-02-23 11:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-23  9:34 [PATCH] xen: Minor modifications to platform.h to make it C++-friendly Razvan Cojocaru
2015-02-23 10:16 ` Jan Beulich
2015-02-23 10:31   ` Razvan Cojocaru
2015-02-23 10:54     ` Jan Beulich
2015-02-23 11:05       ` Razvan Cojocaru
2015-02-23 11:16         ` Jan Beulich
2015-02-23 11:09       ` Tim Deegan
2015-02-23 11:24         ` Jan Beulich
2015-02-23 11:24       ` Razvan Cojocaru

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.