From: "Jan Beulich" Subject: [PATCH 3/3] EFI: constify a few table pointers Date: Thu, 23 Oct 2014 14:45:49 +0100 Message-ID: <544922AD0200007800041775@mail.emea.novell.com> References: <54492111020000780004175B@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartEEDBFE9D.0__=" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XhIi9-0007vm-EI for xen-devel@lists.xenproject.org; Thu, 23 Oct 2014 13:45:53 +0000 In-Reply-To: <54492111020000780004175B@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: xen-devel List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartEEDBFE9D.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline We shouldn't (and don't) modify any of these tables. Signed-off-by: Jan Beulich --- 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); =20 -static EFI_BOOT_SERVICES *__initdata efi_bs; +static const EFI_BOOT_SERVICES *__initdata efi_bs; static EFI_HANDLE __initdata efi_ih; =20 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 { }; =20 extern unsigned int efi_num_ct; -extern EFI_CONFIGURATION_TABLE *efi_ct; +extern const EFI_CONFIGURATION_TABLE *efi_ct; =20 extern unsigned int efi_version, efi_fw_revision; extern const CHAR16 *efi_fw_vendor; =20 -extern EFI_RUNTIME_SERVICES *efi_rs; +extern const EFI_RUNTIME_SERVICES *efi_rs; =20 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 =3D 1; #endif =20 unsigned int __read_mostly efi_num_ct; -EFI_CONFIGURATION_TABLE *__read_mostly efi_ct; +const EFI_CONFIGURATION_TABLE *__read_mostly efi_ct; =20 unsigned int __read_mostly efi_version; unsigned int __read_mostly efi_fw_revision; const CHAR16 *__read_mostly efi_fw_vendor; =20 -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 --=__PartEEDBFE9D.0__= Content-Type: text/plain; name="EFI-constify.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="EFI-constify.patch" EFI: constify a few table pointers=0A=0AWe shouldn't (and don't) modify = any of these tables.=0A=0ASigned-off-by: Jan Beulich =0A= =0A--- a/xen/common/efi/boot.c=0A+++ b/xen/common/efi/boot.c=0A@@ -75,7 = +75,7 @@ static size_t wstrlen(const CHAR16 * s);=0A static int set_color(u= 32 mask, int bpp, u8 *pos, u8 *sz);=0A static bool_t match_guid(const = EFI_GUID *guid1, const EFI_GUID *guid2);=0A =0A-static EFI_BOOT_SERVICES = *__initdata efi_bs;=0A+static const EFI_BOOT_SERVICES *__initdata = efi_bs;=0A static EFI_HANDLE __initdata efi_ih;=0A =0A static SIMPLE_TEXT_O= UTPUT_INTERFACE *__initdata StdOut;=0A--- a/xen/common/efi/efi.h=0A+++ = b/xen/common/efi/efi.h=0A@@ -18,12 +18,12 @@ struct efi_pci_rom {=0A };=0A = =0A extern unsigned int efi_num_ct;=0A-extern EFI_CONFIGURATION_TABLE = *efi_ct;=0A+extern const EFI_CONFIGURATION_TABLE *efi_ct;=0A =0A extern = unsigned int efi_version, efi_fw_revision;=0A extern const CHAR16 = *efi_fw_vendor;=0A =0A-extern EFI_RUNTIME_SERVICES *efi_rs;=0A+extern = const EFI_RUNTIME_SERVICES *efi_rs;=0A =0A extern UINTN efi_memmap_size, = efi_mdesc_size;=0A extern void *efi_memmap;=0A--- a/xen/common/efi/runtime.= c=0A+++ b/xen/common/efi/runtime.c=0A@@ -21,13 +21,13 @@ const bool_t = efi_enabled =3D 1;=0A #endif=0A =0A unsigned int __read_mostly efi_num_ct;= =0A-EFI_CONFIGURATION_TABLE *__read_mostly efi_ct;=0A+const EFI_CONFIGURATI= ON_TABLE *__read_mostly efi_ct;=0A =0A unsigned int __read_mostly = efi_version;=0A unsigned int __read_mostly efi_fw_revision;=0A const = CHAR16 *__read_mostly efi_fw_vendor;=0A =0A-EFI_RUNTIME_SERVICES *__read_mo= stly efi_rs;=0A+const EFI_RUNTIME_SERVICES *__read_mostly efi_rs;=0A = #ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */=0A = static DEFINE_SPINLOCK(efi_rs_lock);=0A #endif=0A --=__PartEEDBFE9D.0__= 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 --=__PartEEDBFE9D.0__=--