1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Add an assertion that we have a current pmap set before we try and return.

This commit is contained in:
Benno Rice 2002-05-09 14:15:51 +00:00
parent 1d61c15b8a
commit afb7382655
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=96253
2 changed files with 16 additions and 2 deletions

View File

@ -48,6 +48,8 @@
.align 4
astpending:
.long 0
cpassert:
.asciz "attempting to return from kernel with no current pmap"
/*
* Data used during primary/secondary traps/interrupts
@ -634,7 +636,12 @@ _C_LABEL(ipkdbsize) = .-_C_LABEL(ipkdblow)
/* Restore user & kernel access SR: */ \
mfsprg 2,0; \
lwz 2,PC_CURPMAP(2); \
lwz 3,PM_SR+0(2); \
cmpwi cr4,2,0; /* is curpmap NULL? */ \
bne cr4,2f; \
lis 3,cpassert@ha; /* if it is, panic */ \
addi 3,3,cpassert@l; \
b panic; \
2: lwz 3,PM_SR+0(2); \
mtsr 0,3; /* restore SR0 */ \
lwz 3,PM_SR+4(2); \
mtsr 1,3; /* restore SR1 */ \

View File

@ -48,6 +48,8 @@
.align 4
astpending:
.long 0
cpassert:
.asciz "attempting to return from kernel with no current pmap"
/*
* Data used during primary/secondary traps/interrupts
@ -634,7 +636,12 @@ _C_LABEL(ipkdbsize) = .-_C_LABEL(ipkdblow)
/* Restore user & kernel access SR: */ \
mfsprg 2,0; \
lwz 2,PC_CURPMAP(2); \
lwz 3,PM_SR+0(2); \
cmpwi cr4,2,0; /* is curpmap NULL? */ \
bne cr4,2f; \
lis 3,cpassert@ha; /* if it is, panic */ \
addi 3,3,cpassert@l; \
b panic; \
2: lwz 3,PM_SR+0(2); \
mtsr 0,3; /* restore SR0 */ \
lwz 3,PM_SR+4(2); \
mtsr 1,3; /* restore SR1 */ \