1/* 2 * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 * 4 * SPDX-License-Identifier: GPL-2.0-only 5 */ 6 7#include <elfloader.h> 8#include <types.h> 9#include <mode/structures.h> 10 11/* Page directory for Stage1 translation in PL1 (short-desc format)*/ 12uint32_t _boot_pd[BIT(PD_BITS)] ALIGN(BIT(PD_SIZE_BITS)); 13uint32_t _boot_pt[BIT(PT_BITS)] ALIGN(BIT(PT_SIZE_BITS)); 14 15/* Page global and middle directory for Stage1 in HYP mode (long-desc format) */ 16uint64_t _lpae_boot_pgd[BIT(HYP_PGD_BITS)] ALIGN(BIT(HYP_PGD_SIZE_BITS)); 17uint64_t _lpae_boot_pmd[BIT(HYP_PGD_BITS + HYP_PMD_BITS)] ALIGN(BIT(HYP_PMD_SIZE_BITS)); 18 19/* 20 * These are helper functions which let the ASM work when we're relocated, 21 * and save the ASM from manually having to figure out offsets to access these. 22 */ 23void *get_boot_pd(void) 24{ 25 return _boot_pd; 26} 27 28void *get_lpae_boot_pgd(void) 29{ 30 return _lpae_boot_pgd; 31} 32