diff options
author | jake <jake@FreeBSD.org> | 2002-02-25 18:37:17 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2002-02-25 18:37:17 +0000 |
commit | 11e9d44ed7e85892c4fabda2e88d5c9d77232cc2 (patch) | |
tree | 9b5e76b9abe8f55dc6e2e2212b1cc12e2d8d4d0b /sys/sparc64/include | |
parent | c70d19ad22d1c5fd6c5d552919cd2cf4c125b383 (diff) | |
download | FreeBSD-src-11e9d44ed7e85892c4fabda2e88d5c9d77232cc2.zip FreeBSD-src-11e9d44ed7e85892c4fabda2e88d5c9d77232cc2.tar.gz |
Implement a nested window state. This avoids attempting to spill a user
window to the user stack while in a nested kernel trap. We do this for
entry to the kernel from user mode, but if we get an interrupt in kernel
mode while there are still user windows in the cpu, and we attempt to spill
to the user stack, we may take too many nested traps and overflow the trap
stack, causing a red state exception. This is needed by upcoming changes
to allow the user tsb to not be locked in the tlb.
Reviewed by: tmm
Diffstat (limited to 'sys/sparc64/include')
-rw-r--r-- | sys/sparc64/include/wstate.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/sparc64/include/wstate.h b/sys/sparc64/include/wstate.h index cf32973..7ce0a49 100644 --- a/sys/sparc64/include/wstate.h +++ b/sys/sparc64/include/wstate.h @@ -75,18 +75,17 @@ * i.e., WSTATE_TRANSITION can ignore WSTATE_ASSUME if it likes. */ -#define WSTATE_32BIT 1 /* if set, probably 32-bit mode */ -#define WSTATE_ASSUME 2 /* if set, assume 32 or 64 */ -#define WSTATE_TRANSITION 4 /* if set, force user window */ - -#define WSTATE_TEST64 0 /* test, but anticipate 64-bit mode */ -#define WSTATE_TEST32 1 /* test, but anticipate 32-bit mode */ -#define WSTATE_ASSUME64 2 /* assume 64-bit mode */ -#define WSTATE_ASSUME32 3 /* assume 32-bit mode */ - -#define WSTATE_NORMAL_MASK 3 /* wstate normal minus transition */ +#define WSTATE_NORMAL_MASK 1 /* wstate normal minus transition */ #define WSTATE_OTHER_SHIFT 3 /* for wstate other / user */ +#define WSTATE_OTHER_MASK /* wstate other minus nested */ \ + (WSTATE_NORMAL_MASK << WSTATE_OTHER_SHIFT) #define WSTATE_KERNEL 0 /* normal kernel wstate */ +#define WSTATE_USER_64 0 /* normal 64bit user wstate */ +#define WSTATE_USER_32 1 /* normal 32bit user wstate */ + +#define WSTATE_TRANSITION 2 /* if set, force user window */ +#define WSTATE_NESTED /* if set, spill must not fault */ \ + (WSTATE_TRANSITION << WSTATE_OTHER_SHIFT) #endif /* !_MACHINE_WSTATE_H_ */ |