*/
extern pte_t xen_fixmap[];
+/* Map a page in a fixmap entry */
+void set_fixmap(unsigned int map, mfn_t mfn, unsigned int flags);
+/* Remove a mapping from a fixmap entry */
+void clear_fixmap(unsigned int map);
+
#define fix_to_virt(slot) ((void *)FIXMAP_ADDR(slot))
static inline unsigned int virt_to_fix(vaddr_t vaddr)
#include <xen/pmap.h>
#include <xen/spinlock.h>
+#include <asm/fixmap.h>
#include <asm/flushtlb.h>
#include <asm/page.h>
{
return pt_update(virt, INVALID_MFN, nr_mfns, PTE_POPULATE);
}
+
+/* Map a 4k page in a fixmap entry */
+void set_fixmap(unsigned int map, mfn_t mfn, unsigned int flags)
+{
+ if ( map_pages_to_xen(FIXMAP_ADDR(map), mfn, 1, flags | PTE_SMALL) != 0 )
+ BUG();
+}
+
+/* Remove a mapping from a fixmap entry */
+void clear_fixmap(unsigned int map)
+{
+ if ( destroy_xen_mappings(FIXMAP_ADDR(map),
+ FIXMAP_ADDR(map) + PAGE_SIZE) != 0 )
+ BUG();
+}