/*********************************************************************** * file: h/sys/param.h * part#: * internal sequence#: * * ************************************************************** * * " c Copyright Hewlett-Packard Company, 1984.* All * * * rights are reserved. Copying or other reproduction * * * of this program except for archival purposes is * * * prohibited without the prior written consent of * * * Hewlett-Packard Company." * * ************************************************************** * * Pisces Q-DOS project * Andy Rood Kernel project lead * ----------------------------------------------------- * initial 11/82 alr * changed NOFILE to 20 6/23/83 fdt * removed fuibyte... & copyiin ... 9/13/83 alr * change USRSTACK 9/13/83 alr * change major, minor, makedev to reflect a * 32 bit dev_t 10/14/83 jra * changed CANBSIZ to 1024 11/7/83 fdt * changed NCARGS to 5120 5-84 alr */ #include /* * fundamental variables * don't change too often */ #ifndef BSIZE #define BSIZE 1024 /* file system block size */ #endif /* also devined in filsys */ #define NOFILE 20 /* max open files per process */ #define MAXPID 30000 /* max process id */ #define MAXUID 60000 /* max user id */ #define MAXLINK 100 /* max links */ #define MAXMEM 512 /* max per-proc memory in 1024-byte clicks */ #define MAXSEGS 2 /* number of 'segments' */ #define SGTABSZ MAXSEGS /* number of 'segments' */ #define PTEPPG 256 /* number of page table entries per page */ #define MAXUMEM MAXSEGS*PTEPPG /* max no. clicks per process */ #define SWAPSIZE 64 /* granularity of partial swaps (in clicks) */ /* * #define SSIZE 2 /* initial stack size (*1024 bytes) */ #define SSIZE u.u_procp->p_t2 #define SINCR 1 /* increment of stack (*1024 bytes) */ #define UPAGES 2 /* initial size of user block (*1024) */ #define USIZE (UPAGES + SGTABSZ) /* size of user block in segments */ /********* * * below modified for no mm pre-pisces kernel * 12-82 alr * modified for 0x2000 base users 1-84 alr */ #define USRSTART 0x2000 /* Start of user virtual addresses */ #define USRSTACK 0x1800 /* Start of user stack (virtual) */ /* ... alr 3-8-83 */ /* ... alr 9-13-83 */ /* ... alr 1-5-84 */ #define CANBSIZ 1024 /* max size of typewriter line */ #define HZ 10 /* Ticks/resched of the clock */ #define NCARGS 5120 /* # characters in exec arglist */ /* * priorities * probably should not be * altered too much */ #define PSWP 0 #define PINOD 10 #define PRIBIO 20 #define PZERO 25 #define NZERO 20 #define PPIPE 26 #define PWAIT 30 #define PSLEP 40 #define PUSER 50 #define PIDLE 127 /* * signals * dont change */ #define NSIG 21 /* * No more than 32 signals (1-32) because they are * stored in bits in a long. */ #define SIGHUP 1 /* hangup */ #define SIGINT 2 /* interrupt (rubout) */ #define SIGQUIT 3 /* quit (FS) */ #define SIGILL 4 /* illegal instruction */ #define SIGTRAP 5 /* trace or breakpoint */ #define SIGIOT 6 /* iot */ #define SIGEMT 7 /* emt */ #define SIGFPE 8 /* floating exception */ #define SIGKILL 9 /* kill, uncatchable termination */ #define SIGBUS 10 /* bus error */ #define SIGSEGV 11 /* segmentation violation */ #define SIGSYS 12 /* bad system call */ #define SIGPIPE 13 /* end of pipe */ #define SIGALRM 14 /* alarm clock */ #define SIGTERM 15 /* Catchable termination */ #define SIGUSR1 16 /* user defined signal 1 */ #define SIGUSR2 17 /* user defined signal 2 */ #define SIGCLD 18 /* child death */ #define SIGPWR 19 /* power-fail restart */ #define SIGMOUSE 20 /* mouse event */ /* * fundamental constants of the implementation-- * cannot be changed easily */ #define NBPW sizeof(int) /* number of bytes in an integer */ #define NULL 0 #define CMASK 0 /* default mask for file creation */ #define CDLIMIT (1L<<11) /* default max write address */ #define NODEV (dev_t)(-1) #define CLKTICK 16667*6 /* microseconds in a clock tick */ #define MAXDMA 65536 /* longest possible DMA */ /* * Some macros for units conversion */ /* Core clicks to segments and vice versa */ #define ctos(x) (x) #define stoc(x) (x) /* clicks to bytes */ #define ctob(x) ((x)<<10) /* bytes to clicks */ #define btoc(x) (((unsigned)x+1023)>>10) #define btoct(x) ((unsigned)(x)>>10) /* major part of a device */ #define major(x) (int)((unsigned)x>>24) /* minor part of a device */ #define minor(x) (int)(x&0xffffff) /* port number for a device */ #define port(x) (int)((x>>12)&0x3f) /* make a device number */ #define makedev(x,y) (dev_t)(((x)<<24) | (y)) /* Machine dependent bits and macros */ #define SMODE 0x2000 /* supervisor mode bit */ #define INTPRI 0x0700 /* priority bits */ #define USERMODE(ps) (((ps) & SMODE) == 0) #define BASEPRI(ps) (((ps) & INTPRI) != 0) #define lobyte(X) (((unsigned char *)&X)[1]) #define hibyte(X) (((unsigned char *)&X)[0]) #define loword(X) (((ushort *)&X)[1]) #define hiword(X) (((ushort *)&X)[0]) /* * #define fuibyte(x) fubyte(x) * #define fuiword(x) fuword(x) * #define suibyte(x,y) subyte(x,y) * #define suiword(x,y) suword(x,y) * #define copyiin(x,y,z) copy(x,y,z) * #define copyiout(x,y,z) copy(x,y,z) */