summaryrefslogtreecommitdiff
path: root/src/include/cpu/x86
diff options
context:
space:
mode:
authorKrystian Hebel <krystian.hebel@3mdeb.com>2024-05-08 16:17:00 +0200
committerFelix Held <felix-coreboot@felixheld.de>2024-05-29 13:04:30 +0000
commitfda9d75d90dfb8b5a441eea9d108e6f075087dc0 (patch)
tree38ac106080fbdaa5d03896235e2b2dc00074de42 /src/include/cpu/x86
parentb1bd442ca95bd05c40b6cd990f196514d091860f (diff)
cpu/x86/pae/pgtbl.c: extract reusable code from memset_pae()
Code dealing with PAE can be used outside of memset_pae(). This change extracts creation of identity mapped pagetables to init_pae_pagetables() and mapping of single 2 MiB map to pae_map_2M_page(). Both functions are exported in include/cpu/x86/pae.h to allow use outside of pgtbl.c. MEMSET_PAE_* macros were renamed to PAE_* since they no longer apply only to memset_pae(). Change-Id: I8aa80eb246ff0e77e1f51d71933d3d00ab75aaeb Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/82249 Reviewed-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/include/cpu/x86')
-rw-r--r--src/include/cpu/x86/pae.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/include/cpu/x86/pae.h b/src/include/cpu/x86/pae.h
index d1cf7347c2..e4b0a2c4c9 100644
--- a/src/include/cpu/x86/pae.h
+++ b/src/include/cpu/x86/pae.h
@@ -35,11 +35,15 @@ void paging_set_default_pat(void);
* failure. */
int paging_enable_for_car(const char *pdpt_name, const char *pt_name);
-/* To be used with memset_pae */
-#define MEMSET_PAE_VMEM_ALIGN (2 * MiB)
-#define MEMSET_PAE_VMEM_SIZE (2 * MiB)
-#define MEMSET_PAE_PGTL_ALIGN (4 * KiB)
-#define MEMSET_PAE_PGTL_SIZE (20 * KiB)
+/* To be used with memset_pae and pae_map_2M_page */
+#define PAE_VMEM_ALIGN (2 * MiB)
+#define PAE_VMEM_SIZE (2 * MiB)
+#define PAE_PGTL_ALIGN (4 * KiB)
+#define PAE_PGTL_SIZE (20 * KiB)
+
+int init_pae_pagetables(void *pgtbl);
+
+void pae_map_2M_page(void *pgtbl, uint64_t paddr, void *vmem_addr);
int memset_pae(uint64_t dest, unsigned char pat, uint64_t length, void *pgtbl,
void *vmem_addr);