Add a function to map one physical frame to a specified virtual
address as read/write. This will be used later multiple times.
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
#define L1_PAGETABLE_SHIFT 12
+#define L1_PROT 0
+
#define to_phys(x) (((paddr_t)(x)+physical_address_offset) & 0xffffffff)
#define to_virt(x) ((void *)(((x)-physical_address_offset) & 0xffffffff))
const unsigned long *f, unsigned long n, unsigned long stride,
unsigned long increment, domid_t id, int *err, unsigned long prot);
int unmap_frames(unsigned long va, unsigned long num_frames);
+int map_frame_rw(unsigned long addr, unsigned long mfn);
#ifdef HAVE_LIBC
extern unsigned long heap, brk, heap_mapped, heap_end;
#endif
return HYPERVISOR_memory_op(XENMEM_decrease_reservation, &reservation);
}
+int map_frame_rw(unsigned long addr, unsigned long mfn)
+{
+ return do_map_frames(addr, &mfn, 1, 1, 1, DOMID_SELF, NULL, L1_PROT);
+}
+
#ifdef HAVE_LIBC
void *sbrk(ptrdiff_t increment)
{