 878ba523ac
			
		
	
	
		878ba523ac
		
	
	
	
	
		
			
			This library includes various random and minix-specific functions included in the Minix libc. Most of them should be part of libsys, and in general it would be nice to extinguish this library over time.
		
			
				
	
	
		
			60 lines
		
	
	
		
			967 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			60 lines
		
	
	
		
			967 B
		
	
	
	
		
			C
		
	
	
	
	
	
| 
 | |
| #include <lib.h>
 | |
| #include <minix/vm.h>
 | |
| #include <unistd.h>
 | |
| #include <stdarg.h>
 | |
| 
 | |
| int vm_adddma(req_proc_e, proc_e, start, size)
 | |
| endpoint_t req_proc_e;
 | |
| endpoint_t proc_e;
 | |
| phys_bytes start;
 | |
| phys_bytes size;
 | |
| {
 | |
|   message m;
 | |
| 
 | |
|   m.VMAD_REQ= req_proc_e;
 | |
|   m.VMAD_EP= proc_e;
 | |
|   m.VMAD_START= start;
 | |
|   m.VMAD_SIZE= size;
 | |
| 
 | |
|   return _syscall(VM_PROC_NR, VM_ADDDMA, &m);
 | |
| }
 | |
| 
 | |
| int vm_deldma(req_proc_e, proc_e, start, size)
 | |
| endpoint_t req_proc_e;
 | |
| endpoint_t proc_e;
 | |
| phys_bytes start;
 | |
| phys_bytes size;
 | |
| {
 | |
|   message m;
 | |
| 
 | |
|   m.VMDD_REQ= proc_e;
 | |
|   m.VMDD_EP= proc_e;
 | |
|   m.VMDD_START= start;
 | |
|   m.VMDD_SIZE= size;
 | |
| 
 | |
|   return _syscall(VM_PROC_NR, VM_DELDMA, &m);
 | |
| }
 | |
| 
 | |
| int vm_getdma(req_proc_e, procp, basep, sizep)
 | |
| endpoint_t req_proc_e;
 | |
| endpoint_t *procp;
 | |
| phys_bytes *basep;
 | |
| phys_bytes *sizep;
 | |
| {
 | |
|   int r;
 | |
|   message m;
 | |
| 
 | |
|   m.VMGD_REQ = req_proc_e;
 | |
| 
 | |
|   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;
 | |
| }
 | |
| 
 |