- VM_KERN_NOPAGEZERO feature is gone

- sys_getbiosbuffer feature is gone (from kernel; available from vm)
- bump version number because munmap() calls that newly compiled binaries
  will do trigger an ugly (but harmless) error message in older VM's
- some new VM calls and flags, the new IPC calls
- some new CR0 register bits
- added files for shared memory
This commit is contained in:
Ben Gras 2009-09-21 14:23:10 +00:00
parent 0a27cf279e
commit 8a54d267f0
25 changed files with 399 additions and 27 deletions

View file

@ -8,11 +8,11 @@ all::
clean:: clean::
install:: install::
-rm -rf $(INC) #-rm -rf $(INC)
mkdir -p $(INC) #mkdir -p $(INC)
cpdir . $(INC) #cpdir . $(INC)
@chown -R bin $(INC) #@chown -R bin $(INC)
@rm -f $(INC)/Makefile #@rm -f $(INC)/Makefile
gcc: install gcc: install
SHELL=/bin/sh; if [ -f $(MKHEADERS343) ] ; then sh -e $(MKHEADERS343) ; fi SHELL=/bin/sh; if [ -f $(MKHEADERS343) ] ; then sh -e $(MKHEADERS343) ; fi

View file

@ -75,6 +75,7 @@ extern int errno; /* place where the error numbers go */
#define ENOTEMPTY (_SIGN 39) /* directory not empty */ #define ENOTEMPTY (_SIGN 39) /* directory not empty */
#define ELOOP (_SIGN 40) /* too many levels of symlinks detected */ #define ELOOP (_SIGN 40) /* too many levels of symlinks detected */
#define ERESTART (_SIGN 41) /* driver restarted */ #define ERESTART (_SIGN 41) /* driver restarted */
#define EIDRM (_SIGN 43) /* Identifier removed */
/* The following errors relate to networking. */ /* The following errors relate to networking. */
#define EPACKSIZE (_SIGN 50) /* invalid packet size for some protocol */ #define EPACKSIZE (_SIGN 50) /* invalid packet size for some protocol */

View file

@ -19,7 +19,7 @@
#define BRK 17 #define BRK 17
#define STAT 18 #define STAT 18
#define LSEEK 19 #define LSEEK 19
#define GETPID 20 #define MINIX_GETPID 20
#define MOUNT 21 #define MOUNT 21
#define UMOUNT 22 #define UMOUNT 22
#define SETUID 23 #define SETUID 23

View file

