adddma/deldma/getdma/sys_mapdma
This commit is contained in:
		
							parent
							
								
									959ed5a191
								
							
						
					
					
						commit
						4951a741b0
					
				@ -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 \
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										21
									
								
								lib/other/_adddma.c
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										21
									
								
								lib/other/_adddma.c
									
									
									
									
									
										Executable file
									
								
							@ -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);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										21
									
								
								lib/other/_deldma.c
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										21
									
								
								lib/other/_deldma.c
									
									
									
									
									
										Executable file
									
								
							@ -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);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										25
									
								
								lib/other/_getdma.c
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										25
									
								
								lib/other/_getdma.c
									
									
									
									
									
										Executable file
									
								
							@ -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;
 | 
			
		||||
}
 | 
			
		||||
@ -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 \
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										7
									
								
								lib/syscall/adddma.s
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										7
									
								
								lib/syscall/adddma.s
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,7 @@
 | 
			
		||||
.sect .text
 | 
			
		||||
.extern	__adddma
 | 
			
		||||
.define	_adddma
 | 
			
		||||
.align 2
 | 
			
		||||
 | 
			
		||||
_adddma:
 | 
			
		||||
	jmp	__adddma
 | 
			
		||||
							
								
								
									
										7
									
								
								lib/syscall/deldma.s
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										7
									
								
								lib/syscall/deldma.s
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,7 @@
 | 
			
		||||
.sect .text
 | 
			
		||||
.extern	__deldma
 | 
			
		||||
.define	_deldma
 | 
			
		||||
.align 2
 | 
			
		||||
 | 
			
		||||
_deldma:
 | 
			
		||||
	jmp	__deldma
 | 
			
		||||
							
								
								
									
										7
									
								
								lib/syscall/getdma.s
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										7
									
								
								lib/syscall/getdma.s
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,7 @@
 | 
			
		||||
.sect .text
 | 
			
		||||
.extern	__getdma
 | 
			
		||||
.define	_getdma
 | 
			
		||||
.align 2
 | 
			
		||||
 | 
			
		||||
_getdma:
 | 
			
		||||
	jmp	__getdma
 | 
			
		||||
							
								
								
									
										19
									
								
								lib/syslib/sys_mapdma.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								lib/syslib/sys_mapdma.c
									
									
									
									
									
										Normal file
									
								
							@ -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);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user