Files
xen/tools/internal/xi_phys_grant.c
T
kaf24@scramble.cl.cam.ac.uk 6bf073980b bitkeeper revision 1.339.1.1 (3f108aff8cNSEyxZFIWHZ-zZtSTT2w)
Many files:
  new file
  Clean up dom0 proc interfaces. Implemented ioremap and /dev/mem.
.del-dom0_block.c~63815c1974691c1c:
  Delete: xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_block.c
.del-sched_ops.c~20807e5c2ed6b51:
  Delete: xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/sched_ops.c
.del-xi_list~49abab167156959:
  Delete: tools/internal/xi_list
.del-xl_physdisk_proc.c~49451bc26a40fcb2:
  Delete: xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_physdisk_proc.c
.del-mmu.h~6bc56547519b6f96:
  Delete: xenolinux-2.4.21-sparse/include/asm-xeno/mmu.h
.del-dom0.h~6fb656bb4a0c52e1:
  Delete: xenolinux-2.4.21-sparse/include/asm-xeno/dom0.h
.del-dom0_ops.h~fb19960d77217740:
  Delete: tools/internal/dom0_ops.h
.del-dom0_ops.h~5c52b016e619bd2d:
  Delete: xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_ops.h
.del-dom0_memory.c~c72c6e5f7fd65d38:
  Delete: xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_memory.c
.del-direct_map.c~d2fedc686b334f2a:
  Delete: xenolinux-2.4.21-sparse/arch/xeno/mm/direct_map.c
direct_map.c:
  Rename: xenolinux-2.4.21-sparse/arch/xeno/mm/get_unmapped_area.c -> xenolinux-2.4.21-sparse/arch/xeno/mm/direct_map.c
2003-07-12 22:26:07 +00:00

44 lines
940 B
C

#define _GNU_SOURCE
#include "dom0_defs.h"
int main(int argc, char *argv[])
{
privcmd_blkmsg_t blkmsg;
xp_disk_t xpd;
if ( argc != 7 )
{
fprintf(stderr, "Usage: xi_physdev_grant <r/rw> <domain> "
"<device> <start sector> <n_sectors> <partition>\n");
return 1;
}
xpd.mode = 0;
if ( strchr(argv[1], 'r') )
xpd.mode |= PHYSDISK_MODE_R;
if ( strchr(argv[1], 'w') )
xpd.mode |= PHYSDISK_MODE_W;
xpd.domain = atol(argv[2]);
xpd.device = xldev_to_physdev(atol(argv[3]));
xpd.start_sect = atol(argv[4]);
xpd.n_sectors = atol(argv[5]);
xpd.partition = atol(argv[6]);
if ( xpd.device == 0 )
{
ERROR("Unrecognised device");
return 1;
}
blkmsg.op = XEN_BLOCK_PHYSDEV_GRANT;
blkmsg.buf = &xpd;
blkmsg.buf_size = sizeof(xpd);
if ( do_xen_blkmsg(&blkmsg) < 0 )
return 1;
return 0;
}