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

📄 locore.s

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 S
📖 第 1 页 / 共 5 页
字号:
/* * @(#)locore.s	4.7        (ULTRIX)        3/6/91 *//************************************************************************ *									* *			Copyright (c) 1989 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.			* *									* *   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.	* *									* ************************************************************************//* ------------------------------------------------------------------ *//* | Copyright Unpublished, MIPS Computer Systems, Inc.  All Rights | *//* | Reserved.  This software contains proprietary and confidential | *//* | information of MIPS and its suppliers.  Use, disclosure or     | *//* | reproduction is prohibited without the prior express written   | *//* | consent of MIPS.                                               | *//* ------------------------------------------------------------------ *//************************************************************************ * *	Modification History: locore.s * *   06-Mar-91 -- jaw *	3min spl optimization. * *   06-Sep-90 -- Randall Brown *	In exception_exit(), if we are a 3min a call is made to  *	kn02ba_exception_exit() to restore the interrupt mask *	status register in the exception frame.  This is because the *	values stored in the exception frame could be wrong if a *	device has enabled or disabled its interrupt. * *   23-Aug-90 -- Randall Brown *	In the VEC_tlbmiss(), VEC_tlbmod(), VEC_nofault() routines,  the *	status register is restored to the value it was before *	calling routines in trap.c.  This is because the status register *	may come back with interrupt enabled and interrupts must be disabled *	before calling exception_exit(). * *   09-Aug-90 -- Randall Brown *	Changed the size of the exception frame.  Added two new entries, *	the variables except_sys1 and except_sys2 contain the  *	address of the data to save on the frame. * *   30-Apr-90 -- Randall Brown *	Changed the exeception handler to call (*intrp)() instead of  *	a straight call to intr().  This makes the interrupt handler *	more system specific.  Also changed all the spl routines to *	kn01_spl* so they can be called through the new spl mechanism. * *   17-Jul-90 -- jaw *	Fix for int overflow on wrap of l_won. * *   19-Jun-90 -- jmartin *	Fixes for "panic: vrelvm rssize" * *   16-Apr-90 -- jaw/gmm *	move kstackflg to cpudata structure. * *   29-Mar-90 gmm/jaw *	Do not change affinity to ALLCPU if a signal pending for the process *	(in checkfp()). * *   16-Mar-90 robin *	Changed kn220wbflush to use a uncached address to force the flush. * *   13-Mar-90 jaw *	mips lock primitive needs to inc won field. * *   06-Mar-90 -- gmm *	Inform every cpu if the process affinity changes back to ALLCPU, if *	smp defined. * *   03-Mar-90 jaw *	primitive change to optimize mips. * *   29-Dec-89 -- afd *	Put a work-around into VEC_ibe and VEC_dbe for DS5000 (3max) *	so we can dismiss the pending interrupt when we have a bus error. * *   26-Dec-1989 Robin *	Added kn220 write buffer flush routine. * *   4-Dec-89 -- jmartin *	Fix functions checkfp and VEC_cpfault to use new PTE format. * *   28-Nov-89  Alan Frechette *	Now successfully get dumps on hung MIPS systems. Use the *	ultrix startup stack for performing system dumps and remap *	the OS exception vector handling code in doadump(). This is *	needed when forcing a dump after hitting the RESET button. *	Also changed the _coredump() routine to call doadump(). * *   13-Nov-89  Giles Atkinson *	Added wait_tick function for use by LMF. * *   09-Nov-89	bp *	Added globals VSysmap and Dbptemap for Vax pte mapping. * *  19-Oct-89 -- jmartin *	For R2000/R3000, shift PTE left 8 just before writing C0_TLBLO. * *   04-Oct-89  gmm *	SMP changes (use cpudata for nofault, get rid of kstackflag,  *	process affinity for fpowner, etc) * * 22-sep-89 burns (ISIS pool merge) * *   10-July-89	burns *	Added cpu check for ISIS to avoid crash due to lack of a SBE register. *	Handle halt interrupt early. * *   17-Apr-1989	Kong *	Fixed VEC_ibe exception handler so that it doesn't accidentally *	branch to the breakpoint trap handler. * *   22-Mar-1989  Pete Keilty *	Added unixtovms time routine used by SCS * *   16-Mar-1989  Kong *	Added routine "read_nofault".   * *   20-Feb-1989	Kong *	Changed routine "badaddr" to "bbadaddr" as in VAXen.  "badaddr" *	is now a routine in machdep.c that does system dependent code. *	PMAX does not seem to use badaddr. * * * 06-Feb-1989  Kong *	Added entries to "splm" array to include new routines spl6==splhigh, *	spl7 == splextreme. *	VEC_int saves registers s1-s8 if the interrupt may be a FPU interrupt. * * 23-Jan-1989	Kong *     .Made the splxxx routines work for PMAX and MIPSFAIR.  This is *	done by introducing an array "splm" which contains the proper *	interrupt masks for the machine we are running on.  The "splm" *	array is initialized at system startup time, before any interrupts *	are allowed. *     .Made the routine "wbflush" system dependent. * */#define CNT_TLBMISS_HACK 0#include "../machine/param.h"#include "../machine/cpu.h"#include "../../machine/common/cpuconf.h"#include "../machine/cpu_board.h"#include "../machine/fpu.h"#include "../machine/asm.h"#include "../machine/reg.h"#include "../machine/regdef.h"#include "../machine/vmparam.h"#include "../machine/pte.h"#include "../machine/fpu.h"#include "../h/proc.h"#include "../h/mbuf.h"#include "../h/signal.h"#include "../h/syscall.h"#include "../machine/entrypt.h"	/* prom entry point definitions */#include "../machine/debug.h"#include "assym.h"#include "../machine/kn02ba.h"/* create define for original mips architecture */#if defined(DS3100) || defined(DS5400) || defined(DS5500) || defined(DS5800) || defined(DS5000) || defined(DS5100)#define MIPS_ARCH_SPL_ORIG#endif#ifdef DS5000_100IMPORT(mips_spl_arch_type,4)IMPORT(ipllevel,4)#endif/* bss area location that kn220 uses to force a write buffer flush */LBSS(kn220wbflush_loc,4)/* * User structure is UPAGES at top of user space. * This is here so that u appears in the symbol table for debuggers, etc. */	ABS(u, UADDR)/* * define prom entrypoints of interest to kernel * * reset reboots as indicated by $bootmode and looks for warm start block */EXPORT(prom_reset)	li	v0,PROM_RESET	j	v0/* * halt */EXPORT(prom_halt)	li	v0,PROM_HALT	j	v0/* * autoboot always reboots regardless of $bootmode */EXPORT(prom_autoboot)	li	v0,PROM_AUTOBOOT	j	v0/* * reboot does action indicated by $bootmode */EXPORT(prom_reboot)	li	v0,PROM_REBOOT	j	v0/* * restart always enters prom command mode */EXPORT(prom_restart)	li	v0,PROM_RESTART	j	v0/* * prom flow-controlled console io */EXPORT(prom_getchar)	li	v0,PROM_GETCHAR	j	v0EXPORT(prom_putchar)	li	v0,PROM_PUTCHAR	j	v0#ifdef notdef/* * The next 6 are no longer in the PROM *//* * prom read-modify-write routines */EXPORT(andb_rmw)	li	v0,PROM_ANDB_RMW	j	v0EXPORT(andh_rmw)	li	v0,PROM_ANDH_RMW	j	v0EXPORT(andw_rmw)	li	v0,PROM_ANDW_RMW	j	v0EXPORT(orb_rmw)	li	v0,PROM_ORB_RMW	j	v0EXPORT(orh_rmw)	li	v0,PROM_ORH_RMW	j	v0EXPORT(orw_rmw)	li	v0,PROM_ORW_RMW	j	v0#endif notdefEXPORT(prom_exec)	li	v0,PROM_EXEC	j	v0EXPORT(prom_getenv)	lw	v0,rex_base	bne	v0,zero,1f	li	v0,PROM_GETENV	j	v01:	j	rex_getenvEXPORT(prom_setenv)	li	v0,PROM_SETENV	j	v0EXPORT(prom_open)	li	v0,PROM_OPEN	j	v0EXPORT(prom_close)	li	v0,PROM_CLOSE	j	v0EXPORT(prom_lseek)	li	v0,PROM_LSEEK	j	v0EXPORT(prom_read)	li	v0,PROM_READ	j	v0EXPORT(prom_write)	li	v0,PROM_WRITE	j	v0/* * REX global variable */	BSS(rex_base,4)			# REX base address.	BSS(rex_magicid,4)		# REX base address./* * ROM Executive Program (REX) callbacks (entry points) * * These are presently used only with 3MAX.  They are currently TURBOchannel * specific. */EXPORT(rex_memcpy)	lw	v0,rex_base	lw	v0,REX_MEMCPY(v0)	j	v0/*EXPORT(rex_memset)	lw	v0,rex_base	lw	v0,REX_MEMSET(v0)	j	v0EXPORT(rex_strcat)	lw	v0,rex_base	lw	v0,REX_STRCAT(v0)	j	v0EXPORT(rex_strcmp)	lw	v0,rex_base	lw	v0,REX_STRCMP(v0)	j	v0EXPORT(rex_strlen)	lw	v0,rex_base	lw	v0,REX_STRLEN(v0)	j	v0EXPORT(rex_strncat)	lw	v0,rex_base	lw	v0,REX_STRNCAT(v0)	j	v0EXPORT(rex_strncpy)	lw	v0,rex_base	lw	v0,REX_STRNCPY(v0)	j	v0EXPORT(rex_strncmy)	lw	v0,rex_base	lw	v0,REX_STRNCMY(v0)	j	v0EXPORT(rex_getchar)	lw	v0,rex_base	lw	v0,REX_GETCHAR(v0)	j	v0*/EXPORT(rex_gets)	lw	v0,rex_base	lw	v0,REX_GETS(v0)	j	v0/*EXPORT(rex_puts)	lw	v0,rex_base	lw	v0,REX_PUTS(v0)	j	v0*/EXPORT(rex_printf)	lw	v0,rex_base	lw	v0,REX_PRINTF(v0)	j	v0/*EXPORT(rex_sprintf)	lw	v0,rex_base	lw	v0,REX_SPRINTF(v0)	j	v0EXPORT(rex_io_poll)	lw	v0,rex_base	lw	v0,REX_IO_POLL(v0)	j	v0EXPORT(rex_strtol)	lw	v0,rex_base	lw	v0,REX_STRTOL(v0)	j	v0EXPORT(rex_signal)	lw	v0,rex_base	lw	v0,REX_SIGNAL(v0)	j	v0EXPORT(rex_raise)	lw	v0,rex_base	lw	v0,REX_RAISE(v0)	j	v0EXPORT(rex_time)	lw	v0,rex_base	lw	v0,REX_TIME(v0)	j	v0EXPORT(rex_setjump)	lw	v0,rex_base	lw	v0,REX_SETJUMP(v0)	j	v0EXPORT(rex_longjump)	lw	v0,rex_base	lw	v0,REX_LONGJUMP(v0)	j	v0*/EXPORT(rex_bootinit)	lw	v0,rex_base	lw	v0,REX_BOOTINIT(v0)	j	v0EXPORT(rex_bootread)	lw	v0,rex_base	lw	v0,REX_BOOTREAD(v0)	j	v0EXPORT(rex_bootwrite)	lw	v0,rex_base	lw	v0,REX_BOOTWRITE(v0)	j	v0/*EXPORT(rex_setenv)	lw	v0,rex_base	lw	v0,REX_SETENV(v0)	j	v0*/EXPORT(rex_getenv)	lw	v0,rex_base	lw	v0,REX_GETENV(v0)	j	v0/*EXPORT(rex_unsetenv)	lw	v0,rex_base	lw	v0,REX_UNSETENV(v0)	j	v0EXPORT(rex_slot_address)	lw	v0,rex_base	lw	v0,REX_SLOT_ADDRESS(v0)	j	v0EXPORT(rex_wbflush)	lw	v0,rex_base	lw	v0,REX_WBFLUSH(v0)	j	v0EXPORT(rex_msdelay)	lw	v0,rex_base	lw	v0,REX_MSDELAY(v0)	j	v0EXPORT(rex_leds)	lw	v0,rex_base	lw	v0,REX_LEDS(v0)	j	v0EXPORT(rex_clear_cache)	lw	v0,rex_base	lw	v0,REX_CLEAR_CACHE(v0)	j	v0*/EXPORT(rex_getsystype)	lw	v0,rex_base	lw	v0,REX_GETSYSTYPE(v0)	j	v0EXPORT(rex_getbitmap)	lw	v0,rex_base	lw	v0,REX_GETBITMAP(v0)	j	v0/*EXPORT(rex_disableintr)	lw	v0,rex_base	lw	v0,REX_DISABLEINTR(v0)	j	v0EXPORT(rex_enableintr)	lw	v0,rex_base	lw	v0,REX_ENABLEINTR(v0)	j	v0EXPORT(rex_testintr)	lw	v0,rex_base	lw	v0,REX_TESTINTR(v0)	j	v0EXPORT(rex_console_init)	lw	v0,rex_base	lw	v0,REX_CONSOLE_INIT(v0)	j	v0*/EXPORT(rex_halt)	lw	v0,rex_base	lw	v0,REX_HALT(v0)	j	v0/*EXPORT(rex_showfault)	lw	v0,rex_base	lw	v0,REX_SHOWFAULT(v0)	j	v0EXPORT(rex_gettcinfo)	lw	v0,rex_base	lw	v0,REX_GETTCINFO(v0)	j	v0*/EXPORT(rex_execute_cmd)	lw	v0,rex_base	lw	v0,REX_EXECUTE_CMD(v0)	j	v0EXPORT(rex_rex)	lw	v0,rex_base	lw	v0,REX_REX(v0)	j	v0/* * Misc. kernel entry points */EXPORT(_coredump)	j	doadumpEXPORT(_xprdump)	jal	xprdump	lw	a0,rex_magicid	li	a1,0x30464354	bne	a0,a1,1f	li	a0,0x68	j	rex_rex1:	j	prom_restartEXPORT(_xprtail)	jal	xprtail	lw	a0,rex_magicid	li	a1,0x30464354	bne	a0,a1,1f	li	a0,0x68	j	rex_rex1:	j	prom_restartEXPORT(_msgdump)#ifndef ultrix	jal	msgdump#endif not ultrix	lw	a0,rex_magicid	li	a1,0x30464354	bne	a0,a1,1f	li	a0,0x68	j	rex_rex1:	j	prom_restart/*

⌨️ 快捷键说明

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