From: Philip Homburg Date: Fri, 30 Sep 2005 12:51:33 +0000 (+0000) Subject: Added sys_eniop, sys_vm_setbuf, and sys_vm_map. X-Git-Tag: v3.1.2a~686 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=9528152f68254a25a2d33dba4c650d7276c1b2cc;p=minix.git Added sys_eniop, sys_vm_setbuf, and sys_vm_map. --- diff --git a/lib/other/Makefile b/lib/other/Makefile index c1dc8b544..d03376e81 100755 --- a/lib/other/Makefile +++ b/lib/other/Makefile @@ -63,6 +63,8 @@ OBJECTS = \ $(LIBRARY)(swab.o) \ $(LIBRARY)(syscall.o) \ $(LIBRARY)(sysconf.o) \ + $(LIBRARY)(sys_eniop.o) \ + $(LIBRARY)(taskcall.o) \ $(LIBRARY)(telldir.o) \ $(LIBRARY)(termcap.o) \ $(LIBRARY)(ttyname.o) \ @@ -251,6 +253,12 @@ $(LIBRARY)(sysconf.o): sysconf.c $(LIBRARY)(syslib.o): syslib.c $(CC1) syslib.c +$(LIBRARY)(sys_eniop.o): sys_eniop.c + $(CC1) sys_eniop.c + +$(LIBRARY)(taskcall.o): taskcall.c + $(CC1) taskcall.c + $(LIBRARY)(telldir.o): telldir.c $(CC1) telldir.c diff --git a/lib/other/sys_eniop.c b/lib/other/sys_eniop.c new file mode 100644 index 000000000..d3d5a9231 --- /dev/null +++ b/lib/other/sys_eniop.c @@ -0,0 +1,14 @@ +#include "../syslib/syslib.h" + +/*===========================================================================* + * sys_enable_iop * + *===========================================================================*/ +PUBLIC int sys_enable_iop(proc_nr) +int proc_nr; /* number of process to allow I/O */ +{ + message m_iop; + m_iop.PROC_NR = proc_nr; + return _taskcall(SYSTASK, SYS_IOPENABLE, &m_iop); +} + + diff --git a/lib/other/taskcall.c b/lib/other/taskcall.c new file mode 100755 index 000000000..0a2024aa1 --- /dev/null +++ b/lib/other/taskcall.c @@ -0,0 +1,20 @@ +/* _taskcall() is the same as _syscall() except it returns negative error + * codes directly and not in errno. This is a better interface for MM and + * FS. + */ + +#include +#include + +PUBLIC int _taskcall(who, syscallnr, msgptr) +int who; +int syscallnr; +register message *msgptr; +{ + int status; + + msgptr->m_type = syscallnr; + status = _sendrec(who, msgptr); + if (status != 0) return(status); + return(msgptr->m_type); +} diff --git a/lib/syslib/Makefile b/lib/syslib/Makefile index 165747130..63b44bf24 100755 --- a/lib/syslib/Makefile +++ b/lib/syslib/Makefile @@ -42,6 +42,8 @@ OBJECTS = \ $(LIBSYS)(sys_voutl.o) \ $(LIBSYS)(sys_setalarm.o) \ $(LIBSYS)(sys_memset.o) \ + $(LIBSYS)(sys_vm_setbuf.o) \ + $(LIBSYS)(sys_vm_map.o) \ $(LIBSYS)(taskcall.o) \ $(LIBSYS): $(OBJECTS) @@ -150,6 +152,12 @@ $(LIBSYS)(sys_setalarm.o): sys_setalarm.c $(LIBSYS)(sys_memset.o): sys_memset.c $(CC1) sys_memset.c +$(LIBSYS)(sys_vm_setbuf.o): sys_vm_setbuf.c + $(CC1) sys_vm_setbuf.c + +$(LIBSYS)(sys_vm_map.o): sys_vm_map.c + $(CC1) sys_vm_map.c + $(LIBSYS)(taskcall.o): taskcall.c $(CC1) taskcall.c diff --git a/lib/syslib/sys_vm_map.c b/lib/syslib/sys_vm_map.c new file mode 100644 index 000000000..6f4296da1 --- /dev/null +++ b/lib/syslib/sys_vm_map.c @@ -0,0 +1,25 @@ +#include "syslib.h" + +/*===========================================================================* + * sys_vm_map * + *===========================================================================*/ +PUBLIC int sys_vm_map(proc_nr, do_map, base, size, offset) +int proc_nr; +int do_map; +phys_bytes base; +phys_bytes size; +phys_bytes offset; +{ + message m; + int result; + + m.m4_l1= proc_nr; + m.m4_l2= do_map; + m.m4_l3= base; + m.m4_l4= size; + m.m4_l5= offset; + + result = _taskcall(SYSTASK, SYS_VM_MAP, &m); + return(result); +} + diff --git a/lib/syslib/sys_vm_setbuf.c b/lib/syslib/sys_vm_setbuf.c new file mode 100644 index 000000000..ade00cc62 --- /dev/null +++ b/lib/syslib/sys_vm_setbuf.c @@ -0,0 +1,21 @@ +#include "syslib.h" + +/*===========================================================================* + * sys_vm_setbuf * + *===========================================================================*/ +PUBLIC int sys_vm_setbuf(base, size, high) +phys_bytes base; +phys_bytes size; +phys_bytes high; +{ + message m; + int result; + + m.m4_l1= base; + m.m4_l2= size; + m.m4_l3= high; + + result = _taskcall(SYSTASK, SYS_VM_SETBUF, &m); + return(result); +} +