[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [PATCH 02/40] mini-os: replace the L1_PAGETABLE_SHIFT with PAGE_SHIFT





On 03/11/17 03:11, Huang Shijie wrote:
The L1_PAGETABLE_SHIFT is a confusing macro for arm.
Replace it with PAGE_SHIFT.

Jira: ENTOS-247
Change-Id: Iadc2eef9ce6f8a4f8a31ee43410e1204dcc8b8da
Signed-off-by: Huang Shijie <shijie.huang@xxxxxxx>
---
  include/arm/arch_mm.h | 10 ++++------
  1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/include/arm/arch_mm.h b/include/arm/arch_mm.h
index 79d9e05..8ad0d2a 100644
--- a/include/arm/arch_mm.h
+++ b/include/arm/arch_mm.h
@@ -12,17 +12,15 @@ extern uint32_t physical_address_offset;    /* Add this to 
a virtual address to get
  #define PAGE_SIZE        (1 << PAGE_SHIFT)
  #define PAGE_MASK       (~(PAGE_SIZE-1))
-#define L1_PAGETABLE_SHIFT 12
-
  #define L1_PROT          0

If you drop L1_PAGETABLE_SHIFT, please also drop L1_PROT that does not seem to be used and make little sense alone.

Cheers,

#define to_phys(x) (((paddr_t)(x)+physical_address_offset) & 0xffffffff)
  #define to_virt(x)                 ((void *)(((x)-physical_address_offset) & 
0xffffffff))
-#define PFN_UP(x) (unsigned long)(((x) + PAGE_SIZE-1) >> L1_PAGETABLE_SHIFT)
-#define PFN_DOWN(x)    (unsigned long)((x) >> L1_PAGETABLE_SHIFT)
-#define PFN_PHYS(x)    ((uint64_t)(x) << L1_PAGETABLE_SHIFT)
-#define PHYS_PFN(x)    (unsigned long)((x) >> L1_PAGETABLE_SHIFT)
+#define PFN_UP(x)                  (unsigned long)(((x) + PAGE_SIZE-1) >> 
PAGE_SHIFT)
+#define PFN_DOWN(x)                (unsigned long)((x) >> PAGE_SHIFT)
+#define PFN_PHYS(x)                ((uint64_t)(x) << PAGE_SHIFT)
+#define PHYS_PFN(x)                (unsigned long)((x) >> PAGE_SHIFT)
#define virt_to_pfn(_virt) (PFN_DOWN(to_phys(_virt)))
  #define virt_to_mfn(_virt)         (PFN_DOWN(to_phys(_virt)))


--
Julien Grall

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.