1 /* 2 * Copyright (C) 2025 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 * 16 */ 17 18 #ifndef __LIB_UEFI_MEMORY_PROTOCOLS_H 19 #define __LIB_UEFI_MEMORY_PROTOCOLS_H 20 21 #include <kernel/vm.h> 22 #include <stddef.h> 23 #include <uefi/boot_service.h> 24 #include <uefi/types.h> 25 26 vmm_aspace_t *set_boot_aspace(); 27 void setup_heap(); 28 void reset_heap(); 29 30 EfiStatus allocate_pages(EfiAllocatorType type, EfiMemoryType memory_type, 31 size_t pages, EfiPhysicalAddr *memory); 32 33 // Declaration moved to uefi_platform.h to keep all weak functions declared in 34 // one place. 35 // void *uefi_malloc(size_t size); 36 // EfiStatus allocate_pool(EfiMemoryType pool_type, size_t size, void **buf); 37 // EfiStatus free_pool(void *mem); 38 // EfiStatus free_pages(void *memory, size_t pages); 39 40 EfiStatus get_physical_memory_map(size_t *memory_map_size, 41 EfiMemoryDescriptor *memory_map, 42 size_t *map_key, size_t *desc_size, 43 uint32_t *desc_version); 44 45 #endif 46