simutil.s

来自「操作系统SunOS 4.1.3版本的源码」· S 代码 · 共 79 行

S
79
字号
!	@(#)simutil.s 1.1 92/07/30 SMI!	Copyright (c) 1987 by Sun Microsystems, Inc.	.seg	"text"	.align	4#include <machine/asm_linkage.h>#include <sys/syscall.h>#include "assym.s"/* * SAS uses three special traps to simulate system calls and io * trap 210 	simualted system call *		the system call number is in %g1 * trap 252	simulated console input character, cngetc *		sas will generate a level12 interrupt when a input *		character is avaliable, at that time cngetc should be called *		which returns the character in %o0 * trap 253	simulated console output character, cnoutc *		the character to output should be placed in %o0 */	.global	_errno#define SYSCALL(x) \	ENTRY(s_/**/x); \	mov	SYS_/**/x, %g1; \	t	210; \	bcs	cerror; \	nop; \	retl; \	nop/* * Simulator system calls, (SAS -m), used to implement * simulated disk i/o from the driver level of the kernel. */	SYSCALL(open)	SYSCALL(close)	SYSCALL(read)	SYSCALL(write)	SYSCALL(lseek)	SYSCALL(ioctl)	SYSCALL(bind)	SYSCALL(sendto)	SYSCALL(recv)	SYSCALL(socket)cerror:	sethi	%hi(_errno), %g1;	st	%o0, [%g1 + %lo(_errno)];	retl;	mov	-1, %o0;/* * traps to the simulator for character i/o */	.global _simcoutc_simcoutc:	t	253	retl	nop	.global	_simcinc_simcinc:	t	252	retl	nop

⌨️ 快捷键说明

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