Added lance entry to drivers.conf.
[minix3-old.git] / kernel / system / do_mapdma.c
blob47f0c43ca9d0dc75432e451f75042897ccd56efc
1 /* The kernel call implemented in this file:
2 * m_type: SYS_MAPDMA
4 * The parameters for this kernel call are:
5 * m5_l1: CP_SRC_ADDR (virtual address)
6 * m5_l3: CP_NR_BYTES (size of datastructure)
7 */
9 #include "../system.h"
11 /*==========================================================================*
12 * do_mapdma *
13 *==========================================================================*/
14 PUBLIC int do_mapdma(m_ptr)
15 register message *m_ptr; /* pointer to request message */
17 int r;
18 endpoint_t proc_e;
19 int proc_p;
20 vir_bytes base, size;
21 phys_bytes phys_base;
22 struct proc *proc;
23 message m;
25 proc_e = m_ptr->CP_SRC_ENDPT;
26 base= m_ptr->CP_SRC_ADDR;
27 size= m_ptr->CP_NR_BYTES;
29 if (!isokendpt(proc_e, &proc_p))
30 return(EINVAL);
32 proc = proc_addr(proc_p);
34 phys_base= umap_local(proc, D, base, size);
35 if (!phys_base)
37 kprintf("do_mapdma: umap_local failed\n");
38 return EFAULT;
41 m_ptr->CP_DST_ADDR = phys_base;
42 return OK;