@ -310,7 +310,6 @@
# define SYS_GETINFO (KERNEL_CALL + 26) /* sys_getinfo() */ # define SYS_GETINFO (KERNEL_CALL + 26) /* sys_getinfo() */
# define SYS_ABORT (KERNEL_CALL + 27) /* sys_abort() */ # define SYS_ABORT (KERNEL_CALL + 27) /* sys_abort() */
# define SYS_IOPENABLE (KERNEL_CALL + 28) /* sys_enable_iop() */ # define SYS_IOPENABLE (KERNEL_CALL + 28) /* sys_enable_iop() */
# define SYS_VM_SETBUF (KERNEL_CALL + 29) /* sys_vm_setbuf() */
# define SYS_SAFECOPYFROM (KERNEL_CALL + 31) /* sys_safecopyfrom() */ # define SYS_SAFECOPYFROM (KERNEL_CALL + 31) /* sys_safecopyfrom() */
# define SYS_SAFECOPYTO (KERNEL_CALL + 32) /* sys_safecopyto() */ # define SYS_SAFECOPYTO (KERNEL_CALL + 32) /* sys_safecopyto() */
# define SYS_VSAFECOPY (KERNEL_CALL + 33) /* sys_vsafecopy() */ # define SYS_VSAFECOPY (KERNEL_CALL + 33) /* sys_vsafecopy() */
@ -525,6 +524,7 @@
* and sys_fork * and sys_fork
*/ */
#define PR_FORK_FLAGS m1_i3 #define PR_FORK_FLAGS m1_i3
#define PR_FORK_MSGADDR m1_p1
/* Field names for SYS_INT86 */ /* Field names for SYS_INT86 */
#define INT86_REG86 m1_p1 /* pointer to registers */ #define INT86_REG86 m1_p1 /* pointer to registers */
@ -584,6 +584,7 @@
#define SVMCTL_MRG_LEN m1_i1 /* MEMREQ_GET reply: length */ #define SVMCTL_MRG_LEN m1_i1 /* MEMREQ_GET reply: length */
#define SVMCTL_MRG_WRITE m1_i2 /* MEMREQ_GET reply: writeflag */ #define SVMCTL_MRG_WRITE m1_i2 /* MEMREQ_GET reply: writeflag */
#define SVMCTL_MRG_EP m1_i3 /* MEMREQ_GET reply: process */ #define SVMCTL_MRG_EP m1_i3 /* MEMREQ_GET reply: process */
#define SVMCTL_MRG_REQUESTOR m1_p2 /* MEMREQ_GET reply: requestor */
/* Codes and field names for SYS_SYSCTL. */ /* Codes and field names for SYS_SYSCTL. */
#define SYSCTL_CODE m1_i1 /* SYSCTL_CODE_* below */ #define SYSCTL_CODE m1_i1 /* SYSCTL_CODE_* below */
@ -602,6 +603,12 @@
#define VMCTL_MEMREQ_REPLY 15 #define VMCTL_MEMREQ_REPLY 15
#define VMCTL_INCSP 16 #define VMCTL_INCSP 16
#define VMCTL_NOPAGEZERO 18 #define VMCTL_NOPAGEZERO 18
#define VMCTL_I386_KERNELLIMIT 19
#define VMCTL_I386_PAGEDIRS 20
#define VMCTL_I386_FREEPDE 23
#define VMCTL_ENABLE_PAGING 24
#define VMCTL_I386_INVLPG 25
#define VMCTL_FLUSHTLB 26
/* Field names for SYS_VTIMER. */ /* Field names for SYS_VTIMER. */
#define VT_WHICH m2_i1 /* which timer to set/retrieve */ #define VT_WHICH m2_i1 /* which timer to set/retrieve */
@ -629,6 +636,7 @@
* arguments are passed in * arguments are passed in
* a struct rs_start * a struct rs_start
*/ */
#define RS_LOOKUP (DS_RQ_BASE + 8) /* lookup server name */
# define RS_CMD_ADDR m1_p1 /* command string */ # define RS_CMD_ADDR m1_p1 /* command string */
# define RS_CMD_LEN m1_i1 /* length of command */ # define RS_CMD_LEN m1_i1 /* length of command */
@ -637,6 +645,9 @@
# define RS_ENDPOINT m1_i1 /* endpoint number in reply */ # define RS_ENDPOINT m1_i1 /* endpoint number in reply */
# define RS_NAME m1_p1 /* name */
# define RS_NAME_LEN m1_i1 /* namelen */
/*===========================================================================* /*===========================================================================*
* Messages for the Data Store Server * * Messages for the Data Store Server *
*===========================================================================*/ *===========================================================================*/
@ -767,6 +778,16 @@
# define VMVC_FD m1_i1 # define VMVC_FD m1_i1
# define VMVC_ENDPOINT m1_i2 # define VMVC_ENDPOINT m1_i2
/* PM field names */
/* BRK */
#define PMBRK_ADDR m1_p1
/* TRACE */
#define PMTRACE_ADDR m2_l1
#define PM_ENDPT m1_i1
#define PM_PENDPT m1_i2
/*===========================================================================* /*===========================================================================*
* Messages for VM server * * Messages for VM server *
*===========================================================================*/ *===========================================================================*/
@ -847,7 +868,7 @@
# define VMUP_EP m1_i1 # define VMUP_EP m1_i1
# define VMUP_VADDR m1_p1 # define VMUP_VADDR m1_p1
#define VM_UNMAP (VM_RQ_BASE+17) #define VM_MUNMAP (VM_RQ_BASE+17)
# define VMUM_ADDR m1_p1 # define VMUM_ADDR m1_p1
# define VMUM_LEN m1_i1 # define VMUM_LEN m1_i1
@ -855,6 +876,8 @@
# define VMAM_BYTES m1_p1 # define VMAM_BYTES m1_p1
# define VMAM_MEMBASE m1_i1 # define VMAM_MEMBASE m1_i1
#define VM_MUNMAP_TEXT (VM_RQ_BASE+19)
/* Calls from VFS. */ /* Calls from VFS. */
# define VMV_ENDPOINT m1_i1 /* for all VM_VFS_REPLY_* */ # define VMV_ENDPOINT m1_i1 /* for all VM_VFS_REPLY_* */
#define VM_VFS_REPLY_OPEN (VM_RQ_BASE+30) #define VM_VFS_REPLY_OPEN (VM_RQ_BASE+30)
@ -862,7 +885,89 @@
#define VM_VFS_REPLY_MMAP (VM_RQ_BASE+31) #define VM_VFS_REPLY_MMAP (VM_RQ_BASE+31)
#define VM_VFS_REPLY_CLOSE (VM_RQ_BASE+32) #define VM_VFS_REPLY_CLOSE (VM_RQ_BASE+32)
#define VM_REMAP (VM_RQ_BASE+33)
# define VMRE_D m1_i1
# define VMRE_S m1_i2
# define VMRE_DA m1_p1
# define VMRE_SA m1_p2
# define VMRE_RETA m1_p3
# define VMRE_SIZE m1_i3
#define VM_SHM_UNMAP (VM_RQ_BASE+34)
# define VMUN_ENDPT m2_i1
# define VMUN_ADDR m2_l1
#define VM_GETPHYS (VM_RQ_BASE+35)
# define VMPHYS_ENDPT m2_i1
# define VMPHYS_ADDR m2_l1
# define VMPHYS_RETA m2_l2
#define VM_GETREF (VM_RQ_BASE+36)
# define VMREFCNT_ENDPT m2_i1
# define VMREFCNT_ADDR m2_l1
# define VMREFCNT_RETC m2_i2
#define VM_RS_SET_PRIV (VM_RQ_BASE+37)
# define VM_RS_NR m2_i1
# define VM_RS_BUF m2_l1
#define VM_QUERY_EXIT (VM_RQ_BASE+38)
# define VM_QUERY_RET_PT m2_i1
# define VM_QUERY_IS_MORE m2_i2
#define VM_NOTIFY_SIG (VM_RQ_BASE+39)
# define VM_NOTIFY_SIG_ENDPOINT m1_i1
# define VM_NOTIFY_SIG_IPC m1_i2
#define VM_CTL (VM_RQ_BASE+40)
#define VCTL_WHAT m1_i1
#define VCTL_PARAM m1_i2
/* VCTL_PARAMs */
#define VCTLP_STATS_MEM 1
#define VCTLP_STATS_EP 2
/* Total. */ /* Total. */
#define VM_NCALLS 33 #define VM_NCALLS 41
/*===========================================================================*
* Messages for IPC server *
*===========================================================================*/
#define IPC_BASE 0xD00
/* Shared Memory */
#define IPC_SHMGET (IPC_BASE+1)
# define SHMGET_KEY m2_l1
# define SHMGET_SIZE m2_l2
# define SHMGET_FLAG m2_i1
# define SHMGET_RETID m2_i2
#define IPC_SHMAT (IPC_BASE+2)
# define SHMAT_ID m2_i1
# define SHMAT_ADDR m2_l1
# define SHMAT_FLAG m2_i2
# define SHMAT_RETADDR m2_l2
#define IPC_SHMDT (IPC_BASE+3)
# define SHMDT_ADDR m2_l1
#define IPC_SHMCTL (IPC_BASE+4)
# define SHMCTL_ID m2_i1
# define SHMCTL_CMD m2_i2
# define SHMCTL_BUF m2_l1
# define SHMCTL_RET m2_i3
/* Semaphore */
#define IPC_SEMGET (IPC_BASE+5)
# define SEMGET_KEY m2_l1
# define SEMGET_NR m2_i1
# define SEMGET_FLAG m2_i2
# define SEMGET_RETID m2_i3
#define IPC_SEMCTL (IPC_BASE+6)
# define SEMCTL_ID m2_i1
# define SEMCTL_NUM m2_i2
# define SEMCTL_CMD m2_i3
# define SEMCTL_OPT m2_l1
#define IPC_SEMOP (IPC_BASE+7)
# define SEMOP_ID m2_i1
# define SEMOP_OPS m2_l1
# define SEMOP_SIZE m2_i2
#endif /* _MINIX_COM_H */ #endif /* _MINIX_COM_H */

