Plan 9 from Bell Labs’s /usr/web/sources/extra/9hist/pc/fault386.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


## diffname pc/fault386.c 1991/0710
## diff -e /dev/null /n/bootesdump/1991/0710/sys/src/9/safari/fault386.c
0a
#include	"u.h"
#include	"lib.h"
#include	"mem.h"
#include	"dat.h"
#include	"fns.h"
#include	"ureg.h"

void
faultinit(void)
{
	setvec(Faultvec, fault386, SEGTG);
}

void
fault386(Ureg *ur)
{
	panic("fault");
}
.
## diffname pc/fault386.c 1991/0711
## diff -e /n/bootesdump/1991/0710/sys/src/9/safari/fault386.c /n/bootesdump/1991/0711/sys/src/9/safari/fault386.c
6a
#include	"io.h"
.
## diffname pc/fault386.c 1991/0716
## diff -e /n/bootesdump/1991/0711/sys/src/9/safari/fault386.c /n/bootesdump/1991/0716/sys/src/9/safari/fault386.c
12c
	setvec(Faultvec, fault386);
.
## diffname pc/fault386.c 1991/0718
## diff -e /n/bootesdump/1991/0716/sys/src/9/safari/fault386.c /n/bootesdump/1991/0718/sys/src/9/safari/fault386.c
18c
	setvec(Faultvec, fault386);
.
16c
faultinit(void)
.
12c
	ulong addr;
	int read;
	int user;

print("fault386\n");
dumpregs(ur);
for(;;);
	addr = getcr2();
	read = !(ur->ecode & 2);
	user = (ur->ecode & 4);
	if(fault(addr, read) < 0){
		if(user){
			pprint("user %s error addr=0x%lux\n", read? "read" : "write", addr);
			pprint("status=0x%lux pc=0x%lux sp=0x%lux\n", ur->flags, ur->pc, ur->usp);
			pexit("Suicide", 0);
		}
		u->p->state = MMUing;
		dumpregs(ur);
		panic("fault: 0x%lux", addr);
	}
.
10c
fault386(Ureg *ur)
.
## diffname pc/fault386.c 1991/0719
## diff -e /n/bootesdump/1991/0718/sys/src/9/safari/fault386.c /n/bootesdump/1991/0719/sys/src/9/safari/fault386.c
31a
	faulting = 0;
.
22c
	n = fault(addr, read);
