]> Zhao Yanbai Git Server - minix.git/commitdiff
adddma/deldma/getdma/sys_mapdma
authorPhilip Homburg <philip@cs.vu.nl>
Thu, 21 Feb 2008 16:02:22 +0000 (16:02 +0000)
committerPhilip Homburg <philip@cs.vu.nl>
Thu, 21 Feb 2008 16:02:22 +0000 (16:02 +0000)
lib/other/Makefile.in
lib/other/_adddma.c [new file with mode: 0755]
lib/other/_deldma.c [new file with mode: 0755]
lib/other/_getdma.c [new file with mode: 0755]
lib/syscall/Makefile.in
lib/syscall/adddma.s [new file with mode: 0755]
lib/syscall/deldma.s [new file with mode: 0755]
lib/syscall/getdma.s [new file with mode: 0755]
lib/syslib/sys_mapdma.c [new file with mode: 0644]

index 0d7356772600eeb3970bc5a9980dd6675a9996f5..2bf999a2291b9917f1452dadf2d0d39064e7c84d 100644 (file)
@@ -6,10 +6,13 @@ LIBRARIES=libc
 
 libc_FILES=" \
        __pm_findproc.c \
+       _adddma.c \
        _brk.c \
        _cprofile.c \
+       _deldma.c \
        _devctl.c \
        _getdents.c \
+       _getdma.c \
        _getnpid.c \
        _getnprocnr.c \
        _getpprocnr.c \
diff --git a/lib/other/_adddma.c b/lib/other/_adddma.c
new file mode 100755 (executable)
index 0000000..d77b29a
--- /dev/null
@@ -0,0 +1,21 @@
+/* adddma.c 
+ */
+
+#include <lib.h>
+#define adddma _adddma
+#include <unistd.h>
+#include <stdarg.h>
+
+int adddma(proc_e, start, size)
+endpoint_t proc_e;
+phys_bytes start;
+phys_bytes size;
+{
+  message m;
+
+  m.m2_i1= proc_e;
+  m.m2_l1= start;
+  m.m2_l2= size;
+
+  return _syscall(MM, ADDDMA, &m);
+}
diff --git a/lib/other/_deldma.c b/lib/other/_deldma.c
new file mode 100755 (executable)
index 0000000..7ec5739
--- /dev/null
@@ -0,0 +1,21 @@
+/* deldma.c 
+ */
+
+#include <lib.h>
+#define deldma _deldma
+#include <unistd.h>
+#include <stdarg.h>
+
+int deldma(proc_e, start, size)
+endpoint_t proc_e;
+phys_bytes start;
+phys_bytes size;
+{
+  message m;
+
+  m.m2_i1= proc_e;
+  m.m2_l1= start;
+  m.m2_l2= size;
+
+  return _syscall(MM, DELDMA, &m);
+}
diff --git a/lib/other/_getdma.c b/lib/other/_getdma.c
new file mode 100755 (executable)
index 0000000..1c6175d
--- /dev/null
@@ -0,0 +1,25 @@
+/* getdma.c 
+ */
+
+#include <lib.h>
+#define getdma _getdma
+#include <unistd.h>
+#include <stdarg.h>
+
+int getdma(procp, basep, sizep)
+endpoint_t *procp;
+phys_bytes *basep;
+phys_bytes *sizep;
+{
+  int r;
+  message m;
+
+  r= _syscall(MM, GETDMA, &m);
+  if (r == 0)
+  {
+       *procp= m.m2_i1;
+       *basep= m.m2_l1;
+       *sizep= m.m2_l2;
+  }
+  return r;
+}
index 687338072f489a26d900c54eccce9b5c00ef1485..7ccfc22fd450f4e59107d56a50bfcc3f8024d59a 100644 (file)
@@ -6,6 +6,7 @@ libc_FILES=" \
        _exit.s \
        _pm_findproc.s \
        access.s \
+       adddma.s \
        alarm.s \
        brk.s \
        cfgetispeed.s \
@@ -20,6 +21,7 @@ libc_FILES=" \
        closedir.s \
        cprofile.s \
        creat.s \
+       deldma.s \
        devctl.s \
        dup.s \
        dup2.s \
@@ -38,6 +40,7 @@ libc_FILES=" \
        fstatfs.s \
        getcwd.s \
        getdents.s \
+       getdma.s \
        getegid.s \
        geteuid.s \
        getgid.s \
diff --git a/lib/syscall/adddma.s b/lib/syscall/adddma.s
new file mode 100755 (executable)
index 0000000..2f4dcf9
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text
+.extern        __adddma
+.define        _adddma
+.align 2
+
+_adddma:
+       jmp     __adddma
diff --git a/lib/syscall/deldma.s b/lib/syscall/deldma.s
new file mode 100755 (executable)
index 0000000..797d626
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text
+.extern        __deldma
+.define        _deldma
+.align 2
+
+_deldma:
+       jmp     __deldma
diff --git a/lib/syscall/getdma.s b/lib/syscall/getdma.s
new file mode 100755 (executable)
index 0000000..3939a3d
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text
+.extern        __getdma
+.define        _getdma
+.align 2
+
+_getdma:
+       jmp     __getdma
diff --git a/lib/syslib/sys_mapdma.c b/lib/syslib/sys_mapdma.c
new file mode 100644 (file)
index 0000000..d5509e1
--- /dev/null
@@ -0,0 +1,19 @@
+#include "syslib.h"
+
+/*===========================================================================*
+ *                                sys_mapdma                                *
+ *===========================================================================*/
+PUBLIC int sys_mapdma(vir_addr, bytes)
+vir_bytes vir_addr;                    /* address in bytes with segment*/
+vir_bytes bytes;                       /* number of bytes to be copied */
+{
+    message m;
+    int result;
+
+    m.CP_SRC_ADDR = vir_addr;
+    m.CP_NR_BYTES = bytes;
+
+    result = _taskcall(SYSTASK, SYS_MAPDMA, &m);
+    return(result);
+}
+