trap.s

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

S
50 行
字号
/* *	.asciz	"@(#)trap.s 1.1 92/07/30 SMI" *	Copyright (c) 1989 Sun Microsystems, Inc. */#include "SYS.h"#include "assym.s"/* * Get/Set vector base register */        ENTRY(getvbr1)        movc    vbr,d0        rts        ENTRY(setvbr)        movl    sp@(4),d0        movc    d0,vbr        rts/* * Syscall. */	.globl  syscallsyscall:        movl    sp@(8),d0                  | get the syscall codesyscont:	pea	sp@(0x10)        movl    d0,sp@-                 | push syscall code        jsr     _syscall                | go to C routine        addqw   #8,sp                   | pop arg        rte                             | and return!/* * Make sure the vector for 'trap #0' * points to syscall() */	ENTRY(set_vec)	movl	sp@(4),a0	movl	#syscall,a0@(0x080)	rts/* * cerror stub */	.globl	cerror	.globl	__exitcerror:	jmp	__exit

⌨️ 快捷键说明

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