View file

@ -3,7 +3,7 @@
/* Minix release and version numbers. */ /* Minix release and version numbers. */
#define OS_RELEASE "3" #define OS_RELEASE "3"
#define OS_VERSION "1.4" #define OS_VERSION "1.5"
/* This file sets configuration parameters for the MINIX kernel, FS, and PM. /* This file sets configuration parameters for the MINIX kernel, FS, and PM.
* It is divided up into two main sections. The first section contains * It is divided up into two main sections. The first section contains
@ -95,7 +95,4 @@
#define SPROFILE 1 /* statistical profiling */ #define SPROFILE 1 /* statistical profiling */
#define CPROFILE 0 /* call profiling */ #define CPROFILE 0 /* call profiling */
/* Compile kernel so that first page of code and data can be unmapped. */
#define VM_KERN_NOPAGEZERO 1
#endif /* _CONFIG_H */ #endif /* _CONFIG_H */

View file

@ -44,8 +44,6 @@
#define PHYS_SEG 0x0400 /* flag indicating entire physical memory */ #define PHYS_SEG 0x0400 /* flag indicating entire physical memory */
#define GRANT_SEG 0x0800 /* flag indicating grant for umap */
#define LOCAL_VM_SEG 0x1000 /* same as LOCAL_SEG, but with vm lookup */ #define LOCAL_VM_SEG 0x1000 /* same as LOCAL_SEG, but with vm lookup */
#define VM_D (LOCAL_VM_SEG | D) #define VM_D (LOCAL_VM_SEG | D)
#define VM_T (LOCAL_VM_SEG | T) #define VM_T (LOCAL_VM_SEG | T)

8
include/minix/crtso.h Executable file
View file

