From: Philip Homburg Date: Thu, 21 Feb 2008 16:02:22 +0000 (+0000) Subject: adddma/deldma/getdma/sys_mapdma X-Git-Tag: v3.1.4~289 X-Git-Url: http://zhaoyanbai.com/repos/icons/static/man.3.ps?a=commitdiff_plain;h=4951a741b0230479972154185bd8549042b990c8;p=minix.git adddma/deldma/getdma/sys_mapdma --- diff --git a/lib/other/Makefile.in b/lib/other/Makefile.in index 0d7356772..2bf999a22 100644 --- a/lib/other/Makefile.in +++ b/lib/other/Makefile.in @@ -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 index 000000000..d77b29a00 --- /dev/null +++ b/lib/other/_adddma.c @@ -0,0 +1,21 @@ +/* adddma.c + */ + +#include +#define adddma _adddma +#include +#include + +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 index 000000000..7ec5739c1 --- /dev/null +++ b/lib/other/_deldma.c @@ -0,0 +1,21 @@ +/* deldma.c + */ + +#include +#define deldma _deldma +#include +#include + +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 index 000000000..1c6175d3b --- /dev/null +++ b/lib/other/_getdma.c @@ -0,0 +1,25 @@ +/* getdma.c + */ + +#include +#define getdma _getdma +#include +#include + +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; +} diff --git a/lib/syscall/Makefile.in b/lib/syscall/Makefile.in index 687338072..7ccfc22fd 100644 --- a/lib/syscall/Makefile.in +++ b/lib/syscall/Makefile.in @@ -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 index 000000000..2f4dcf999 --- /dev/null +++ b/lib/syscall/adddma.s @@ -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 index 000000000..797d62649 --- /dev/null +++ b/lib/syscall/deldma.s @@ -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 index 000000000..3939a3d05 --- /dev/null +++ b/lib/syscall/getdma.s @@ -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 index 000000000..d5509e14a --- /dev/null +++ b/lib/syslib/sys_mapdma.c @@ -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); +} +