@@ -29,11 +29,12 @@ void pmap_unlock(void)
spin_unlock(&lock);
}
-void *pmap_map(struct page_info *page)
+void *pmap_map(mfn_t mfn)
{
unsigned int idx;
void *linear = NULL;
enum fixed_addresses slot;
+ l1_pgentry_t *pl1e;
ASSERT(!in_irq());
ASSERT(spin_is_locked(&lock));
@@ -47,7 +48,8 @@ void *pmap_map(struct page_info *page)
slot = idx + FIX_PMAP_BEGIN;
ASSERT(slot >= FIX_PMAP_BEGIN && slot <= FIX_PMAP_END);
- set_fixmap(slot, mfn_x(page_to_mfn(page)));
+ pl1e = &l1_fixmap[L1_PAGETABLE_ENTRIES - 1 - slot];
+ l1e_write_atomic(pl1e, l1e_from_mfn(mfn, PAGE_HYPERVISOR));
linear = (void *)__fix_to_virt(slot);
return linear;
@@ -56,6 +58,7 @@ void *pmap_map(struct page_info *page)
void pmap_unmap(void *p)
{
unsigned int idx;
+ l1_pgentry_t *pl1e;
enum fixed_addresses slot = __virt_to_fix((unsigned long)p);
ASSERT(!in_irq());
@@ -64,7 +67,9 @@ void pmap_unmap(void *p)
idx = slot - FIX_PMAP_BEGIN;
__clear_bit(idx, &inuse);
- clear_fixmap(slot);
+
+ pl1e = &l1_fixmap[L1_PAGETABLE_ENTRIES - 1 - slot];
+ l1e_write_atomic(pl1e, l1e_from_mfn(_mfn(0), 0));
}
static void __maybe_unused build_assertions(void)
@@ -6,7 +6,7 @@
void pmap_lock(void);
void pmap_unlock(void);
-void *pmap_map(struct page_info *page);
+void *pmap_map(mfn_t mfn);
void pmap_unmap(void *p);
#endif /* __X86_PMAP_H__ */