@ -0,0 +1,8 @@
/* Prototypes for crtso.s. */
#ifndef _MINIX_CRTSO_H
#define _MINIX_CRTSO_H
_PROTOTYPE( void _minix_unmapzero, (void));
#endif

13
include/minix/debug.h Normal file
View file

@ -0,0 +1,13 @@
#ifndef _MINIX_DEBUG_H
#define _MINIX_DEBUG_H 1
/* For reminders of things to be fixed. */
#define FIXME(str) { static int fixme_warned = 0; \
if(!fixme_warned) { \
printf("FIXME: %s:%d: %s\n", __FILE__, __LINE__, str);\
fixme_warned = 1; \
} \
}
#endif /* _MINIX_DEBUG_H */

View file

@ -34,5 +34,8 @@ _PROTOTYPE( int ds_retrieve_str, (char *name, char *val, size_t len));
_PROTOTYPE( int ds_check_u32, (char *n, size_t namelen, u32_t *val)); _PROTOTYPE( int ds_check_u32, (char *n, size_t namelen, u32_t *val));
_PROTOTYPE( int ds_check_str, (char *n, size_t namelen, char *v, size_t vlen)); _PROTOTYPE( int ds_check_str, (char *n, size_t namelen, char *v, size_t vlen));
/* lib/sysvipc/ds.c */
_PROTOTYPE( int mini_ds_retrieve_u32, (char *name, u32_t *val) );
#endif /* _MINIX_DS_H */ #endif /* _MINIX_DS_H */

View file

@ -15,7 +15,7 @@ _PROTOTYPE(void std_err, (char *_s));
_PROTOTYPE(void prints, (const char *_s, ...)); _PROTOTYPE(void prints, (const char *_s, ...));
_PROTOTYPE(int fsversion, (char *_dev, char *_prog)); _PROTOTYPE(int fsversion, (char *_dev, char *_prog));
_PROTOTYPE(int getprocessor, (void)); _PROTOTYPE(int getprocessor, (void));
_PROTOTYPE(int _cpuid, (u32_t eax_in, u32_t *eax, u32_t *ebx, u32_t *ecx, u32_t *edx)); _PROTOTYPE(void _cpuid, (u32_t eax_in, u32_t *eax, u32_t *ebx, u32_t *ecx, u32_t *edx));
_PROTOTYPE(int load_mtab, (char *_prog_name)); _PROTOTYPE(int load_mtab, (char *_prog_name));
_PROTOTYPE(int rewrite_mtab, (char *_prog_name)); _PROTOTYPE(int rewrite_mtab, (char *_prog_name));
_PROTOTYPE(int get_mtab_entry, (char *_s1, char *_s2, char *_s3, char *_s4)); _PROTOTYPE(int get_mtab_entry, (char *_s1, char *_s2, char *_s3, char *_s4));

View file

@ -4,6 +4,8 @@ minix/rs.h
Interface to the reincarnation server Interface to the reincarnation server
*/ */
#include <minix/bitmap.h>
#define RSS_NR_IRQ 16 #define RSS_NR_IRQ 16
#define RSS_NR_IO 16 #define RSS_NR_IO 16
#define RSS_NR_PCI_ID 16 #define RSS_NR_PCI_ID 16
@ -35,6 +37,8 @@ struct rs_start
size_t rss_labellen; size_t rss_labellen;
char *rss_ipc; char *rss_ipc;
size_t rss_ipclen; size_t rss_ipclen;
#define RSS_VM_CALL_SIZE BITMAP_CHUNKS(VM_NCALLS)
bitchunk_t rss_vm[RSS_VM_CALL_SIZE];
}; };
#define RF_COPY 0x01 /* Copy the brinary into RS to make it possible #define RF_COPY 0x01 /* Copy the brinary into RS to make it possible
@ -58,3 +62,5 @@ struct rs_pci
struct { u32_t class; u32_t mask; } rsp_class[RSP_NR_CLASS]; struct { u32_t class; u32_t mask; } rsp_class[RSP_NR_CLASS];
}; };
_PROTOTYPE( int minix_rs_lookup, (const char *name, endpoint_t *value));

View file

