2011-03-22 14:47:35 +01:00
|
|
|
|
|
|
|
#include <lib.h>
|
|
|
|
#include <minix/vm.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
2012-01-13 00:23:04 +01:00
|
|
|
int vm_adddma(proc_e, start, size)
|
2011-03-22 14:47:35 +01:00
|
|
|
endpoint_t proc_e;
|
|
|
|
phys_bytes start;
|
|
|
|
phys_bytes size;
|
|
|
|
{
|
|
|
|
message m;
|
|
|
|
|
|
|
|
m.VMAD_EP= proc_e;
|
|
|
|
m.VMAD_START= start;
|
|
|
|
m.VMAD_SIZE= size;
|
|
|
|
|
|
|
|
return _syscall(VM_PROC_NR, VM_ADDDMA, &m);
|
|
|
|
}
|
|
|
|
|
2012-01-13 00:23:04 +01:00
|
|
|
int vm_deldma(proc_e, start, size)
|
2011-03-22 14:47:35 +01:00
|
|
|
endpoint_t proc_e;
|
|
|
|
phys_bytes start;
|
|
|
|
phys_bytes size;
|
|
|
|
{
|
|
|
|
message m;
|
|
|
|
|
|
|
|
m.VMDD_EP= proc_e;
|
|
|
|
m.VMDD_START= start;
|
|
|
|
m.VMDD_SIZE= size;
|
|
|
|
|
|
|
|
return _syscall(VM_PROC_NR, VM_DELDMA, &m);
|
|
|
|
}
|
|
|
|
|
2012-01-13 00:23:04 +01:00
|
|
|
int vm_getdma(procp, basep, sizep)
|
2011-03-22 14:47:35 +01:00
|
|
|
endpoint_t *procp;
|
|
|
|
phys_bytes *basep;
|
|
|
|
phys_bytes *sizep;
|
|
|
|
{
|
|
|
|
int r;
|
|
|
|
message m;
|
|
|
|
|
|
|
|
r= _syscall(VM_PROC_NR, VM_GETDMA, &m);
|
|
|
|
if (r == 0)
|
|
|
|
{
|
|
|
|
*procp= m.VMGD_PROCP;
|
|
|
|
*basep= m.VMGD_BASEP;
|
|
|
|
*sizep= m.VMGD_SIZEP;
|
|
|
|
}
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|