WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel][PATCH] xen/xsm: Compile error due to naming clash between XS

To: Jan Beulich <JBeulich@xxxxxxxxxx>
Subject: [Xen-devel][PATCH] xen/xsm: Compile error due to naming clash between XSM and EFI runtime
From: James Carter <jwcart2@xxxxxxxxxxxxx>
Date: Wed, 14 Sep 2011 11:15:09 -0400
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 14 Sep 2011 08:17:04 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: National Security Agency
Reply-to: jwcart2@xxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
While compiling XEN with XSM_ENABLE=y and FLASK_ENABLE=y, I received the 
following error.

gcc -O1 -fno-omit-frame-pointer -m64 -g -fno-strict-aliasing -std=gnu99 -Wall 
-Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement 
-Wno-unused-but-set-variable  -fno-builtin -fno-common -Wredundant-decls 
-iwithprefix include -Werror -Wno-pointer-arith -pipe 
-I/home/jwcart2/src/xen/my-xen-unstable/xen/include  
-I/home/jwcart2/src/xen/my-xen-unstable/xen/include/asm-x86/mach-generic 
-I/home/jwcart2/src/xen/my-xen-unstable/xen/include/asm-x86/mach-default 
-msoft-float -fno-stack-protector -fno-exceptions -Wnested-externs 
-mno-red-zone -fpic -fno-asynchronous-unwind-tables 
-DGCC_HAS_VISIBILITY_ATTRIBUTE -fno-optimize-sibling-calls -nostdinc -g 
-D__XEN__ -DXSM_ENABLE -DFLASK_ENABLE -DXSM_MAGIC=0xf97cff8c -DFLASK_DEVELOP 
-DFLASK_BOOTPARAM -DFLASK_AVC_STATS -DVERBOSE -fno-omit-frame-pointer 
-DCONFIG_FRAME_POINTER -MMD -MF .platform_hypercall.o.d -c platform_hypercall.c 
-o platform_hypercall.o
In file included from ../platform_hypercall.c:33:0,
                 from platform_hypercall.c:38:
/home/jwcart2/src/xen/my-xen-unstable/xen/include/xsm/xsm.h: In function 
‘xsm_efi_runtime_call’:
/home/jwcart2/src/xen/my-xen-unstable/xen/include/xsm/xsm.h:559:19: error: 
‘struct xsm_operations’ has no member named ‘efi_compat_runtime_call’
cc1: warnings being treated as errors
/home/jwcart2/src/xen/my-xen-unstable/xen/include/xsm/xsm.h:560:1: error: 
control reaches end of non-void function
make[5]: *** [platform_hypercall.o] Error 1
make[5]: Leaving directory 
`/home/jwcart2/src/xen/my-xen-unstable/xen/arch/x86/x86_64'
make[4]: *** [x86_64/built_in.o] Error 2


The problem is that efi_runtime_call is the name of both a function in
xen/arch/x86/efi/runtime.c and a member of the xsm_operations struct in
xen/include/xsm/xsm.h. This causes the macro "#define
efi_runtime_call(x) efi_compat_runtime_call(x)" on line 15 of
xen/arch/x86/x86_64/platform_hypercall.c to cause the above compile
error. (At least, that is what I think is happening.)

Renaming the XSM struct member fixes the problem.

Signed-off-by: James Carter <jwcart2@xxxxxxxxxxxxx>

---

 arch/x86/platform_hypercall.c |    2 +-
 include/xsm/xsm.h             |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff -r 0312575dc35e xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c Thu Sep 08 15:13:06 2011 +0100
+++ b/xen/arch/x86/platform_hypercall.c Wed Sep 14 09:48:25 2011 -0400
@@ -306,7 +306,7 @@
         break;
 
     case XENPF_efi_runtime_call:
-        ret = xsm_efi_runtime_call();
+        ret = xsm_efi_call();
         if ( ret )
             break;
 
diff -r 0312575dc35e xen/include/xsm/xsm.h
--- a/xen/include/xsm/xsm.h     Thu Sep 08 15:13:06 2011 +0100
+++ b/xen/include/xsm/xsm.h     Wed Sep 14 09:48:25 2011 -0400
@@ -132,7 +132,7 @@
     int (*physinfo) (void);
     int (*platform_quirk) (uint32_t);
     int (*firmware_info) (void);
-    int (*efi_runtime_call) (void);
+    int (*efi_call) (void);
     int (*acpi_sleep) (void);
     int (*change_freq) (void);
     int (*getidletime) (void);
@@ -554,9 +554,9 @@
     return xsm_call(firmware_info());
 }
 
-static inline int xsm_efi_runtime_call (void)
+static inline int xsm_efi_call (void)
 {
-    return xsm_call(efi_runtime_call());
+    return xsm_call(efi_call());
 }
 
 static inline int xsm_acpi_sleep (void)


-- 
James Carter <jwcart2@xxxxxxxxxxxxx>
National Security Agency


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>