@ -35,7 +35,7 @@ _PROTOTYPE( int sys_enable_iop, (endpoint_t proc));
_PROTOTYPE( int sys_exec, (endpoint_t proc, char *ptr, _PROTOTYPE( int sys_exec, (endpoint_t proc, char *ptr,
char *aout, vir_bytes initpc)); char *aout, vir_bytes initpc));
_PROTOTYPE( int sys_fork, (endpoint_t parent, endpoint_t child, int *, _PROTOTYPE( int sys_fork, (endpoint_t parent, endpoint_t child, int *,
struct mem_map *ptr, u32_t vm)); struct mem_map *ptr, u32_t vm, vir_bytes *));
_PROTOTYPE( int sys_newmap, (endpoint_t proc, struct mem_map *ptr)); _PROTOTYPE( int sys_newmap, (endpoint_t proc, struct mem_map *ptr));
_PROTOTYPE( int sys_exit, (endpoint_t proc)); _PROTOTYPE( int sys_exit, (endpoint_t proc));
_PROTOTYPE( int sys_trace, (int req, endpoint_t proc, long addr, long *data_p)); _PROTOTYPE( int sys_trace, (int req, endpoint_t proc, long addr, long *data_p));
@ -53,9 +53,8 @@ _PROTOTYPE( int sys_vmctl, (endpoint_t who, int param, u32_t value));
_PROTOTYPE( int sys_vmctl_get_pagefault_i386, (endpoint_t *who, u32_t *cr2, u32_t *err)); _PROTOTYPE( int sys_vmctl_get_pagefault_i386, (endpoint_t *who, u32_t *cr2, u32_t *err));
_PROTOTYPE( int sys_vmctl_get_cr3_i386, (endpoint_t who, u32_t *cr3) ); _PROTOTYPE( int sys_vmctl_get_cr3_i386, (endpoint_t who, u32_t *cr3) );
_PROTOTYPE( int sys_vmctl_get_memreq, (endpoint_t *who, vir_bytes *mem, _PROTOTYPE( int sys_vmctl_get_memreq, (endpoint_t *who, vir_bytes *mem,
vir_bytes *len, int *wrflag) ); vir_bytes *len, int *wrflag, endpoint_t *) );
_PROTOTYPE( int sys_vmctl_enable_paging, (struct mem_map *));
_PROTOTYPE( int sys_readbios, (phys_bytes address, void *buf, size_t size)); _PROTOTYPE( int sys_readbios, (phys_bytes address, void *buf, size_t size));
_PROTOTYPE( int sys_stime, (time_t boottime)); _PROTOTYPE( int sys_stime, (time_t boottime));
@ -85,6 +84,7 @@ _PROTOTYPE(void *alloc_contig, (size_t len, int flags, phys_bytes *phys));
#define AC_ALIGN4K 0x01 #define AC_ALIGN4K 0x01
#define AC_LOWER16M 0x02 #define AC_LOWER16M 0x02
#define AC_ALIGN64K 0x04 #define AC_ALIGN64K 0x04
#define AC_LOWER1M 0x08
/* Clock functionality: get system times, (un)schedule an alarm call, or /* Clock functionality: get system times, (un)schedule an alarm call, or
* retrieve/set a process-virtual timer. * retrieve/set a process-virtual timer.
@ -167,8 +167,6 @@ _PROTOTYPE(int sys_segctl, (int *index, u16_t *seg, vir_bytes *off,
#define sys_getmonparams(v,vl) sys_getinfo(GET_MONPARAMS, v,vl, 0,0) #define sys_getmonparams(v,vl) sys_getinfo(GET_MONPARAMS, v,vl, 0,0)
#define sys_getschedinfo(v1,v2) sys_getinfo(GET_SCHEDINFO, v1,0, v2,0) #define sys_getschedinfo(v1,v2) sys_getinfo(GET_SCHEDINFO, v1,0, v2,0)
#define sys_getlocktimings(dst) sys_getinfo(GET_LOCKTIMING, dst, 0,0,0) #define sys_getlocktimings(dst) sys_getinfo(GET_LOCKTIMING, dst, 0,0,0)
#define sys_getbiosbuffer(virp, sizep) \
sys_getinfo(GET_BIOSBUFFER, virp, sizeof(*virp), sizep, sizeof(*sizep))
#define sys_getprivid(nr) sys_getinfo(GET_PRIVID, 0, 0,0, nr) #define sys_getprivid(nr) sys_getinfo(GET_PRIVID, 0, 0,0, nr)
_PROTOTYPE(int sys_getinfo, (int request, void *val_ptr, int val_len, _PROTOTYPE(int sys_getinfo, (int request, void *val_ptr, int val_len,
void *val_ptr2, int val_len2) ); void *val_ptr2, int val_len2) );

View file

@ -66,7 +66,7 @@ typedef struct {
} iovec_s_t; } iovec_s_t;
/* PM passes the address of a structure of this type to KERNEL when /* PM passes the address of a structure of this type to KERNEL when
* sys_sendsig() is invoked as part of the signal catching mechanism. * sys_sigsend() is invoked as part of the signal catching mechanism.
* The structure contain all the information that KERNEL needs to build * The structure contain all the information that KERNEL needs to build
* the signal stack. * the signal stack.
*/ */
@ -97,9 +97,6 @@ struct kinfo {
int nr_tasks; /* number of kernel tasks */ int nr_tasks; /* number of kernel tasks */
char release[6]; /* kernel release number */ char release[6]; /* kernel release number */
char version[6]; /* kernel version number */ char version[6]; /* kernel version number */
#if DEBUG_LOCK_CHECK
int relocking; /* interrupt locking depth (should be 0) */
#endif
}; };
/* Load data accounted every this no. of seconds. */ /* Load data accounted every this no. of seconds. */
@ -178,6 +175,7 @@ struct kmessages {
char km_buf[_KMESS_BUF_SIZE]; /* buffer for messages */ char km_buf[_KMESS_BUF_SIZE]; /* buffer for messages */
}; };
#include <minix/config.h>
#include <ibm/interrupt.h> #include <ibm/interrupt.h>
/* randomness struct: random sources after interrupts: */ /* randomness struct: random sources after interrupts: */

