vaseboot/include/VasEBoot/efi/memory.h

39 lines
1.6 KiB
C

/*
* VAS_EBOOT -- GRand Unified Bootloader
* Copyright (C) 2009 Free Software Foundation, Inc.
*
* VAS_EBOOT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VAS_EBOOT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with VAS_EBOOT. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VAS_EBOOT_MEMORY_MACHINE_HEADER
#define VAS_EBOOT_MEMORY_MACHINE_HEADER 1
#include <VasEBoot/err.h>
#include <VasEBoot/types.h>
/* The term "page" in UEFI refers only to a 4 KiB-aligned 4 KiB size region of
memory. It is not concerned with underlying translation management concepts,
but only used as the granule for memory allocations. */
#define VAS_EBOOT_EFI_PAGE_SHIFT 12
#define VAS_EBOOT_EFI_PAGE_SIZE (1 << VAS_EBOOT_EFI_PAGE_SHIFT)
#define VAS_EBOOT_EFI_BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> VAS_EBOOT_EFI_PAGE_SHIFT)
#define VAS_EBOOT_MMAP_REGISTER_BY_FIRMWARE 1
VasEBoot_err_t VasEBoot_machine_mmap_register (VasEBoot_uint64_t start, VasEBoot_uint64_t size,
int type, int handle);
VasEBoot_err_t VasEBoot_machine_mmap_unregister (int handle);
#endif /* ! VAS_EBOOT_MEMORY_MACHINE_HEADER */