diff options
author | Jake Burkholder <jake@FreeBSD.org> | 2001-09-03 23:10:45 +0000 |
---|---|---|
committer | Jake Burkholder <jake@FreeBSD.org> | 2001-09-03 23:10:45 +0000 |
commit | 880a354a4ad66e264413c7f2fe9f276cfa2acdba (patch) | |
tree | e6d6ac79778aa0e037738238c2e767e7d5c34374 /sys/sparc64/include/frame.h | |
parent | ce1e7a70b91ae50711ef301422abe54758167ca8 (diff) | |
download | src-880a354a4ad66e264413c7f2fe9f276cfa2acdba.tar.gz src-880a354a4ad66e264413c7f2fe9f276cfa2acdba.zip |
Implement a slightly different window spill/fill algorithm for dealing
with user windows in kernel mode. We split the windows using %otherwin,
but instead of spilling user window directly to the pcb, we attempt to
spill to user space. If this fails because a stack page is not resident
(or the stack is smashed), the fault handler at tl 2 will detect the
situation and resume at tl 1 again where recovery code can spill to the
pcb. Any windows that have been saved to the pcb will be copied out to
the user stack on return from kernel mode.
Add a first stab at 32 bit window handling. This uses much of the same
recovery code as above because the alignment of the stack pointer is used
to detect 32 bit code. Attempting to spill a 32 bit window to a 64 bit
stack, or vice versa, will cause an alignment fault. The recovery code
then changes the window state to vector to a 32 bit spill/fill handler
and retries the faulting instruction.
Add ktr traces in useful places during trap processing.
Adjust comments to reflect new code and add many more.
Notes
Notes:
svn path=/head/; revision=82906
Diffstat (limited to 'sys/sparc64/include/frame.h')
-rw-r--r-- | sys/sparc64/include/frame.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/sparc64/include/frame.h b/sys/sparc64/include/frame.h index 883a45b7c39b..1a0d4c40fce9 100644 --- a/sys/sparc64/include/frame.h +++ b/sys/sparc64/include/frame.h @@ -39,7 +39,8 @@ struct trapframe { u_long tf_tpc; u_long tf_tstate; u_long tf_type; - void *tf_arg; + u_long tf_wstate; + uintptr_t tf_arg; }; #define tf_sp tf_out[6] @@ -74,13 +75,16 @@ struct frame { /* * Frame used for pcb_wscratch. */ -struct wsframe { - u_long wsf_local[8]; - u_long wsf_in[8]; - u_long wsf_sp; - u_long wsf_inuse; +struct rwindow { + u_long rw_local[8]; + u_long rw_in[8]; }; +struct proc; + +int rwindow_save(struct proc *p); +int rwindow_load(struct proc *p, struct trapframe *tf, int n); + int kdb_trap(struct trapframe *tf); #endif /* !_MACHINE_FRAME_H_ */ |