View file

@ -23,7 +23,10 @@ _PROTOTYPE( void *vm_map_phys, (endpoint_t who, void *physaddr, size_t len));
_PROTOTYPE( int vm_unmap_phys, (endpoint_t who, void *vaddr, size_t len)); _PROTOTYPE( int vm_unmap_phys, (endpoint_t who, void *vaddr, size_t len));
_PROTOTYPE( int vm_allocmem, (phys_clicks memclicks, phys_clicks *retmembase)); _PROTOTYPE( int vm_allocmem, (phys_clicks memclicks, phys_clicks *retmembase));
_PROTOTYPE( int vm_notify_sig, (endpoint_t ep, endpoint_t ipc_ep));
_PROTOTYPE( int vm_ctl, (int what, int param));
_PROTOTYPE( int vm_set_priv, (int procnr, void *buf));
_PROTOTYPE( int vm_query_exit, (int *endpt));
#endif /* _MINIX_VM_H */ #endif /* _MINIX_VM_H */

View file

@ -13,6 +13,7 @@ netinet/in.h
/* Open Group Base Specifications Issue 6 (not complete) */ /* Open Group Base Specifications Issue 6 (not complete) */
#define INADDR_ANY (uint32_t)0x00000000 #define INADDR_ANY (uint32_t)0x00000000
#define INADDR_BROADCAST (uint32_t)0xFFFFFFFF #define INADDR_BROADCAST (uint32_t)0xFFFFFFFF
#define INADDR_LOOPBACK (uint32_t)0x7F000001
#define IN_LOOPBACKNET 127 #define IN_LOOPBACKNET 127

42
include/sys/ipc.h Normal file
View file

@ -0,0 +1,42 @@
#ifndef _SYS_IPC_H
#define _SYS_IPC_H
/* For gid_t, uid_t */
#include <sys/types.h>
/* Mode bits for `msgget', `semget', and `shmget'. */
/* Create key if key does not exist. */
#define IPC_CREAT 01000
/* Fail if key exists. */
#define IPC_EXCL 02000
/* Return error on wait. */
#define IPC_NOWAIT 04000
/* Control commands for `msgctl', `semctl', and `shmctl'. */
/* Remove identifier. */
#define IPC_RMID 0
/* Set `ipc_perm' options. */
#define IPC_SET 1
/* Get `ipc_perm' options. */
#define IPC_STAT 2
#define IPC_INFO 3 /* See ipcs. */
/* Special key values. */
/* Private key. */
#define IPC_PRIVATE ((key_t) 0)
/* Data structure used to pass permission information to IPC operations. */
struct ipc_perm
{
key_t key; /* Key. */
uid_t uid; /* Owner's user ID. */
gid_t gid; /* Owner's group ID. */
uid_t cuid; /* Creator's user ID. */
gid_t cgid; /* Creator's group ID. */
unsigned short int mode; /* Reader/write permission. */
unsigned short int __seq; /* Sequence number. */
};
_PROTOTYPE( key_t ftok, (const char *__path, int __id));
#endif /* _SYS_IPC_H */

View file

@ -20,11 +20,17 @@
#define MAP_CONTIG 0x0010 /* contiguous in physical memory */ #define MAP_CONTIG 0x0010 /* contiguous in physical memory */
#define MAP_LOWER16M 0x0020 /* physically below 16MB */ #define MAP_LOWER16M 0x0020 /* physically below 16MB */
#define MAP_ALIGN64K 0x0040 /* physically aligned at 64kB */ #define MAP_ALIGN64K 0x0040 /* physically aligned at 64kB */
#define MAP_LOWER1M 0x0080 /* physically below 16MB */
/* mmap() error return */ /* mmap() error return */
#define MAP_FAILED ((void *)-1) #define MAP_FAILED ((void *)-1)
_PROTOTYPE( void *mmap, (void *, size_t, int, int, int, off_t)); _PROTOTYPE( void *mmap, (void *, size_t, int, int, int, off_t));
_PROTOTYPE( int munmap, (void *, size_t)); _PROTOTYPE( int munmap, (void *, size_t));
_PROTOTYPE( int munmap_text, (void *, size_t));
_PROTOTYPE( void *vm_remap, (int d, int s, void *da, void *sa, size_t si));
_PROTOTYPE( int vm_unmap, (int endpt, void *addr));
_PROTOTYPE( unsigned long vm_getphys, (int endpt, void *addr));
_PROTOTYPE( u8_t vm_getrefcount, (int endpt, void *addr));
#endif /* _MMAN_H */ #endif /* _MMAN_H */

