From 4fa4590156d96fd0c9c8a054e2e6cf7799b86535 Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Wed, 5 Dec 1990 23:52:51 -0800 Subject: [PATCH] update for new VM SCCS-vsn: sys/sys/malloc.h 7.19 SCCS-vsn: sys/sys/mbuf.h 7.14 SCCS-vsn: sys/sys/mman.h 7.2 SCCS-vsn: sys/sys/msgbuf.h 7.4 SCCS-vsn: sys/sys/param.h 7.18 SCCS-vsn: sys/sys/proc.h 7.22 SCCS-vsn: sys/sys/systm.h 7.9 SCCS-vsn: sys/sys/vnode.h 7.31 --- usr/src/sys/sys/malloc.h | 4 +-- usr/src/sys/sys/mbuf.h | 13 +++++----- usr/src/sys/sys/mman.h | 53 +++++++++++++++++++++++++++++----------- usr/src/sys/sys/msgbuf.h | 4 +-- usr/src/sys/sys/param.h | 3 ++- usr/src/sys/sys/proc.h | 18 ++++++-------- usr/src/sys/sys/systm.h | 4 +-- usr/src/sys/sys/vnode.h | 6 ++--- 8 files changed, 63 insertions(+), 42 deletions(-) diff --git a/usr/src/sys/sys/malloc.h b/usr/src/sys/sys/malloc.h index 4d301674df..4d72787187 100644 --- a/usr/src/sys/sys/malloc.h +++ b/usr/src/sys/sys/malloc.h @@ -4,7 +4,7 @@ * * %sccs.include.redist.c% * - * @(#)malloc.h 7.18 (Berkeley) %G% + * @(#)malloc.h 7.19 (Berkeley) %G% */ #define KMEMSTATS @@ -220,7 +220,7 @@ struct kmembuckets { extern struct kmemstats kmemstats[]; extern struct kmemusage *kmemusage; -extern char kmembase[]; +extern char *kmembase; extern struct kmembuckets bucket[]; extern qaddr_t malloc(); extern void free(); diff --git a/usr/src/sys/sys/mbuf.h b/usr/src/sys/sys/mbuf.h index 4cd0deb475..1fc7d85aa4 100644 --- a/usr/src/sys/sys/mbuf.h +++ b/usr/src/sys/sys/mbuf.h @@ -3,7 +3,7 @@ * * %sccs.include.redist.c% * - * @(#)mbuf.h 7.13 (Berkeley) %G% + * @(#)mbuf.h 7.14 (Berkeley) %G% */ #ifndef M_WAITOK @@ -32,9 +32,9 @@ * cltom(x) - convert cluster # to ptr to beginning of cluster */ #define mtod(m,t) ((t)((m)->m_data)) -#define dtom(x) ((struct mbuf *)((int)x & ~(MSIZE-1))) -#define mtocl(x) (((u_int)x - (u_int)mbutl) >> MCLSHIFT) -#define cltom(x) ((caddr_t)mbutl[x]) +#define dtom(x) ((struct mbuf *)((int)(x) & ~(MSIZE-1))) +#define mtocl(x) (((u_int)(x) - (u_int)mbutl) >> MCLSHIFT) +#define cltom(x) ((caddr_t)((u_int)mbutl + ((u_int)(x) >> MCLSHIFT))) /* header at beginning of each mbuf: */ struct m_hdr { @@ -315,12 +315,11 @@ struct mbstat { }; #ifdef KERNEL -extern char mbutl[][MCLBYTES]; /* virtual address of mclusters */ -extern struct pte Mbmap[]; /* page tables to map mbutl */ +extern struct mbuf *mbutl; /* virtual address of mclusters */ +extern char *mclrefcnt; /* cluster reference counts */ struct mbstat mbstat; int nmbclusters; union mcluster *mclfree; -char mclrefcnt[NMBCLUSTERS + CLBYTES/MCLBYTES]; int max_linkhdr; /* largest link-level header */ int max_protohdr; /* largest protocol header */ int max_hdr; /* largest link+protocol header */ diff --git a/usr/src/sys/sys/mman.h b/usr/src/sys/sys/mman.h index ecfae7718e..b9c0aa8699 100644 --- a/usr/src/sys/sys/mman.h +++ b/usr/src/sys/sys/mman.h @@ -3,21 +3,46 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)mman.h 7.1 (Berkeley) %G% + * %sccs.include.redist.c% + * + * @(#)mman.h 7.2 (Berkeley) %G% */ -/* protections are chosen from these bits, or-ed together */ -#define PROT_READ 0x1 /* pages can be read */ -#define PROT_WRITE 0x2 /* pages can be written */ -#define PROT_EXEC 0x4 /* pages can be executed */ +/* + * Protections are chosen from these bits, or-ed together + */ +#define PROT_READ 0x04 /* pages can be read */ +#define PROT_WRITE 0x02 /* pages can be written */ +#define PROT_EXEC 0x01 /* pages can be executed */ -/* sharing types: choose either SHARED or PRIVATE */ -#define MAP_SHARED 1 /* share changes */ -#define MAP_PRIVATE 2 /* changes are private */ +/* + * Flags contain mapping type, sharing type and options. + * Mapping type; choose one + */ +#define MAP_FILE 0x0001 /* mapped from a file or device */ +#define MAP_ANON 0x0002 /* allocated from memory, swap space */ +#define MAP_TYPE 0x000f /* mask for type field */ -/* advice to madvise */ -#define MADV_NORMAL 0 /* no further special treatment */ -#define MADV_RANDOM 1 /* expect random page references */ -#define MADV_SEQUENTIAL 2 /* expect sequential page references */ -#define MADV_WILLNEED 3 /* will need these pages */ -#define MADV_DONTNEED 4 /* dont need these pages */ +/* + * Sharing types; choose one + */ +#define MAP_COPY 0x0020 /* "copy" region at mmap time */ +#define MAP_SHARED 0x0010 /* share changes */ +#define MAP_PRIVATE 0x0000 /* changes are private */ + +/* + * Other flags + */ +#define MAP_FIXED 0x0100 /* map addr must be exactly as requested */ +#define MAP_NOEXTEND 0x0200 /* for MAP_FILE, don't change file size */ +#define MAP_HASSEMPHORE 0x0400 /* region may contain semaphores */ +#define MAP_INHERIT 0x0800 /* region is retained after exec */ + +/* + * Advice to madvise + */ +#define MADV_NORMAL 0 /* no further special treatment */ +#define MADV_RANDOM 1 /* expect random page references */ +#define MADV_SEQUENTIAL 2 /* expect sequential page references */ +#define MADV_WILLNEED 3 /* will need these pages */ +#define MADV_DONTNEED 4 /* dont need these pages */ diff --git a/usr/src/sys/sys/msgbuf.h b/usr/src/sys/sys/msgbuf.h index a414b4dcbd..2ac826a43f 100644 --- a/usr/src/sys/sys/msgbuf.h +++ b/usr/src/sys/sys/msgbuf.h @@ -4,7 +4,7 @@ * * %sccs.include.redist.c% * - * @(#)msgbuf.h 7.3 (Berkeley) %G% + * @(#)msgbuf.h 7.4 (Berkeley) %G% */ #define MSG_MAGIC 0x063061 @@ -16,5 +16,5 @@ struct msgbuf { char msg_bufc[MSG_BSIZE]; }; #ifdef KERNEL -struct msgbuf msgbuf; +struct msgbuf *msgbufp; #endif diff --git a/usr/src/sys/sys/param.h b/usr/src/sys/sys/param.h index a854e01d5c..27ff9c4c47 100644 --- a/usr/src/sys/sys/param.h +++ b/usr/src/sys/sys/param.h @@ -3,7 +3,7 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)param.h 7.17 (Berkeley) %G% + * @(#)param.h 7.18 (Berkeley) %G% */ #define BSD 199006 /* June, 1990 system version (year & month) */ @@ -32,6 +32,7 @@ * Priorities */ #define PSWP 0 +#define PVM 1 #define PINOD 10 #define PRIBIO 20 #define PVFS 22 diff --git a/usr/src/sys/sys/proc.h b/usr/src/sys/sys/proc.h index c39bdeca31..1e350fca74 100644 --- a/usr/src/sys/sys/proc.h +++ b/usr/src/sys/sys/proc.h @@ -3,7 +3,7 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)proc.h 7.21 (Berkeley) %G% + * @(#)proc.h 7.22 (Berkeley) %G% */ /* @@ -41,7 +41,7 @@ struct proc { struct proc *p_rlink; struct proc *p_nxt; /* linked list of allocated proc slots */ struct proc **p_prev; /* also zombies, and free proc's */ - struct pte *p_addr; /* u-area kernel map address */ + caddr_t p_addr; /* kernel virtual address of u-area */ char p_usrpri; /* user-priority based on p_cpu and p_nice */ char p_pri; /* priority, negative is high */ char p_cpu; /* cpu usage for scheduling */ @@ -64,20 +64,16 @@ struct proc { pid_t p_ppid; /* process id of parent */ u_short p_xstat; /* Exit status for wait; also stop signal */ struct rusage *p_ru; /* exit information */ - short p_poip; /* page outs in progress */ - short p_szpt; /* copy of page table size */ - segsz_t p_tsize; /* size of text (clicks) */ - segsz_t p_dsize; /* size of data space (clicks) */ - segsz_t p_mmsize; /* size of mapmem beyond p_dsize (clicks) */ - segsz_t p_ssize; /* copy of stack size (clicks) */ + struct vm_map *p_map; /* VM address map */ + caddr_t p_shm; /* SYS5 shared memory private data */ + int p_thread; /* id for this "thread" (Mach glue) XXX */ + int p_pad1[2]; segsz_t p_rssize; /* current resident set size in clicks */ segsz_t p_maxrss; /* copy of u.u_limit[MAXRSS] */ segsz_t p_swrss; /* resident set size before last swap */ swblk_t p_swaddr; /* disk address of u area when swapped */ caddr_t p_wchan; /* event process is awaiting */ - struct text *p_textp; /* pointer to text structure */ - struct pte *p_p0br; /* page table base P0BR */ - struct proc *p_xlink; /* linked list of procs sharing same text */ + int pad2[3]; int p_cpticks; /* ticks of cpu time */ fixpt_t p_pctcpu; /* %cpu for this process during p_time */ short p_ndx; /* proc index for memall (because of vfork) */ diff --git a/usr/src/sys/sys/systm.h b/usr/src/sys/sys/systm.h index aee1b1b51f..1bcd633824 100644 --- a/usr/src/sys/sys/systm.h +++ b/usr/src/sys/sys/systm.h @@ -3,7 +3,7 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)systm.h 7.8 (Berkeley) %G% + * @(#)systm.h 7.9 (Berkeley) %G% */ /* @@ -73,7 +73,7 @@ char *bootesym; /* end of symbol info from boot */ #endif int selwait; -extern char vmmap[]; /* poor name! */ +extern char *vmmap; /* poor name! */ /* casts to keep lint happy */ #define insque(q,p) _insque((caddr_t)q,(caddr_t)p) diff --git a/usr/src/sys/sys/vnode.h b/usr/src/sys/sys/vnode.h index 4d164bc992..715d9ca628 100644 --- a/usr/src/sys/sys/vnode.h +++ b/usr/src/sys/sys/vnode.h @@ -4,7 +4,7 @@ * * %sccs.include.redist.c% * - * @(#)vnode.h 7.30 (Berkeley) %G% + * @(#)vnode.h 7.31 (Berkeley) %G% */ #include @@ -56,7 +56,7 @@ struct vnode { union { struct mount *vu_mountedhere;/* ptr to mounted vfs (VDIR) */ struct socket *vu_socket; /* unix ipc (VSOCK) */ - struct text *vu_text; /* text/mapped region (VREG) */ + caddr_t vu_vmdata; /* private data for vm */ struct specinfo *vu_specinfo; /* device (VCHR, VBLK) */ struct fifoinfo *vu_fifoinfo; /* fifo (VFIFO) */ } v_un; @@ -65,7 +65,7 @@ struct vnode { }; #define v_mountedhere v_un.vu_mountedhere #define v_socket v_un.vu_socket -#define v_text v_un.vu_text +#define v_vmdata v_un.vu_vmdata #define v_specinfo v_un.vu_specinfo #define v_fifoinfo v_un.vu_fifoinfo -- 2.20.1