~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm64/kernel/efi.c

Version: ~ [ linux-5.18-rc6 ] ~ [ linux-5.17.6 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.38 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.114 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.192 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.241 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.277 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.312 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.302 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Extensible Firmware Interface
  3  *
  4  * Based on Extensible Firmware Interface Specification version 2.4
  5  *
  6  * Copyright (C) 2013, 2014 Linaro Ltd.
  7  *
  8  * This program is free software; you can redistribute it and/or modify
  9  * it under the terms of the GNU General Public License version 2 as
 10  * published by the Free Software Foundation.
 11  *
 12  */
 13 
 14 #include <linux/dmi.h>
 15 #include <linux/efi.h>
 16 #include <linux/init.h>
 17 
 18 #include <asm/efi.h>
 19 
 20 int __init efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md)
 21 {
 22         pteval_t prot_val;
 23 
 24         /*
 25          * Only regions of type EFI_RUNTIME_SERVICES_CODE need to be
 26          * executable, everything else can be mapped with the XN bits
 27          * set.
 28          */
 29         if ((md->attribute & EFI_MEMORY_WB) == 0)
 30                 prot_val = PROT_DEVICE_nGnRE;
 31         else if (md->type == EFI_RUNTIME_SERVICES_CODE ||
 32                  !PAGE_ALIGNED(md->phys_addr))
 33                 prot_val = pgprot_val(PAGE_KERNEL_EXEC);
 34         else
 35                 prot_val = pgprot_val(PAGE_KERNEL);
 36 
 37         create_pgd_mapping(mm, md->phys_addr, md->virt_addr,
 38                            md->num_pages << EFI_PAGE_SHIFT,
 39                            __pgprot(prot_val | PTE_NG));
 40         return 0;
 41 }
 42 
 43 static int __init arm64_dmi_init(void)
 44 {
 45         /*
 46          * On arm64, DMI depends on UEFI, and dmi_scan_machine() needs to
 47          * be called early because dmi_id_init(), which is an arch_initcall
 48          * itself, depends on dmi_scan_machine() having been called already.
 49          */
 50         dmi_scan_machine();
 51         if (dmi_available)
 52                 dmi_set_dump_stack_arch_desc();
 53         return 0;
 54 }
 55 core_initcall(arm64_dmi_init);
 56 
 57 /*
 58  * UpdateCapsule() depends on the system being shutdown via
 59  * ResetSystem().
 60  */
 61 bool efi_poweroff_required(void)
 62 {
 63         return efi_enabled(EFI_RUNTIME_SERVICES);
 64 }
 65 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp