Skip to content

Commit dd43f3b

Browse files
shiqinggwenlingz
authored andcommitted
hv: replace CPU_PAGE_MASK with PAGE_MASK
replace CPU_PAGE_MASK with PAGE_MASK These two MACROs are duplicated and PAGE_MASK is a more reasonable name. Tracked-On: #861 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 0f766ca commit dd43f3b

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

hypervisor/arch/x86/cpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static inline bool get_monitor_cap(void)
9595

9696
static uint64_t get_address_mask(uint8_t limit)
9797
{
98-
return ((1UL << limit) - 1UL) & CPU_PAGE_MASK;
98+
return ((1UL << limit) - 1UL) & PAGE_MASK;
9999
}
100100

101101
static void get_cpu_capabilities(void)

hypervisor/include/arch/x86/cpu.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@
3838
#ifndef CPU_H
3939
#define CPU_H
4040

41-
/* Define page size */
42-
#define CPU_PAGE_MASK 0xFFFFFFFFFFFFF000UL
43-
4441
/* Define CPU stack alignment */
4542
#define CPU_STACK_ALIGN 16UL
4643

hypervisor/include/arch/x86/mmu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@
5555

5656
static inline uint64_t round_page_up(uint64_t addr)
5757
{
58-
return (((addr + (uint64_t)PAGE_SIZE) - 1UL) & CPU_PAGE_MASK);
58+
return (((addr + (uint64_t)PAGE_SIZE) - 1UL) & PAGE_MASK);
5959
}
6060

6161
static inline uint64_t round_page_down(uint64_t addr)
6262
{
63-
return (addr & CPU_PAGE_MASK);
63+
return (addr & PAGE_MASK);
6464
}
6565

6666
/**

hypervisor/include/arch/x86/page.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#define PAGE_SHIFT 12U
1111
#define PAGE_SIZE (1U << PAGE_SHIFT)
12+
#define PAGE_MASK 0xFFFFFFFFFFFFF000UL
1213

1314
/* size of the low MMIO address space: 2GB */
1415
#define PLATFORM_LO_MMIO_SIZE 0x80000000UL

0 commit comments

Comments
 (0)