- 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:
42
include/sys/ipc.h
Normal file
42
include/sys/ipc.h
Normal 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 */
|
||||
@@ -20,11 +20,17 @@
|
||||
#define MAP_CONTIG 0x0010 /* contiguous in physical memory */
|
||||
#define MAP_LOWER16M 0x0020 /* physically below 16MB */
|
||||
#define MAP_ALIGN64K 0x0040 /* physically aligned at 64kB */
|
||||
#define MAP_LOWER1M 0x0080 /* physically below 16MB */
|
||||
|
||||
/* mmap() error return */
|
||||
#define MAP_FAILED ((void *)-1)
|
||||
|
||||
_PROTOTYPE( void *mmap, (void *, size_t, int, int, int, off_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 */
|
||||
|
||||
81
include/sys/sem.h
Normal file
81
include/sys/sem.h
Normal 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
77
include/sys/shm.h
Normal 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
2
include/sys/signal.h
Normal file
@@ -0,0 +1,2 @@
|
||||
#include <signal.h>
|
||||
|
||||
18
include/sys/timeb.h
Normal file
18
include/sys/timeb.h
Normal 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 */
|
||||
@@ -43,6 +43,11 @@ typedef long clock_t; /* unit for system accounting */
|
||||
typedef unsigned long sigset_t;
|
||||
#endif
|
||||
|
||||
#ifndef _KEY_T
|
||||
#define _KEY_T
|
||||
typedef long key_t;
|
||||
#endif
|
||||
|
||||
/* Open Group Base Specifications Issue 6 (not complete) */
|
||||
typedef long useconds_t; /* Time in microseconds */
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ sys/vm_i386.h
|
||||
#define I386_VM_ACC 0x020 /* Accessed */
|
||||
#define I386_VM_ADDR_MASK 0xFFFFF000 /* physical address */
|
||||
#define I386_VM_ADDR_MASK_4MB 0xFFC00000 /* physical address */
|
||||
#define I386_VM_OFFSET_MASK_4MB 0x003FFFFF /* physical address */
|
||||
|
||||
/* Page directory specific flags. */
|
||||
#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 */
|
||||
|
||||
/* 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 */
|
||||
|
||||
/* some CR4 bits */
|
||||
|
||||
Reference in New Issue
Block a user