|
|
1.1 ! root 1: /* (-lgl ! 2: * COHERENT Version 4.0 ! 3: * Copyright (c) 1982, 1992 by Mark Williams Company. ! 4: * All rights reserved. May not be copied without permission. ! 5: -lgl) */ ! 6: /* ! 7: * /usr/include/sys/seg.h ! 8: * ! 9: * Segments. ! 10: * ! 11: * Revised: Mon May 24 15:50:18 1993 CDT ! 12: */ ! 13: ! 14: #ifndef __SYS_SEG_H__ ! 15: #define __SYS_SEG_H__ ! 16: ! 17: #include <sys/__paddr.h> ! 18: #include <sys/types.h> ! 19: #include <sys/ksynch.h> ! 20: ! 21: ! 22: /* ! 23: * NIGEL: for some reason the type "cseg_t" was in <sys/types.h>. It belongs ! 24: * here and in <sys/mmu.h> as much as it belongs anywhere. ! 25: */ ! 26: ! 27: #ifndef __CSEG_T ! 28: #define __CSEG_T ! 29: typedef long cseg_t; ! 30: #endif ! 31: ! 32: /* ! 33: * Segment structure. ! 34: */ ! 35: typedef struct seg { ! 36: struct seg * s_forw; /* Forward pointer */ ! 37: struct seg * s_back; /* Backward pointer */ ! 38: struct inode * s_ip; /* Inode pointer for shared text */ ! 39: short s_flags; /* Flags */ ! 40: short s_urefc; /* Reference count of segment */ ! 41: short s_lrefc; /* Lock reference count */ ! 42: #ifdef _I386 ! 43: off_t s_size; /* Size in bytes */ ! 44: cseg_t *s_vmem; /* page table address */ ! 45: #else ! 46: faddr_t s_faddr; /* Memory access selector */ ! 47: fsize_t s_size; /* Size in bytes */ ! 48: __paddr_t s_paddr; /* Physical base address */ ! 49: #endif ! 50: daddr_t s_daddr; /* Disk base address */ ! 51: } SEG; ! 52: ! 53: /* ! 54: * Flags (s_flags). ! 55: */ ! 56: #define SFCORE 0x0001 /* Memory resident */ ! 57: #define SFDOWN 0x0002 /* Segment grows downward */ ! 58: #define SFSHRX 0x0004 /* Shared segment */ ! 59: #define SFTEXT 0x0008 /* Text segment */ ! 60: #define SFHIGH 0x0010 /* Text segment */ ! 61: #define SFSYST 0x0020 /* System segment */ ! 62: ! 63: /* ! 64: * Pseudo flags. (passed to salloc). ! 65: */ ! 66: #define SFNSWP 0x4000 /* Don't swap */ ! 67: #define SFNCLR 0x8000 /* Don't clear segment */ ! 68: ! 69: #ifdef KERNEL ! 70: /* ! 71: * Functions. ! 72: */ ! 73: extern SEG *iomapvp(); /* bio.c */ ! 74: extern SEG *segdupl(); /* seg.c */ ! 75: extern SEG *ssalloc(); /* seg.c */ ! 76: extern SEG *salloc(); /* seg.c */ ! 77: extern SEG *segsext(); /* seg.c */ ! 78: extern SEG *segdupd(); /* seg.c */ ! 79: extern SEG *sdalloc(); /* seg.c */ ! 80: extern SEG *smalloc(); /* seg.c */ ! 81: extern SEG *shalloc(); /* seg.c */ ! 82: extern SEG *exaread(); /* exec.c */ ! 83: extern SEG *exsread(); /* exec.c */ ! 84: extern SEG *exstack(); /* exec.c */ ! 85: ! 86: /* ! 87: * Global variables. ! 88: */ ! 89: extern int sexflag; /* Swapper existant */ ! 90: extern GATE seglink; /* Gate for s_forw and s_back */ ! 91: extern SEG segswap; /* Segments reserved for the swapper */ ! 92: extern SEG segmq; /* Memory segment queue */ ! 93: extern SEG segdq; /* Segment disk queue */ ! 94: extern SEG segiom; /* I/O memory segment */ ! 95: ! 96: #endif ! 97: ! 98: /* ! 99: * Open segment structure. ! 100: */ ! 101: typedef struct sr { ! 102: int sr_flag; /* Flags for this reference */ ! 103: caddr_t sr_base; /* Virtual address base */ ! 104: #ifdef _I386 ! 105: off_t sr_size; /* Mapped in window size */ ! 106: #else ! 107: vaddr_t sr_size; /* Mapped in window size */ ! 108: #endif ! 109: struct seg *sr_segp; /* Segment pointer */ ! 110: } SR; ! 111: ! 112: /* ! 113: * Flags (sr_flag). ! 114: */ ! 115: #define SRFPMAP 0x01 /* Segment is mapped in process */ ! 116: #define SRFDUMP 0x02 /* Dump segment */ ! 117: #define SRFDATA 0x04 /* Data segment */ ! 118: #define SRFRODT 0x08 /* Data, read-only (used by shm) */ ! 119: #define SRFBERM 0x10 /* Segment to be removed (used by shm) */ ! 120: ! 121: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.