-/* 三个页挂载点: 用于临时创建&编辑页表 */
-
-#define PG_MOUNT_1 (&__pg_mount_point)
-#define PG_MOUNT_2 (&__pg_mount_point + 0x1000)
-#define PG_MOUNT_3 (&__pg_mount_point + 0x2000)
-
+/* 四个页挂载点,两个页目录挂载点: 用于临时创建&编辑页表 */
+#define PG_MOUNT_RANGE(l1_index) (701 <= l1_index && l1_index <= 703)
+#define VMS_MOUNT_1 (KERNEL_MM_BASE + MEM_4MB)
+#define PG_MOUNT_BASE (VMS_MOUNT_1 + MEM_4MB)
+#define PG_MOUNT_1 (PG_MOUNT_BASE)
+#define PG_MOUNT_2 (PG_MOUNT_BASE + 0x1000)
+#define PG_MOUNT_3 (PG_MOUNT_BASE + 0x2000)
+#define PG_MOUNT_4 (PG_MOUNT_BASE + 0x3000)
+
+#define VMS_SELF L2_BASE_VADDR
+
+#define CURPROC_PTE(vpn) \
+ (&((x86_page_table*)(VMS_MOUNT_1 | (((vpn)&0xffc00) << 2))) \
+ ->entry[(vpn)&0x3ff])
+#define PTE_MOUNTED(mnt, vpn) \
+ (((x86_page_table*)((mnt) | (((vpn)&0xffc00) << 2)))->entry[(vpn)&0x3ff])