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

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

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/loongarch/kernel/efi.c (Version linux-6.12-rc7) and /arch/sparc/kernel/efi.c (Version linux-4.14.336)


  1 // SPDX-License-Identifier: GPL-2.0                 1 
  2 /*                                                
  3  * EFI initialization                             
  4  *                                                
  5  * Author: Jianmin Lv <lvjianmin@loongson.cn>     
  6  *         Huacai Chen <chenhuacai@loongson.cn    
  7  *                                                
  8  * Copyright (C) 2020-2022 Loongson Technology    
  9  */                                               
 10                                                   
 11 #include <linux/acpi.h>                           
 12 #include <linux/efi.h>                            
 13 #include <linux/efi-bgrt.h>                       
 14 #include <linux/init.h>                           
 15 #include <linux/kernel.h>                         
 16 #include <linux/export.h>                         
 17 #include <linux/io.h>                             
 18 #include <linux/kobject.h>                        
 19 #include <linux/memblock.h>                       
 20 #include <linux/reboot.h>                         
 21 #include <linux/screen_info.h>                    
 22 #include <linux/uaccess.h>                        
 23                                                   
 24 #include <asm/early_ioremap.h>                    
 25 #include <asm/efi.h>                              
 26 #include <asm/loongson.h>                         
 27                                                   
 28 static unsigned long efi_nr_tables;               
 29 static unsigned long efi_config_table;            
 30                                                   
 31 static unsigned long __initdata boot_memmap =     
 32 static unsigned long __initdata fdt_pointer =     
 33                                                   
 34 static efi_system_table_t *efi_systab;            
 35 static efi_config_table_type_t arch_tables[] _    
 36         {LINUX_EFI_BOOT_MEMMAP_GUID,    &boot_    
 37         {DEVICE_TREE_GUID,              &fdt_p    
 38         {},                                       
 39 };                                                
 40                                                   
 41 void __init *efi_fdt_pointer(void)                
 42 {                                                 
 43         if (!efi_systab)                          
 44                 return NULL;                      
 45                                                   
 46         if (fdt_pointer == EFI_INVALID_TABLE_A    
 47                 return NULL;                      
 48                                                   
 49         return early_memremap_ro(fdt_pointer,     
 50 }                                                 
 51                                                   
 52 void __init efi_runtime_init(void)                
 53 {                                                 
 54         if (!efi_enabled(EFI_BOOT) || !efi_sys    
 55                 return;                           
 56                                                   
 57         if (efi_runtime_disabled()) {             
 58                 pr_info("EFI runtime services     
 59                 return;                           
 60         }                                         
 61                                                   
 62         efi.runtime = (efi_runtime_services_t     
 63         efi.runtime_version = (unsigned int)ef    
 64                                                   
 65         efi_native_runtime_setup();               
 66         set_bit(EFI_RUNTIME_SERVICES, &efi.fla    
 67 }                                                 
 68                                                   
 69 bool efi_poweroff_required(void)                  
 70 {                                                 
 71         return efi_enabled(EFI_RUNTIME_SERVICE    
 72                 (acpi_gbl_reduced_hardware ||     
 73 }                                                 
 74                                                   
 75 unsigned long __initdata screen_info_table = E    
 76                                                   
 77 #if defined(CONFIG_SYSFB) || defined(CONFIG_EF    
 78 struct screen_info screen_info __section(".dat    
 79 EXPORT_SYMBOL_GPL(screen_info);                   
 80 #endif                                            
 81                                                   
 82 static void __init init_screen_info(void)         
 83 {                                                 
 84         struct screen_info *si;                   
 85                                                   
 86         if (screen_info_table == EFI_INVALID_T    
 87                 return;                           
 88                                                   
 89         si = early_memremap(screen_info_table,    
 90         if (!si) {                                
 91                 pr_err("Could not map screen_i    
 92                 return;                           
 93         }                                         
 94         screen_info = *si;                        
 95         memset(si, 0, sizeof(*si));               
 96         early_memunmap(si, sizeof(*si));          
 97                                                   
 98         memblock_reserve(screen_info.lfb_base,    
 99 }                                                 
100                                                   
101 void __init efi_init(void)                        
102 {                                                 
103         int size;                                 
104         void *config_tables;                      
105         struct efi_boot_memmap *tbl;              
106                                                   
107         if (!efi_system_table)                    
108                 return;                           
109                                                   
110         efi_systab = (efi_system_table_t *)ear    
111         if (!efi_systab) {                        
112                 pr_err("Can't find EFI system     
113                 return;                           
114         }                                         
115                                                   
116         efi_systab_report_header(&efi_systab->    
117                                                   
118         set_bit(EFI_64BIT, &efi.flags);           
119         efi_nr_tables    = efi_systab->nr_tabl    
120         efi_config_table = (unsigned long)efi_    
121                                                   
122         size = sizeof(efi_config_table_t);        
123         config_tables = early_memremap(efi_con    
124         efi_config_parse_tables(config_tables,    
125         early_memunmap(config_tables, efi_nr_t    
126                                                   
127         set_bit(EFI_CONFIG_TABLES, &efi.flags)    
128                                                   
129         if (IS_ENABLED(CONFIG_EFI_EARLYCON) ||    
130                 init_screen_info();               
131                                                   
132         if (boot_memmap == EFI_INVALID_TABLE_A    
133                 return;                           
134                                                   
135         tbl = early_memremap_ro(boot_memmap, s    
136         if (tbl) {                                
137                 struct efi_memory_map_data dat    
138                                                   
139                 data.phys_map           = boot    
140                 data.size               = tbl-    
141                 data.desc_size          = tbl-    
142                 data.desc_version       = tbl-    
143                                                   
144                 if (efi_memmap_init_early(&dat    
145                         panic("Unable to map E    
146                                                   
147                 early_memunmap(tbl, sizeof(*tb    
148         }                                         
149                                                   
150         efi_esrt_init();                          
151 }                                                 
152                                                   

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php