|
|
DataMuseum.dkPresents historical artifacts from the history of: Regnecentalen RC-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Regnecentalen RC-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T U s
Length: 10164 (0x27b4)
Types: TextFile
Notes: UNIX file
Names: »space.c«
└─⟦22cab2c1b⟧ Bits:30004042/kcaddon.imd SW95705I 386/ix Multi-user Release 1.2
└─⟦22cab2c1b⟧ UNIX Filesystem
└─⟦this⟧ »KC/new/etc/atconf/modules/kernel/space.c«
/* Copyright (c) 1984 AT&T */
/* All Rights Reserved */
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
/* The copyright notice above does not evidence any */
/* actual or intended publication of such source code. */
/* 87.07.23 l_init, cseminit, imcinit */
/* 87.12.17 v.1.16 (cdlimit) */
/* 88.06.01 v.1.18 (machenv,VIANET) */
#ident "@(#)space.c 1.24 - 88/07/15"
#define BUFDEFINE
#include "sys/types.h"
#include "sys/param.h"
#include "sys/buf.h"
#include "sys/immu.h"
#include "sys/region.h"
#include "sys/map.h"
#include "sys/proc.h"
#include "sys/inode.h"
#include "sys/fs/s5inode.h"
#include "sys/file.h"
#include "sys/callo.h"
#include "sys/var.h"
#include "sys/mount.h"
#include "sys/swap.h"
#include "sys/tuneable.h"
#include "sys/fcntl.h"
#include "sys/flock.h"
#include "sys/sysinfo.h"
#include "sys/tty.h"
#include "sys/conf.h"
#include "sys/utsname.h"
#include "sys/sema.h"
#include "sys/acct.h"
#include "sys/pfdat.h"
#include "sys/weitek.h"
#include "sys/stream.h"
#ifdef AT386
#include "sys/machenv.h"
#endif
#include "sys/kdef.h" /* SPECIAL CASE: kernel #defines are put in a sys
include file so other modules can access them */
#include "config.h" /* to override parameters in kdef.h */
/*
* Tables and initializations
*/
extern int cinit(),
binit(),
inoinit(),
fsinit(),
finit(),
iinit(),
flckinit(),
seminit(),
msginit(),
strinit(),
l_init(),
bbu_init(),
tciinit(),
cseminit(),
imcinit();
int (*init_tbl[])() = {
cinit,
binit,
inoinit,
fsinit,
finit,
iinit,
flckinit,
seminit,
msginit,
l_init,
bbu_init,
tciinit,
cseminit,
imcinit,
#ifndef NOSTREAMS
strinit,
#endif
0,
};
struct buf buf[NBUF];
char buffers[(NBUF+1)][1024];
struct buf pbuf[NPBUF];
struct hbuf hbuf[NHBUF];
struct file file[NFILE];
struct inode inode[NINODE];
struct s5inode s5inode[NS5INODE];
struct proc proc[NPROC];
struct region region[NREGION];
struct callo callout[NCALL];
struct mount mount[NMOUNT];
struct map sptmap[SPTMAP];
char putbuf[PUTBUFSZ];
int putbufsz = PUTBUFSZ;
struct var v = {
NBUF,
NCALL,
NINODE,
(char *)(&inode[NINODE]),
NFILE,
(char *)(&file[NFILE]),
NMOUNT,
(char *)(&mount[NMOUNT]),
NPROC,
(char *)(&proc[NPROC]),
NREGION,
NCLIST,
MAXUP,
NHBUF,
NHBUF-1,
NPBUF,
SPTMAP,
VHNDFRAC,
MAXPMEM,
NAUTOUP,
NOFILES,
NQUEUE,
NSTREAM,
NBLK4096,
NBLK2048,
NBLK1024,
NBLK512,
NBLK256,
NBLK128,
NBLK64,
NBLK16,
NBLK4,
NS5INODE,
};
struct tune tune = {
GPGSLO,
GPGSHI,
GPGSMSK,
VHANDR,
VHANDL,
MAXSC,
MAXFC,
MAXUMEM,
BDFLUSHR,
MINARMEM,
MINASMEM
};
struct flckinfo flckinfo = {FLCKREC};
struct filock flox[FLCKREC];
struct shlbinfo shlbinfo = {SHLBMAX, 0, 0};
struct utsname utsname = {
SYS,
NODE,
REL,
VER,
MACH
};
/* Line Discipline Switch Table
* order: open close read write ioctl rxint txint modemint
*/
extern int ttopen(),
ttclose(),
ttread(),
ttwrite(),
ttioctl(),
ttin(),
ttout(),
#ifdef AT386
iccttout(),
#endif /* AT386 */
nulldev(),
xtin(),
xtout(),
sxtin(),
sxtout();
struct linesw linesw[] = {
/* tty ------------- */
ttopen,
ttclose,
ttread,
ttwrite,
ttioctl,
ttin,
ttout,
nulldev,
/* xt ------------- */
nulldev,
nulldev,
nulldev,
nulldev,
nulldev,
xtin,
xtout,
nulldev,
/* sxt -------------*/
nulldev,
nulldev,
nulldev,
nulldev,
nulldev,
sxtin,
sxtout,
nulldev,
#ifdef AT386
/* icc -------------*/
ttopen,
ttclose,
ttread,
ttwrite,
ttioctl,
ttin,
iccttout,
nulldev,
};
int linecnt = {4};
#else
};
int linecnt = {3};
#endif
#ifdef AT386
struct machenv machenv = {0};
#endif
/* STREAMS */
struct queue queue[NQUEUE];
struct stdata streams[NSTREAM];
mblk_t mblock[NBLK4096+NBLK2048+NBLK1024+NBLK512+NBLK256+NBLK128+NBLK64+NBLK16+NBLK4 + ((NBLK4096+NBLK2048+NBLK1024+NBLK512+NBLK256+NBLK128+NBLK64+NBLK16+NBLK4)/4)];
dblk_t dblock[NBLK4096+NBLK2048+NBLK1024+NBLK512+NBLK256+NBLK128+NBLK64+NBLK16+NBLK4];
struct linkblk linkblk[NMUXLINK];
int nmuxlink = {NMUXLINK};
int nstrpush = {NSTRPUSH};
struct strevent strevent[NSTREVENT];
int nstrevent = {NSTREVENT};
int maxsepgcnt = {MAXSEPGCNT};
int strmsgsz = {STRMSGSZ};
int strctlsz = {STRCTLSZ};
strlofrac = {STRLOFRAC};
strmedfrac = {STRMEDFRAC};
int nmblock = {NBLK4096+NBLK2048+NBLK1024+NBLK512+NBLK256+NBLK128+NBLK64+NBLK16+NBLK4 + ((NBLK4096+NBLK2048+NBLK1024+NBLK512+NBLK256+NBLK128+NBLK64+NBLK16+NBLK4)/4)};
/* DU */
int remote_acct; /* REMOTE flag for acctp */
int bootstate; /* DU boot flag */
short dufstyp; /* DU file system switch index */
struct srmnt srmount[NSRMOUNT];
int nsrmount = {NSRMOUNT};
int nservers = {0};
int idleserver = {0};
int msglistcnt = {0};
struct dinfo dinfo; /* DU perf stat's */
struct acct acctbuf;
struct inode *acctp;
struct buf *sbuf; /* Start of buffer headers */
struct buf bfreelist; /* Head of the free list of buffers */
struct pfree pfreelist; /* Head of physio buffer headers */
int pfreecnt; /* Count of free physio buffers. */
struct inode *rootdir; /* Inode for root directory. */
int nptalloced; /* Total number of page tables allocated. */
int nptfree; /* Number of free page tables. */
reg_t ractive;
reg_t rfree;
reg_t sysreg;
proc_t *runq; /* Head of linked list of running procs. */
proc_t *curproc = 0; /* The currently running proc. */
proc_t *oldproc; /* The previous proc, if it exited. */
int curpri; /* Priority of currently running proc. */
struct pfdat phead; /* Head of free page list. */
struct pfdat *pfdat; /* Page frame database. */
struct pfdat **phash; /* Page hash access to pfdat. */
struct pfdat ptfree; /* Head of page table free list. */
int phashmask; /* Page hash mask. */
struct sysinfo sysinfo;
struct syswait syswait;
struct syserr syserr;
struct minfo minfo;
swpt_t swaptab[MSFILES];
int nextswap;
daddr_t swplo = 0;
daddr_t nswap; /* set by disk driver when mounting root fs to size of swap */
/* Each process has 3 pregions (text, data, and stack) plus
* enough for the maximum number of shared memory segments.
* We also need one extra null pregion to indicate the end
* of the list. The maximum number of shared memory segments
* will be added in reginit.
*/
int pregpp = 3 + 1;
/* The following describe the physical memory configuration.
**
** maxclick - The largest physical click number.
** ctob(maxclick) is the largest physical
** address configured plus 1.
**
** physmem - The amount of physical memory configured
** in clicks. ctob(maxclick) is the amount
** of physical memory in bytes.
** kpbase - The physical address of the start of
** the allocatable memory area. That is,
** after all kernel tables are allocated.
** Pfdat table entries are allocated for
** physical memory starting at this address.
** It is always on a page boundary.
*/
int maxclick;
int physmem;
int kpbase;
/* The following are concerned with the kernel virtual
** address space.
**
** kptbl - The address of the kernel page table.
** It is dynamically allocated in startup.c
** userpt - Points to the page table for the u block.
** Mapped by win_ublk.
*/
pde_t *kptbl;
pde_t *userpt;
/* The following space is concerned with the configuration of
** NOFILES. We have to do it this hard way because the code
** which actually does this is in the assembly language file
** misc.s and can't include header files or conveniently
** print things.
**
** The variable nofiles_cfg is assigned a value here to force
** it to be in the data region rather than bss. The value
** will be overwritten by the code at vstart_s in misc.s.
** However, this occurs before bss is cleared so that if
** this variable were in bss, the value written by vstart_s
** would be cleared in mlsetup when bss is cleared.
*/
int nofiles_min = NOFILES_MIN;
int nofiles_max = NOFILES_MAX;
int nofiles_cfg = 1; /* Originally configured value. */
char fp_kind;
/* The following space allows setting system wide ulimit via tuneable
** parameter CDLIMIT */
daddr_t cdlimit = CDLIMIT;
#ifdef VIANET
#include "sys/ext_open.h"
struct i_shrmode i_shrmode[NINODE]; /* The inode sharing mode table */
unsigned char f_shrmode[NFILE]; /* The file sharing mode table */
int flox_fd[FLCKREC]; /* per-fd lock information */
#endif /* VIANET */
#if defined(HBTCP) || defined(XWIN)
/*
* the XTTY_MASK value must be set to the value that matches
* the NXTTY size. The defaults should work on small systems
* but should be increased for larger systems (with more than 32 tty devices)
*/
#include "sys/xtty.h"
#define NXTTY 32
#define XTTY_MASK 0x1F /* for 32 xtended tty structures */
struct xtty xttys[NXTTY];
int nxttys = NXTTY;
int xttymask = XTTY_MASK;
#endif
/* Common printer driver routine definitions. */
/* lp_pollint is the timeout interval for checking for lost interrupts.
* Some printer/adapter combinations lose interrupts frequently, resulting
* in very slow printing with large values of lp_pollint; for such printers,
* the 1/20 second interval below is useful; for very fast printers, or
* especially flaky printer/adapter combinations, smaller values may be
* needed. Larger values (e.g., HZ*2) are recommended for efficiency for
* printer/adapter combinations that do not lose interrupts.
*/
int lp_pollint = LP_POLLINT;
/* lp_warnint is the interval between console messages warning of paper
* out or not ready conditions requiring operator intervention.
*/
time_t lp_warnint = LP_WARNINT;
#ifdef DEBUG
/* The ipid table is used to track inode logging in the u-block.
* The table was moved from iget.c where the size was hard coded to 200.
* With debug turned on and NINODE > 200 would walk over data space.
*/
short ipid[NINODE];
#endif
/* The following space points to areas for communication with
** intelligent at boards
*/
struct boot_window * window_addr;
ushort v_window = NWINDOW;
unsigned char window_user[NWINDOW];
int window_click;