minix/lib/libsys/sys_segctl.c

25 lines
772 B
C
Raw Normal View History

2005-04-21 16:53:53 +02:00
#include "syslib.h"
/*===========================================================================*
2005-04-29 17:36:43 +02:00
* sys_segctl *
2005-04-21 16:53:53 +02:00
*===========================================================================*/
2005-04-29 17:36:43 +02:00
PUBLIC int sys_segctl(index, seg, off, phys, size)
int *index; /* return index of remote segment */
2005-04-21 16:53:53 +02:00
u16_t *seg; /* return segment selector here */
vir_bytes *off; /* return offset in segment here */
phys_bytes phys; /* physical address to convert */
vir_bytes size; /* size of segment */
{
message m;
int s;
m.SEG_PHYS = phys;
m.SEG_SIZE = size;
s = _kernel_call(SYS_SEGCTL, &m);
2005-04-29 17:36:43 +02:00
*index = (int) m.SEG_INDEX;
2005-04-21 16:53:53 +02:00
*seg = (u16_t) m.SEG_SELECT;
*off = (vir_bytes) m.SEG_OFFSET;
return s;
}