而对下级表的物理地址的存储4K页面寻址遵循如下规则:
① 当MAXPHYADDR为52位时,上一级table entry的12~51位提供下一级table物理基地址的高40位,低12位补零,达到基地址在4K边界对齐;
② 当MAXPHYADDR为40位时,上一级table entry的12~39位提供下一级table物理基地址的高28位,此时40~51是保留位,必须置0,低12位补零,达到基地址在4K边界对齐;
③ 当MAXPHYADDR为36位时,上一级table entry的12~35位提供下一级table物理基地址的高24位,此时36~51是保留位,必须置0,低12位补零,达到基地址在4K边界对齐。
rc =
MacroStrong_PhysicalMemoryAllocate(
&Device,
&Buffer_1,
TRUE // Do not allocate a smaller buffer on failure
);
if (rc != MS_STATUS_OK)
{
Cons_printf("Error unable to allocate physical buffer\n");
return -1;
}
// Map the buffer into user space
rc =
MacroStrong_PhysicalMemoryMap(
&Device,
&Buffer_1
);
if (rc != PLX_STATUS_OK)
{
Cons_printf("Error ÿ unable to map physical buffer\n");
return -1;
}