print("fault returns %d\n", n);
	if(n < 0){
.
19a
print("fault386 %lux ur %lux\n", addr, ur);
dumpregs(ur);
if(++times==3)
	panic("3rd time");
	if(faulting)
		panic("double fault\n");
	faulting = 1;
.
16,18d
14a
	int n;
	static int times;
.
8a
int faulting;

.
## diffname pc/fault386.c 1991/0720
## diff -e /n/bootesdump/1991/0719/sys/src/9/safari/fault386.c /n/bootesdump/1991/0720/sys/src/9/safari/fault386.c
42a
	u->p->insyscall = insyscall;
.
34,35c
			pprint("user %s error addr=0x%lux\n", read?"read":"write", addr);
			pprint("status=0x%lux pc=0x%lux sp=0x%lux\n", ur->flags,
				ur->pc, ur->usp);
.
31c
if(++times==3)
	panic("3rd time in fault");
.
23,24d
19a
	insyscall = u->p->insyscall;
	u->p->insyscall = 1;
.
17a
	int insyscall;
.
## diffname pc/fault386.c 1991/0723
## diff -e /n/bootesdump/1991/0720/sys/src/9/safari/fault386.c /n/bootesdump/1991/0723/sys/src/9/safari/fault386.c
32,33d
19d
## diffname pc/fault386.c 1991/0801
## diff -e /n/bootesdump/1991/0723/sys/src/9/safari/fault386.c /n/bootesdump/1991/0801/sys/src/9/safari/fault386.c
40c
		panic("fault: 0x%lux 0x%lux", addr);
.
23,24d
## diffname pc/fault386.c 1991/0808
## diff -e /n/bootesdump/1991/0801/sys/src/9/safari/fault386.c /n/bootesdump/1991/0808/sys/src/9/safari/fault386.c
38c
		panic("fault: 0x%lux", addr);
.
## diffname pc/fault386.c 1991/0809
## diff -e /n/bootesdump/1991/0808/sys/src/9/safari/fault386.c /n/bootesdump/1991/0809/sys/src/9/safari/fault386.c
40d
27c
	user = (ur->cs&0xffff) == UESEL;
.
23,25d
## diffname pc/fault386.c 1991/0926
## diff -e /n/bootesdump/1991/0809/sys/src/9/safari/fault386.c /n/bootesdump/1991/0926/sys/src/9/safari/fault386.c
33d
## diffname pc/fault386.c 1991/1112
## diff -e /n/bootesdump/1991/0926/sys/src/9/safari/fault386.c /n/bootesdump/1991/1112/sys/src/9/safari/fault386.c
28,31c
			sprint(buf, "sys: fault %s pc=0x%lux addr=0x%lux",
				read? "read" : "write", ur->pc, addr);
			postnote(u->p, 1, buf, NDebug);
			return;
.
18a
	char buf[ERRLEN];
.
## diffname pc/fault386.c 1991/1218
## diff -e /n/bootesdump/1991/1112/sys/src/9/safari/fault386.c /n/bootesdump/1991/1218/sys/src/9/safari/fault386.c
29,30c
			sprint(buf, "sys: trap: fault %s addr=0x%lux",
				read? "read" : "write", addr);
.
## diffname pc/fault386.c 1992/0321
## diff -e /n/bootesdump/1991/1218/sys/src/9/safari/fault386.c /n/bootesdump/1992/0321/sys/src/9/safari/fault386.c
2c
#include	"../port/lib.h"
.
## diffname pc/fault386.c 1992/0805
## diff -e /n/bootesdump/1992/0321/sys/src/9/safari/fault386.c /n/bootesdump/1992/0805/sys/src/9/safari/fault386.c
25a
	spllo();
.
## diffname pc/fault386.c 1993/0915
## diff -e /n/bootesdump/1992/0808/sys/src/9/safari/fault386.c /n/fornaxdump/1993/0915/sys/src/brazil/pc/fault386.c
38c
	up->insyscall = insyscall;
.
32c
			postnote(up, 1, buf, NDebug);
.
26a
/* print("F%d:A#%lux:U%d:R%d|", up->pid, addr, user, read);/**/
.
21,22c
	insyscall = up->insyscall;
	up->insyscall = 1;
.
## diffname pc/fault386.c 1993/1113
## diff -e /n/fornaxdump/1993/0915/sys/src/brazil/pc/fault386.c /n/fornaxdump/1993/1113/sys/src/brazil/pc/fault386.c
35a
print("fault: 0x%lux", addr);
.
27c
/*print("F%d:A#%lux:U%d:R%d|", up->pid, addr, user, read);/**/
.
## diffname pc/fault386.c 1993/1124
## diff -e /n/fornaxdump/1993/1113/sys/src/brazil/pc/fault386.c /n/fornaxdump/1993/1124/sys/src/brazil/pc/fault386.c
46c
	setvec(Faultvec, fault386, 0);
.
20a
	USED(arg);

.
11,12c
static void
fault386(Ureg *ur, void *arg)
.
## diffname pc/fault386.c 1993/1125
## diff -e /n/fornaxdump/1993/1124/sys/src/brazil/pc/fault386.c /n/fornaxdump/1993/1125/sys/src/brazil/pc/fault386.c
9,10d
## diffname pc/fault386.c 1994/0521
## diff -e /n/fornaxdump/1993/1125/sys/src/brazil/pc/fault386.c /n/fornaxdump/1994/0521/sys/src/brazil/pc/fault386.c
36d
27d
20a
	if(up == 0){
		dumpregs(ur);
		for(;;);
	}

.
## diffname pc/fault386.c 1994/0525
## diff -e /n/fornaxdump/1994/0521/sys/src/brazil/pc/fault386.c /n/fornaxdump/1994/0525/sys/src/brazil/pc/fault386.c
39a
print("fault: 0x%lux", addr);
.
31a
/*print("F%d:A#%lux:U%d:R%d|", up->pid, addr, user, read);/**/
.
21,25d
## diffname pc/fault386.c 1994/0902
## diff -e /n/fornaxdump/1994/0525/sys/src/brazil/pc/fault386.c /n/fornaxdump/1994/0902/sys/src/brazil/pc/fault386.c
38c
		panic("fault: 0x%lux\n", addr);
.
36d
27d
## diffname pc/fault386.c 1997/0327 # deleted
## diff -e /n/fornaxdump/1994/0902/sys/src/brazil/pc/fault386.c /n/emeliedump/1997/0327/sys/src/brazil/pc/fault386.c
1,45d

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].