[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/24] i386/memory: Define GRUB_PAGE_MASK constant and GRUB_PAGE_
From: |
Sergii Dmytruk |
Subject: |
[PATCH 06/24] i386/memory: Define GRUB_PAGE_MASK constant and GRUB_PAGE_{UP, DOWN} macros |
Date: |
Mon, 26 Aug 2024 15:44:16 +0300 |
From: Krystian Hebel <krystian.hebel@3mdeb.com>
Subsequent patches will use those macros and constant.
Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
---
include/grub/i386/memory.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/grub/i386/memory.h b/include/grub/i386/memory.h
index c64529630..56f64855b 100644
--- a/include/grub/i386/memory.h
+++ b/include/grub/i386/memory.h
@@ -22,6 +22,7 @@
#define GRUB_PAGE_SHIFT 12
#define GRUB_PAGE_SIZE (1UL << GRUB_PAGE_SHIFT)
+#define GRUB_PAGE_MASK (~(GRUB_PAGE_SIZE - 1))
/* The flag for protected mode. */
#define GRUB_MEMORY_CPU_CR0_PE_ON 0x1
@@ -43,8 +44,12 @@
#define GRUB_MMAP_MALLOC_LOW 1
+#include <grub/misc.h>
#include <grub/types.h>
+#define GRUB_PAGE_UP(p) ALIGN_UP (p, GRUB_PAGE_SIZE)
+#define GRUB_PAGE_DOWN(p) ALIGN_DOWN (p, GRUB_PAGE_SIZE)
+
struct grub_e820_mmap_entry
{
grub_uint64_t addr;
--
2.46.0
- [PATCH 00/24] i386: Intel TXT and AMD SKINIT secure launcher, Sergii Dmytruk, 2024/08/26
- [PATCH 01/24] i386/msr: Merge rdmsr.h and wrmsr.h into msr.h, Sergii Dmytruk, 2024/08/26
- [PATCH 02/24] i386/msr: Rename grub_msr_read() and grub_msr_write(), Sergii Dmytruk, 2024/08/26
- [PATCH 03/24] i386/msr: Extract and improve MSR support detection code, Sergii Dmytruk, 2024/08/26
- [PATCH 05/24] i386/memory: Rename PAGE_SIZE to GRUB_PAGE_SIZE and make it global, Sergii Dmytruk, 2024/08/26
- [PATCH 06/24] i386/memory: Define GRUB_PAGE_MASK constant and GRUB_PAGE_{UP, DOWN} macros,
Sergii Dmytruk <=
- [PATCH 04/24] i386/memory: Rename PAGE_SHIFT to GRUB_PAGE_SHIFT, Sergii Dmytruk, 2024/08/26
- [PATCH 07/24] mmap: Add grub_mmap_get_lowest() and grub_mmap_get_highest(), Sergii Dmytruk, 2024/08/26
- [PATCH 08/24] i386/tpm: Rename tpm module to tpm_verifier, Sergii Dmytruk, 2024/08/26
- [PATCH 09/24] i386/tpm: Add TPM TIS and CRB driver, Sergii Dmytruk, 2024/08/26
- [PATCH 10/24] include/grub: Introduce Secure Launch Resource Table (SLRT), Sergii Dmytruk, 2024/08/26
- [PATCH 11/24] i386/slaunch: Add basic platform support for secure launch, Sergii Dmytruk, 2024/08/26
- [PATCH 12/24] i386/txt: Add Intel TXT definitions header file, Sergii Dmytruk, 2024/08/26
- [PATCH 13/24] i386/txt: Add Intel TXT core implementation, Sergii Dmytruk, 2024/08/26
- [PATCH 16/24] i386/txt: Initialize TPM 1.2 event log in TXT heap, Sergii Dmytruk, 2024/08/26
- [PATCH 20/24] multiboot2: Implement TXT slaunch support, Sergii Dmytruk, 2024/08/26