⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 machdep.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
📖 第 1 页 / 共 5 页
字号:
#ifndef lintstatic char *sccsid = "@(#)machdep.c	4.8	ULTRIX	3/7/91";#endif lint/************************************************************************ *									* *			Copyright (c) 1986,87,88,89 by			* *		Digital Equipment Corporation, Maynard, MA		* *			All rights reserved.				* *									* *   This software is furnished under a license and may be used and	* *   copied  only  in accordance with the terms of such license and	* *   with the  inclusion  of  the  above  copyright  notice.   This	* *   software  or  any	other copies thereof may not be provided or	* *   otherwise made available to any other person.  No title to and	* *   ownership of the software is hereby transferred.			* *									* *   This software is  derived	from  software	received  from	the	* *   University    of	California,   Berkeley,   and	from   Bell	* *   Laboratories.  Use, duplication, or disclosure is	subject  to	* *   restrictions  under  license  agreements  with  University  of	* *   California and with AT&T.						* *									* *   The information in this software is subject to change  without	* *   notice  and should not be construed as a commitment by Digital	* *   Equipment Corporation.						* *									* *   Digital assumes no responsibility for the use  or	reliability	* *   of its software on equipment which is not supplied by Digital.	* *									* ************************************************************************//************************************************************************ * Modification history: /sys/vax/machdep.c * * 24-Feb-91	jsd *	new allocation scheme for gateway screen buffers * * 4-Sep-90	dlh *	added vector processor support code * * 31-Aug-90	paradis *	Changed restart inhibit code from 'if' to 'switch' (more *	modular); added VAX9000 support for clearing restart *	inhibit. * * 03-Aug-90	rafiey (Ali Rafieymehr) *	Added support for VAX9000. * * 09-Nov-89 -- jaw * 	change references to maxcpu to smp. * * 16-Oct-89 -- Alan Frechette *	No longer dump out the buffer cache during a system crash *	for partial selective crash dumps. Save the PFN of the last  *	kernel page to dump out for the crashdump code. The buffer  *	cache must be the last allocated data for this to work.  * * 25 Jul 89 -- chet *	Change unmount and cache flushing code in boot() * * 24-July-89 -- Alan Frechette *	Moved all the crashdump code to a new file. The new file *	containing the crashdump code is "/sys/sys/crashdump.c". * * 20-Jul-89 jaw *	move non-vax code to sys area. * * 19-Jun-89 -- condylis *	Tightened up unmounting of file systems in boot(). * * 14 Jun 89 -- chet *	Make buffer header allocations based on maxcpu (uniprocessor *	or multiprocessor). * * 12-Jun-89	bp *	Repaired valloc of kmemusage to be dependent on CLSIZE units. *	Changed cpu_ip_intr to recognize kernel memory allocator TB *	synchronization requests. *	 * 12-Jun-1989 -- jaw *  	IP interrupts doing reschedule (AST) need to set runrun flag. * * 12-Jun-1989 -- gg *	In dumpsys() added a check for the presence dumpdev. * * 07-Jun-1989 -- Tim Burke *    Modified gendump() to dump to MSCP (ra) disks.  This change  *    needed because ra disks can be within a range of major numbers. * * 25-May-89 -- fred (Fred Canter_ *	Correct a mismerge. Remove two extra lines of code from the *	default case in gendump(). * * 24-May-89	darrell *	Changed the #include for cpuconf.h to find it in it's new home -- *	sys/machine/common/cpuconf.h * * 24-May-89	darrell *	Removed the v_ prefix from all cpusw fields, removed cpup from any *	arguments being passed in function args.  cpup is now defined *	globally -- as part of the new cpusw. * * 12-May-89 -- darrell *	Merged V3.1 changes. * * 03-May-1989 -- gmm (merged from v3.1) * 	Added support for TMII. If cpu_sub_subtype indicates SB_TMII,  * 	use the parameters for a 90 nsec chip for delay. * * 10-Apr-89 -- gmm *	Fixed the path for kdb.h with the new source tree layout * * 06-Apr-89 -- prs *      Added SMP accounting lock in boot(). * * 15-Feb-1989 -- darrell *	Added a case for VAX_60 to badaddr to disable mbus errors while *	doing a badaddr. * * 14-Feb-1989 -- prs *	Modified boot() to not sync out a remote accounting gnode when *	panicing. During a panic, some network interfaces shutdown before  *	calling boot(). * * 26-Jan-89	jaw *	fix up start/stop cpu. * * 10-Jan-89 -- kong *	Added Rigel (VAX 6400) support.  Cleaned up microdelay routines *	by allowing them to be called at any IPL. * * 16-Jan-89 - jaw *	Bug in accounting.  When doing a reboot, if we panic once then *	don't try to turn off accouting the second time "boot" is called. * * 12-Jan-89 - jaw *	change to printf for attached processors so clists are not *	used. * * 1-Jan-1989 -- Fred Canter *	Modified gendump() to allow crash dumps to disks on either *	SCSI bus (even if root is on the opposite bus). * * 30-Dec-1988 -- Fred Canter *	Added reset of SCSI and ST506 I/O controllers to crash dump *	path (dumpsys) as required by thge VMB boot driver. * * 18-Nov-88 -- darrell *	Fixed a bug where the unit number of the dump device needed to *	be multiplied by 100 before being passed to VMB for Firefoxes * * 10-Oct-88 -- jaw *	initialize Istack variable on boot cpudata. * * 10-Oct-88 -- jaw *	replace switch_to_master with general routine switch_affinity * * 29-Sep-88 -- darrell *	Firefox Cleanup.  Removed Firefox specific code that called *	fccons_init. * * 19-Aug-88 -- miche *	Interrupt cpu goes through free_cpu and hold_cpu to *	hold and free processors.  This is coordinated with swtch *	We still need a routine which intr's everybody. * * 18-Jun-88 -- jaw  change to new cpu data format. * * 27-Apr-88 -- prs *      Enhanced code that turns accounting off in boot(). * * 27 Apr 88 -- chet *	Add SMP buffer cache support. * * 27 Jan 88 -- gmm *	Added the new routine intrpt_cpu() to be used for causing an IP *	interrupt. Rewrote most of cpu_ip_intr() to conform to the new IPI *	interface definition. * * 27 Jan 88 -- us *	Added support for malloced network.   * * 21 Jan 88 -- jmartin *	Replace calls to the (inline) functions clearseg and copyseg *	respectively with blkclr (or bzero) and blkcpy (or bcopy). *	Establish a window in process memory through which a parent *	can write to (and read from) the memory of the child.  This *	window is UPAGES*NBPG bytes located between the u-area and the *	user stack.  Remove the following entities: CMAP1, CADDR1, *	CMAP2, CADDR2, Vfmap, vfutl, clearseg, copyseg.  Redefine *	Forkmap and forkutl.  Change the computation for the location *	of USRSTACK and the size of the process page table.********************************************************************		SMP changes above ********************************************************************* * * 25-Sep-1988 -- Fred Canter *	Clean up comments. * * 19-Aug-1988 -- Fred Canter *	Removed last of PVAX BTD$ kludge. * * 30-July-1988 -- Fred Canter *	Fixed a bug in the PVAX microdelay routine. Caused delay to *	be 3 times what it should be if DELAY() called from probe. *	Caches not enabled yet when probe executed. * * 22-Jul-88 -- darrell *	Added IP interrupt support for VAX60 (Firefox). * * 13-Jul-88 -- chet *	Account for system table demand on physical memory *	in the buffer cache allocation in startup(). *	Remove old code that ignored param.c parameter values. *	Add debugging messages and parameters for buffer cache allocation. *	Calculate usrptsize in startup(). * * 28-June-1988 -- tresvik *      Move filling of installation specific rpb information from here *      to autoconf.c.  This is necessary to support get the *      ws_display_type for the LYNX which isn't filled in until *      lxprobe. * * 13-Jun-88 -- chet *	Added configurable buffer cache support * * 10-Jun-1988		Mark Parenti *	Modified signal mask so that SIGCONT can be ignored/blocked *	(POSIX 12.3) * * 08-Jun-88 -- fred (Fred Canter) *	Adjust microdelay routine for 90ns CPU and caches off. * * 07-Jun-88 -- fred (Fred Canter) *	Bug fix for cvs_cache_on global undefined if VAX420 not configured. * * 07-Jun-88 -- darrell *	Added Firefox support. * * 19-May-88 -- fred (Fred Canter) *	Improved microdelay routine for CVAXstar/PVAX (VAX420). * * 27-Apr-1988		David E. Eiche			DEE0032 *	Modified generic dump code for all devices that use the *	Unibus structures to compare against the device name in *	the ubdinit structure.  This allows kernels built with *	"disk ran at mscp drive n" to dump.  Also made the check *	for the correct genericconf table entry more specific. * * 27-Apr-88 prs *      Enhanced code that turns accounting off in boot(). * * 26-Apr-88    jaw *	Add VAX8820 support. * * 15-Apr-1988		Robin *	Added SII to allow dumps to rf disks. * * 07-Apr-1988		David E. Eiche			DEE0028 *	Add code to enable dumping to the HSC. * * 4-Apr-88 jaa *	calculate and allocate swapmap in swapconf from now on * * 24-Mar-88 Robin (for Larry C.) *	moved setcache to autoconf to insure I/O space is mapped before *	init_main is called.  This fixes a problem introduced by the *	14-Mar-88 change (see note below). * * 15-May-88 tresvik *	move rpb initialization of cpu, cpusub, and ws_display_type *	to after vcons_init calls.  Need ws_display_type to be able *	to sense the environment during installation.  This should all *	move to getsysinfo in the future. * * 14-Mar-88 larry *	Move configure to init_main.c so that scs sysaps start up first. * * 8-Mar-88 jaa *     	Added variable usrptsize, now configurable by sysadm. * * 12-Feb-88 fred (Fred Canter) *	Changes for VAX420 (CVAXstar/PVAX) support. * * 5-Feb-88 tresvik *	increase MINMEM from 3 Meg to 4 Meg (hopefully temporarily) * * 19-Jan-88 -- jaw *	added calypso support.  Also moved in intrcpu into file from locore.s * * 15-Jan-88 Larry Palmer *	mbmap and nmbclusters are gone due to malloced mbufs. *	Also removed inclusion of ioctl.h and mbuf.h headers *	as we keep getting "too many defines from the preprocessor * * 14-Jan-1988 Tresvik *	Map up to a maximum of VMBINFOPAGES instead of all of the *	vmbinfo stack in high memory.  Only mapped access to vmb_info *	and ci ucode is needed anyway.   * *	Display the fact that physmem is being reduced, due to a small *	system page table, in a less frightful way.  The old way prompts *	too much undue concern. * * 11-Jan-1988  	Todd M. Katz *	Optionally invoke the SCS shutdown routine following synchronization *	of all disks.   The SCS shutdown routine disables all local ports. *	This automatically terminates all paths to all remote systems and *	provides the means for remote system discovery of this termination. * *	The SCS shutdown routine is indirectly invoked through the variable *	scs_disable.  It is only invoked if scs_disable has been initialized *	with the address of the SCS shutdown routine.  Such initialization *	occurs during SCS initialization itself which takes place during *	probing of the very first adapter requiring SCS for proper functioning. * * 12-11-87	Robin L. and Larry C. *      Added portclass/kmalloc support to the system. * * 28-Jul-87 -- prs *      Added code to gendump to allow dumping to an AIO device *      on a BI. * * * 11-Nov-87 -- prs *	Fixed a partial dump problem that would overwrite into *	the next partition. * * 14-Sep-87 -- afd *	Changed Mayfair CPMBX write to be a byte write rather than a short. * * 21-Jul-87 -- prs, Robin *	Removed ioctl call to get partition table information in *	dumpsys(). init_main.c now initializes part info. * * 25-Jun-87 -- prs *	Fixed netdump for consistent VAXstar dumps. * * 25-Jun-87 -- Robin *	Added code to get the dump partition size out of the system *	and not do a ioctl into the disk driver.  This insures that *	the IPL will not drop. *	 * 02-Jun-87 -- logcher *	Added GSYNCG and crfree before GRELE of acctp to flush *	delayed write buffers. * * 20-Apr-87 -- afd *	Include ka650.h for Mayfair (after ubareg.h). *	Don't need to coerce types on ka650 console program mail box. *	Changed name CVAXQ to VAX3600 for Mayfair. *	microdelay now calls processor specific routines thru the cpu switch. *	There are now a few different routines which use *		different hardware features to accomplish micro delays. * * 25-Mar-87 -- logcher *	Change the hard coded /etc/init to /bin/init * * 19-Mar-87 -- prs *	Added partial crash dump code to the network dump routine  *	netdump. * * 18-Mar-87 -- logcher *	Added network dumping. * * 06-Mar-87 -- afd *	Added CPU specific support for Mayfair/CVAX. * * 13-Feb-87 -- Chase * 	change computation of nmbclusters to stay consistent with the *	formula	in /sys/vax/genassym.c. * * 12-Feb-87 -- depp *	Changed the sizing of dmempt * * 12-Feb-87 -- pmk *	Changed 3 gendump cprintf's for clearer meaning. Bar * * 15-Jan-87 -- Chase *	change dmemmap size to 512 * * 15-jan-87 -- koehler *	change the calculation for the number of gnodes. * * 08-Jan-87 -- prs *	Added check to boot() to ensure a gnode has a mount device *	associated with it before an update is attempted. * * 16-Dec-86 -- prs *	Added code to boot() that turns accounting off if running. This *	allows the usr file system to umounted cleanly during shutdown. * * 04-Dec-86 -- prs *	Added conditional to allow the gendump routine to work on a *	microVAX I * * 04-Dec-86 -- Robin Lewis *	Removed the quota calls associated with setting login limits.  Login  *	limit code is now independent from MAXUSER,cpu type, and src code. *	(see /upgrade data file) * * 11-Sept-86  --  Tim Burke *	Reduce maxclistusers from 128 to 75 in order to tie up fewer resources. * * 30-Aug-86 -- fred (Fred Canter) *	Added/fixed comments in microdelay routine. *	Fixed crash dumps for VAXstar. * * 14-Aug-86 -- tresvik *	removed CAN BE HALTED message for MVAX II and VAXstar *	Physmem fixed again to act as memory size limit *	plug in CPU and CPU_SUBTYPE to the RPB for installation *	 * 07-Aug-86 -- jaw	fixed microdelay to reflex change in VAX SRM *	to the ipl of the interval timer interrupt. * * 06-Aug-86 -- jaw	fixed baddaddr to work on running system. *	Also fixes to ka8800 reboot code. * *  5-Aug-86 -- fred (Fred Canter) *	Added VAXstar console program mail box support. * * 23-Jul-86 -- prs *	Removed the generic config table genericconf. *	The genericconf table is now built in conf.c. This will *	ensure that the table will only contain configured drivers. * * 26-Jul-86 -- bglover *	Append first startup printfs to startup mesg in error logger * * 18-Jun-86 -- fred (Fred Canter) *	Changes for VAXstar kernel support. * * 13-Jun-86 -- tresvik *	added support for network boot and installation by saving the *	address of vmb_info in the RPB for use be a user level program *	misc, fixes to Physmem, which got redefined to do something *	different.  It can now be preset to set an artificial top of *	memory as well as keep track of the actual amount for use by the *	sizer.  Increase min memory from 2 Meg to 3 Meg. * *  9-jun-86 -- bjg *	Set appendflg to log startup messages * *  2-Jun-86 -- depp *	Added passthough of "u.u_code" for SIGSEGV (see modification note *	"24 Feb 86 -- depp" below. * * 22-May-86 -- prs *	Added saving of u_area to partial dump code. * * 07-May-86 -- bjg *	Remove logstart() call; moved to clock.c. * * 16-Apr-86 -- darrell *	now calling badaddr with the macro BADADDR. * * 15-Apr-86 -- afd *	Re-wrote most of startup().  This changed the way we allocate *	system data structures.  The amount of space for "nbufs" *	is now calculated more intelligently.  The algorithm for *	this came from Berkeley 4.3. * *	The global variable "endofmem" now contains the last *	kernel virtual address that was used. * * 09 Apr 86 -- prs * 	Added common dump code taken from drivers to dumpsys. *	Also, added the generic dump routine, gendump, and *	partial crash dump support.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -