Skip to content

Commit

Permalink
remove PADDR_BASE
Browse files Browse the repository at this point in the history
  • Loading branch information
axel-h committed Jul 12, 2024
1 parent 81cb0e6 commit 703c08a
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion include/arch/arm/arch/32/mode/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#endif

/* The physical memory address to use for mapping the kernel ELF */
#define KERNEL_ELF_PADDR_BASE PADDR_BASE
#define KERNEL_ELF_PADDR_BASE physBase()
/* For use by the linker (only integer constants allowed) */
#define KERNEL_ELF_PADDR_BASE_RAW PHYS_BASE_RAW

Expand Down
4 changes: 2 additions & 2 deletions include/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* - USER_TOP: The first address after the end of user memory
*
* - PADDR_BASE: The first physical address mapped in the kernel's
* - physBase(): The first physical address mapped in the kernel's
* physical memory window.
* - PPTR_BASE: The first virtual address of the kernel's physical
* memory window.
Expand All @@ -30,7 +30,7 @@

/* The offset from a physical address to a virtual address in the
* physical memory window. */
#define PPTR_BASE_OFFSET (PPTR_BASE - PADDR_BASE)
#define PPTR_BASE_OFFSET (PPTR_BASE - physBase())

/* The last address in the physical memory region mapped into the
* physical memory window */
Expand Down
4 changes: 2 additions & 2 deletions src/arch/arm/64/kernel/vspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ BOOT_CODE void map_kernel_window(void)

/* map the kernel window using large pages */
vaddr = PPTR_BASE;
for (paddr = PADDR_BASE; paddr < PADDR_TOP; paddr += BIT(seL4_LargePageBits)) {
for (paddr = physBase(); paddr < PADDR_TOP; paddr += BIT(seL4_LargePageBits)) {
armKSGlobalKernelPDs[GET_KPT_INDEX(vaddr, KLVL_FRM_ARM_PT_LVL(1))][GET_KPT_INDEX(vaddr,
KLVL_FRM_ARM_PT_LVL(2))] = pte_pte_page_new(
#ifdef CONFIG_ARM_HYPERVISOR_SUPPORT
Expand Down Expand Up @@ -1658,7 +1658,7 @@ static exception_t decodeARMFrameInvocation(word_t invLabel, word_t length,
word_t pstart = pptr_to_paddr((void *)cap_frame_cap_get_capFBasePtr(cap)) + start;
#ifdef CONFIG_ARM_HYPERVISOR_SUPPORT
/* Don't let applications flush outside of the kernel window */
if (pstart < PADDR_BASE || ((end - start) + pstart) > PADDR_TOP) {
if (pstart < physBase() || ((end - start) + pstart) > PADDR_TOP) {
userError("Page Flush: Overlaps kernel region.");
current_syscall_error.type = seL4_IllegalOperation;
return EXCEPTION_SYSCALL_ERROR;
Expand Down
4 changes: 2 additions & 2 deletions src/arch/riscv/kernel/vspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ BOOT_CODE VISIBLE void map_kernel_window(void)
/* kernel window starts at PPTR_BASE */
word_t pptr = PPTR_BASE;

/* first we map in memory from PADDR_BASE */
word_t paddr = PADDR_BASE;
/* first we map in memory from physBase() */
word_t paddr = physBase();
while (pptr < PPTR_TOP) {
assert(IS_ALIGNED(pptr, RISCV_GET_LVL_PGSIZE_BITS(0)));
assert(IS_ALIGNED(paddr, RISCV_GET_LVL_PGSIZE_BITS(0)));
Expand Down
2 changes: 1 addition & 1 deletion src/arch/x86/32/kernel/vspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ BOOT_CODE bool_t map_kernel_window(
/* Mapping of PPTR_BASE (virtual address) to kernel's PADDR_BASE
* up to end of virtual address space except for the last large page.
*/
phys = PADDR_BASE;
phys = physBase();
idx = PPTR_BASE >> LARGE_PAGE_BITS;

/* PPTR_TOP differs whether CONFIG_KERNEL_LOG_BUFFER
Expand Down
2 changes: 1 addition & 1 deletion src/arch/x86/32/kernel/vspace_32paging.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ PHYS_CODE VISIBLE void init_boot_pd(void)
/* mapping of PPTR_BASE (virtual address) to PADDR_BASE up to end of virtual address space */
for (i = 0; i < ((-PPTR_BASE) >> seL4_LargePageBits); i++) {
*(_boot_pd + i + (PPTR_BASE >> seL4_LargePageBits)) = pde_pde_large_new_phys(
(i << seL4_LargePageBits) + PADDR_BASE, /* physical address */
(i << seL4_LargePageBits) + physBase(), /* physical address */
0, /* pat */
0, /* avl */
1, /* global */
Expand Down
2 changes: 1 addition & 1 deletion src/arch/x86/64/kernel/vspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ BOOT_CODE bool_t map_kernel_window(
/* put the 1GB kernel_base mapping into the PDPT */
x64KSKernelPDPT[GET_PDPT_INDEX(KERNEL_ELF_BASE)] = pdpte_pdpte_1g_new(
0, /* xd */
PADDR_BASE,
physBase(),
0, /* PAT */
KERNEL_IS_GLOBAL(), /* global */
0, /* dirty */
Expand Down
7 changes: 0 additions & 7 deletions tools/hardware/outputs/c_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@
return PHYS_BASE_RAW;
}
/*
* PADDR_BASE is the first physical address to map into the kernel's physical
* memory window.
*/
#define PADDR_BASE physBase()
/* INTERRUPTS */
{% for irq in kernel_irqs %}
/* {{ irq.desc }} */
Expand Down

0 comments on commit 703c08a

Please sign in to comment.