81
include/sys/sem.h Normal file
View file

@ -0,0 +1,81 @@
#ifndef _SYS_SEM_H
#define _SYS_SEM_H
#include <sys/types.h>
#include <sys/ipc.h>
#define SEMMNI 128
#define SEMMSL 250
#define SEMMNS (SEMMSL*SEMMNI)
#define SEMOPM 32
#define SEMVMX 32767
/* Flags for `semop'. */
#define SEM_UNDO 0x1000 /* undo the operation on exit */
/* Commands for `semctl'. */
#define GETPID 11 /* get sempid */
#define GETVAL 12 /* get semval */
#define GETALL 13 /* get all semval's */
#define GETNCNT 14 /* get semncnt */
#define GETZCNT 15 /* get semzcnt */
#define SETVAL 16 /* set semval */
#define SETALL 17 /* set all semval's */
/* Data structure describing a set of semaphores. */
struct semid_ds
{
struct ipc_perm sem_perm; /* operation permission struct */
time_t sem_otime; /* last semop() time */
unsigned long int __unused1;
time_t sem_ctime; /* last time changed by semctl() */
unsigned long int __unused2;
unsigned long int sem_nsems; /* number of semaphores in set */
unsigned long int __unused3;
unsigned long int __unused4;
};
/* Structure used for argument to `semop' to describe operations. */
struct sembuf
{
unsigned short int sem_num; /* semaphore number */
short int sem_op; /* semaphore operation */
short int sem_flg; /* operation flag */
};
/* Semaphore control operation. */
_PROTOTYPE( int semctl, (int __semid, int __semnum, int __cmd, ...));
/* Get semaphore. */
_PROTOTYPE( int semget, (key_t __key, int __nsems, int __semflg));
/* Operate on semaphore. */
_PROTOTYPE( int semop, (int __semid, struct sembuf *__sops, size_t __nsops));
#ifdef __USE_MISC
/* ipcs ctl cmds */
# define SEM_STAT 18
# define SEM_INFO 19
struct seminfo
{
int semmap;
int semmni;
int semmns;
int semmnu;
int semmsl;
int semopm;
int semume;
int semusz;
int semvmx;
int semaem;
};
#endif /* __USE_MISC */
#endif /* _SYS_SEM_H */

77
include/sys/shm.h Normal file
View file

@ -0,0 +1,77 @@
#ifndef _SYS_SHM_H
#define _SYS_SHM_H
#include <sys/types.h>
#include <sys/ipc.h>
#include <unistd.h>
typedef unsigned long int shmatt_t;
#define SHMLBA getpagesize()
#define SHMMNI 4096
#define SHMSEG 32 /* max shared segs per process */
struct shmid_ds
{
struct ipc_perm shm_perm; /* Ownership and permissions */
size_t shm_segsz; /* Size of segment (bytes) */
time_t shm_atime; /* Last attach time */
time_t shm_dtime; /* Last detach time */
time_t shm_ctime; /* Last change time */
pid_t shm_cpid; /* PID of creator */
pid_t shm_lpid; /* PID of last shmat()/shmdt() */
shmatt_t shm_nattch; /* No. of current attaches */
};
/* Permission flag for shmget. */
#define SHM_R 0400
#define SHM_W 0200
#define SHM_RDONLY 010000 /* attach read-only else read-write */
#define SHM_RND 020000 /* round attach address to SHMLBA */
/* shm_mode upper byte flags */
#define SHM_DEST 01000 /* segment will be destroyed on last detach */
#define SHM_LOCKED 02000 /* segment will not be swapped */
/* ipcs ctl commands */
#define SHM_STAT 13
#define SHM_INFO 14
struct shminfo
{
unsigned long int shmmax;
unsigned long int shmmin;
unsigned long int shmmni;
unsigned long int shmseg;
unsigned long int shmall;
};
struct shm_info
{
int used_ids;
unsigned long int shm_tot; /* total allocated shm */
unsigned long int shm_rss; /* total resident shm */
unsigned long int shm_swp; /* total swapped shm */
unsigned long int swap_attempts;
unsigned long int swap_successes;
};
/* The following System V style IPC functions implement a shared memory
* facility. The definition is found in XPG4.2.
*/
/* Shared memory control operation. */
_PROTOTYPE( int shmctl, (int __shmid, int __cmd, struct shmid_ds *__buf));
/* Get shared memory segment. */
_PROTOTYPE( int shmget, (key_t __key, size_t __size, int __shmflg));
/* Attach shared memory segment. */
_PROTOTYPE( void *shmat, (int __shmid, const void *__shmaddr, int __shmflg));
/* Deattach shared memory segment. */
_PROTOTYPE( int shmdt, (const void *__shmaddr));
#endif /* _SYS_SHM_H */

