Added sys_eniop, sys_vm_setbuf, and sys_vm_map.

This commit is contained in:
Philip Homburg 2005-09-30 12:51:33 +00:00
parent 731eee27c3
commit 9528152f68
6 changed files with 96 additions and 0 deletions

View File

@ -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

14
lib/other/sys_eniop.c Normal file
View File

@ -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);
}

20
lib/other/taskcall.c Executable file
View File

@ -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 <lib.h>
#include <minix/syslib.h>
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);
}

View File

@ -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

25
lib/syslib/sys_vm_map.c Normal file
View File

@ -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);
}

View File

@ -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);
}