From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 3/3] EFI: constify a few table pointers Date: Thu, 23 Oct 2014 15:48:28 +0100 Message-ID: <5449153C.4090303@citrix.com> References: <54492111020000780004175B@mail.emea.novell.com> <544922AD0200007800041775@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7187204856546530681==" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XhJo3-0001Gs-NS for xen-devel@lists.xenproject.org; Thu, 23 Oct 2014 14:56:03 +0000 In-Reply-To: <544922AD0200007800041775@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , xen-devel List-Id: xen-devel@lists.xenproject.org --===============7187204856546530681== Content-Type: multipart/alternative; boundary="------------060405060201090304090806" --------------060405060201090304090806 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit On 23/10/14 14:45, Jan Beulich wrote: > We shouldn't (and don't) modify any of these tables. > > Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper > > --- a/xen/common/efi/boot.c > +++ b/xen/common/efi/boot.c > @@ -75,7 +75,7 @@ static size_t wstrlen(const CHAR16 * s); > static int set_color(u32 mask, int bpp, u8 *pos, u8 *sz); > static bool_t match_guid(const EFI_GUID *guid1, const EFI_GUID *guid2); > > -static EFI_BOOT_SERVICES *__initdata efi_bs; > +static const EFI_BOOT_SERVICES *__initdata efi_bs; > static EFI_HANDLE __initdata efi_ih; > > static SIMPLE_TEXT_OUTPUT_INTERFACE *__initdata StdOut; > --- a/xen/common/efi/efi.h > +++ b/xen/common/efi/efi.h > @@ -18,12 +18,12 @@ struct efi_pci_rom { > }; > > extern unsigned int efi_num_ct; > -extern EFI_CONFIGURATION_TABLE *efi_ct; > +extern const EFI_CONFIGURATION_TABLE *efi_ct; > > extern unsigned int efi_version, efi_fw_revision; > extern const CHAR16 *efi_fw_vendor; > > -extern EFI_RUNTIME_SERVICES *efi_rs; > +extern const EFI_RUNTIME_SERVICES *efi_rs; > > extern UINTN efi_memmap_size, efi_mdesc_size; > extern void *efi_memmap; > --- a/xen/common/efi/runtime.c > +++ b/xen/common/efi/runtime.c > @@ -21,13 +21,13 @@ const bool_t efi_enabled = 1; > #endif > > unsigned int __read_mostly efi_num_ct; > -EFI_CONFIGURATION_TABLE *__read_mostly efi_ct; > +const EFI_CONFIGURATION_TABLE *__read_mostly efi_ct; > > unsigned int __read_mostly efi_version; > unsigned int __read_mostly efi_fw_revision; > const CHAR16 *__read_mostly efi_fw_vendor; > > -EFI_RUNTIME_SERVICES *__read_mostly efi_rs; > +const EFI_RUNTIME_SERVICES *__read_mostly efi_rs; > #ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */ > static DEFINE_SPINLOCK(efi_rs_lock); > #endif > > > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel --------------060405060201090304090806 Content-Type: text/html; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit
On 23/10/14 14:45, Jan Beulich wrote:
We shouldn't (and don't) modify any of these tables.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>


--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -75,7 +75,7 @@ static size_t wstrlen(const CHAR16 * s);
 static int set_color(u32 mask, int bpp, u8 *pos, u8 *sz);
 static bool_t match_guid(const EFI_GUID *guid1, const EFI_GUID *guid2);
 
-static EFI_BOOT_SERVICES *__initdata efi_bs;
+static const EFI_BOOT_SERVICES *__initdata efi_bs;
 static EFI_HANDLE __initdata efi_ih;
 
 static SIMPLE_TEXT_OUTPUT_INTERFACE *__initdata StdOut;
--- a/xen/common/efi/efi.h
+++ b/xen/common/efi/efi.h
@@ -18,12 +18,12 @@ struct efi_pci_rom {
 };
 
 extern unsigned int efi_num_ct;
-extern EFI_CONFIGURATION_TABLE *efi_ct;
+extern const EFI_CONFIGURATION_TABLE *efi_ct;
 
 extern unsigned int efi_version, efi_fw_revision;
 extern const CHAR16 *efi_fw_vendor;
 
-extern EFI_RUNTIME_SERVICES *efi_rs;
+extern const EFI_RUNTIME_SERVICES *efi_rs;
 
 extern UINTN efi_memmap_size, efi_mdesc_size;
 extern void *efi_memmap;
--- a/xen/common/efi/runtime.c
+++ b/xen/common/efi/runtime.c
@@ -21,13 +21,13 @@ const bool_t efi_enabled = 1;
 #endif
 
 unsigned int __read_mostly efi_num_ct;
-EFI_CONFIGURATION_TABLE *__read_mostly efi_ct;
+const EFI_CONFIGURATION_TABLE *__read_mostly efi_ct;
 
 unsigned int __read_mostly efi_version;
 unsigned int __read_mostly efi_fw_revision;
 const CHAR16 *__read_mostly efi_fw_vendor;
 
-EFI_RUNTIME_SERVICES *__read_mostly efi_rs;
+const EFI_RUNTIME_SERVICES *__read_mostly efi_rs;
 #ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
 static DEFINE_SPINLOCK(efi_rs_lock);
 #endif





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

--------------060405060201090304090806-- --===============7187204856546530681== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============7187204856546530681==--