2
include/sys/signal.h Normal file
View file

@ -0,0 +1,2 @@
#include <signal.h>

18
include/sys/timeb.h Normal file
View file

@ -0,0 +1,18 @@
#ifndef _SYS__TIMEB_H
#define _SYS__TIMEB_H
#include <time.h>
struct timeb
{
time_t time; /* Seconds since epoch, as from `time'. */
unsigned short int millitm; /* Additional milliseconds. */
short int timezone; /* Minutes west of GMT. */
short int dstflag; /* Nonzero if Daylight Savings Time used. */
};
/* Fill in TIMEBUF with information about the current time. */
_PROTOTYPE( int ftime, (struct timeb *__timebuf));
#endif /* _SYS__TIMEB_H */

View file

@ -43,6 +43,11 @@ typedef long clock_t; /* unit for system accounting */
typedef unsigned long sigset_t; typedef unsigned long sigset_t;
#endif #endif
#ifndef _KEY_T
#define _KEY_T
typedef long key_t;
#endif
/* Open Group Base Specifications Issue 6 (not complete) */ /* Open Group Base Specifications Issue 6 (not complete) */
typedef long useconds_t; /* Time in microseconds */ typedef long useconds_t; /* Time in microseconds */

View file

@ -16,6 +16,7 @@ sys/vm_i386.h
#define I386_VM_ACC 0x020 /* Accessed */ #define I386_VM_ACC 0x020 /* Accessed */
#define I386_VM_ADDR_MASK 0xFFFFF000 /* physical address */ #define I386_VM_ADDR_MASK 0xFFFFF000 /* physical address */
#define I386_VM_ADDR_MASK_4MB 0xFFC00000 /* physical address */ #define I386_VM_ADDR_MASK_4MB 0xFFC00000 /* physical address */
#define I386_VM_OFFSET_MASK_4MB 0x003FFFFF /* physical address */
/* Page directory specific flags. */ /* Page directory specific flags. */
#define I386_VM_BIGPAGE 0x080 /* 4MB page */ #define I386_VM_BIGPAGE 0x080 /* 4MB page */
@ -37,6 +38,12 @@ sys/vm_i386.h
#define I386_VM_PFA_SHIFT 22 /* Page frame address shift */ #define I386_VM_PFA_SHIFT 22 /* Page frame address shift */
/* CR0 bits */ /* CR0 bits */
#define I386_CR0_PE 0x00000001 /* Protected mode */
#define I386_CR0_MP 0x00000002 /* Monitor Coprocessor */
#define I386_CR0_EM 0x00000004 /* Emulate */
#define I386_CR0_TS 0x00000008 /* Task Switched */
#define I386_CR0_ET 0x00000010 /* Extension Type */
#define I386_CR0_WP 0x00010000 /* Enable paging */
#define I386_CR0_PG 0x80000000 /* Enable paging */ #define I386_CR0_PG 0x80000000 /* Enable paging */
/* some CR4 bits */ /* some CR4 bits */

View file

@ -89,6 +89,7 @@
#define LOG_CONS 0x02 /* log on the console if errors in sending */ #define LOG_CONS 0x02 /* log on the console if errors in sending */
#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */ #define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
#define LOG_NDELAY 0x08 /* don't delay open */ #define LOG_NDELAY 0x08 /* don't delay open */
#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
#define LOG_PERROR 0x20 /* log to stderr as well */ #define LOG_PERROR 0x20 /* log to stderr as well */
void closelog(void); void closelog(void);

View file

@ -121,6 +121,8 @@ _PROTOTYPE( char *getlogin, (void) );
_PROTOTYPE( pid_t getpgrp, (void) ); _PROTOTYPE( pid_t getpgrp, (void) );
_PROTOTYPE( pid_t getpid, (void) ); _PROTOTYPE( pid_t getpid, (void) );
_PROTOTYPE( pid_t getnpid, (int proc_nr) ); _PROTOTYPE( pid_t getnpid, (int proc_nr) );
_PROTOTYPE( uid_t getnuid, (int proc_nr) );
_PROTOTYPE( gid_t getngid, (int proc_nr) );
_PROTOTYPE( pid_t getppid, (void) ); _PROTOTYPE( pid_t getppid, (void) );
_PROTOTYPE( uid_t getuid, (void) ); _PROTOTYPE( uid_t getuid, (void) );
_PROTOTYPE( int isatty, (int _fd) ); _PROTOTYPE( int isatty, (int _fd) );