Skip to content

Commit

Permalink
asm: move _PADDR() macro to asm-macros.h
Browse files Browse the repository at this point in the history
And rename it to PT_PADDR().

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
  • Loading branch information
wipawel committed Oct 28, 2020
1 parent c060bc7 commit d209cf9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions arch/x86/boot/pagetables.S
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@
#include <asm-macros.h>
#include <page.h>

#define _PADDR(table, shift) (((. - (table)) / PTE_SIZE) << (shift))

/* Initial identity map page tables */
SECTION(.data.init, "aw", PAGE_SIZE)
GLOBAL(l1_pt_entries)
.rept L1_PT_ENTRIES
.long _PADDR(l1_pt_entries, L1_PT_SHIFT) + L1_PROT, 0
.long PT_PADDR(l1_pt_entries, L1_PT_SHIFT) + L1_PROT, 0
.endr
END_OBJECT(l1_pt_entries)

Expand Down
2 changes: 2 additions & 0 deletions include/arch/x86/asm-macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
#define _ASM_IP _ASM_REG(ip)
#define _ASM_FLAGS _ASM_REG(flags)

#define PT_PADDR(table, shift) (((.- (table)) / PTE_SIZE) << (shift))

#ifdef __ASSEMBLY__

/* clang-format off */
Expand Down

0 comments on commit d209cf9

Please sign in to comment.