quirks.c (1cbc99dfe5d7d686fd022647f4e489b5eb8e9068) | quirks.c (78ce248faa3c46e24e9bd42db3ab3650659f16dd) |
---|---|
1#define pr_fmt(fmt) "efi: " fmt 2 3#include <linux/init.h> 4#include <linux/kernel.h> 5#include <linux/string.h> 6#include <linux/time.h> 7#include <linux/types.h> 8#include <linux/efi.h> --- 181 unchanged lines hidden (view full) --- 190 * called. Ignoring this recommendation a significant bunch of EFI implementations 191 * continue calling into boot services code (SetVirtualAddressMap). In order to 192 * work around such buggy implementations we reserve boot services region during 193 * EFI init and make sure it stays executable. Then, after SetVirtualAddressMap(), it 194* is discarded. 195*/ 196void __init efi_reserve_boot_services(void) 197{ | 1#define pr_fmt(fmt) "efi: " fmt 2 3#include <linux/init.h> 4#include <linux/kernel.h> 5#include <linux/string.h> 6#include <linux/time.h> 7#include <linux/types.h> 8#include <linux/efi.h> --- 181 unchanged lines hidden (view full) --- 190 * called. Ignoring this recommendation a significant bunch of EFI implementations 191 * continue calling into boot services code (SetVirtualAddressMap). In order to 192 * work around such buggy implementations we reserve boot services region during 193 * EFI init and make sure it stays executable. Then, after SetVirtualAddressMap(), it 194* is discarded. 195*/ 196void __init efi_reserve_boot_services(void) 197{ |
198 void *p; | 198 efi_memory_desc_t *md; |
199 | 199 |
200 for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { 201 efi_memory_desc_t *md = p; | 200 for_each_efi_memory_desc(md) { |
202 u64 start = md->phys_addr; 203 u64 size = md->num_pages << EFI_PAGE_SHIFT; 204 bool already_reserved; 205 206 if (md->type != EFI_BOOT_SERVICES_CODE && 207 md->type != EFI_BOOT_SERVICES_DATA) 208 continue; 209 --- 35 unchanged lines hidden (view full) --- 245 * free_bootmem_late(). 246 */ 247 md->attribute |= EFI_MEMORY_RUNTIME; 248 } 249} 250 251void __init efi_free_boot_services(void) 252{ | 201 u64 start = md->phys_addr; 202 u64 size = md->num_pages << EFI_PAGE_SHIFT; 203 bool already_reserved; 204 205 if (md->type != EFI_BOOT_SERVICES_CODE && 206 md->type != EFI_BOOT_SERVICES_DATA) 207 continue; 208 --- 35 unchanged lines hidden (view full) --- 244 * free_bootmem_late(). 245 */ 246 md->attribute |= EFI_MEMORY_RUNTIME; 247 } 248} 249 250void __init efi_free_boot_services(void) 251{ |
253 void *p; | 252 efi_memory_desc_t *md; |
254 | 253 |
255 for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { 256 efi_memory_desc_t *md = p; | 254 for_each_efi_memory_desc(md) { |
257 unsigned long long start = md->phys_addr; 258 unsigned long long size = md->num_pages << EFI_PAGE_SHIFT; 259 260 if (md->type != EFI_BOOT_SERVICES_CODE && 261 md->type != EFI_BOOT_SERVICES_DATA) 262 continue; 263 264 /* Do not free, someone else owns it: */ --- 113 unchanged lines hidden --- | 255 unsigned long long start = md->phys_addr; 256 unsigned long long size = md->num_pages << EFI_PAGE_SHIFT; 257 258 if (md->type != EFI_BOOT_SERVICES_CODE && 259 md->type != EFI_BOOT_SERVICES_DATA) 260 continue; 261 262 /* Do not free, someone else owns it: */ --- 113 unchanged lines hidden --- |