offset = phys & (PAGE_SIZE - 1);
mapped_size = PAGE_SIZE - offset;
- set_fixmap(FIXMAP_ACPI_BEGIN, phys >> PAGE_SHIFT, PAGE_HYPERVISOR);
+ set_fixmap(FIXMAP_ACPI_BEGIN, maddr_to_mfn(phys), PAGE_HYPERVISOR);
base = FIXMAP_ADDR(FIXMAP_ACPI_BEGIN);
/* Most cases can be covered by the below. */
if ( ++idx > FIXMAP_ACPI_END )
return NULL; /* cannot handle this */
phys += PAGE_SIZE;
- set_fixmap(idx, phys >> PAGE_SHIFT, PAGE_HYPERVISOR);
+ set_fixmap(idx, maddr_to_mfn(phys), PAGE_HYPERVISOR);
mapped_size += PAGE_SIZE;
}
void *src = (void *)FIXMAP_ADDR(FIXMAP_MISC);
while (len) {
- paddr_t p;
unsigned long l, s;
- p = paddr >> PAGE_SHIFT;
s = paddr & (PAGE_SIZE-1);
l = min(PAGE_SIZE - s, len);
- set_fixmap(FIXMAP_MISC, p, BUFFERABLE);
+ set_fixmap(FIXMAP_MISC, maddr_to_mfn(paddr), BUFFERABLE);
memcpy(dst, src + s, l);
clean_dcache_va_range(dst, l);
}
/* Map a 4k page in a fixmap entry */
-void set_fixmap(unsigned map, unsigned long mfn, unsigned attributes)
+void set_fixmap(unsigned map, mfn_t mfn, unsigned attributes)
{
- lpae_t pte = mfn_to_xen_entry(_mfn(mfn), attributes);
+ lpae_t pte = mfn_to_xen_entry(mfn, attributes);
pte.pt.table = 1; /* 4k mappings always have this bit set */
pte.pt.xn = 1;
write_pte(xen_fixmap + third_table_offset(FIXMAP_ADDR(map)), pte);
uint32_t *syscfg = (uint32_t *) FIXMAP_ADDR(FIXMAP_MISC);
int ret = -1;
- set_fixmap(FIXMAP_MISC, V2M_SYS_MMIO_BASE >> PAGE_SHIFT, DEV_SHARED);
+ set_fixmap(FIXMAP_MISC, maddr_to_mfn(V2M_SYS_MMIO_BASE), DEV_SHARED);
if ( syscfg[V2M_SYS_CFGCTRL/4] & V2M_SYS_CFG_START )
goto out;
/* uses FIXMAP_MISC */
set_pixclock(videomode->pixclock);
- set_fixmap(FIXMAP_MISC, hdlcd_start >> PAGE_SHIFT, DEV_SHARED);
+ set_fixmap(FIXMAP_MISC, maddr_to_mfn(hdlcd_start), DEV_SHARED);
HDLCD[HDLCD_COMMAND] = 0;
HDLCD[HDLCD_LINELENGTH] = videomode->xres * bytes_per_pixel;
/* Map a frame table to cover physical addresses ps through pe */
extern void setup_frametable_mappings(paddr_t ps, paddr_t pe);
/* Map a 4k page in a fixmap entry */
-extern void set_fixmap(unsigned map, unsigned long mfn, unsigned attributes);
+extern void set_fixmap(unsigned map, mfn_t mfn, unsigned attributes);
/* Remove a mapping from a fixmap entry */
extern void clear_fixmap(unsigned map);
/* map a physical range in virtual memory */