Rather than defining our own magic checks here use INKERNEL() for

the PMC_IN_KERNEL() macro definition.

Add missing macros to extract the return address (LR) from the trapframe.

Discussed with:	andrew
Obtained from:	Cambridge/L41
Sponsored by:	DARPA, AFRL
MFC after:	2 weeks
This commit is contained in:
bz 2015-03-27 08:47:16 +00:00
parent 4fddf178d3
commit 9632944658
2 changed files with 4 additions and 2 deletions

View File

@ -56,8 +56,7 @@ union pmc_md_pmc {
#define PMC_IN_KERNEL_STACK(S,START,END) \
((S) >= (START) && (S) < (END))
#define PMC_IN_KERNEL(va) (((va) >= USRSTACK) && \
((va) < VM_MAX_KERNEL_ADDRESS))
#define PMC_IN_KERNEL(va) INKERNEL((va))
#define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS)
@ -65,6 +64,8 @@ union pmc_md_pmc {
#define PMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_r11)
#define PMC_TRAPFRAME_TO_SVC_SP(TF) ((TF)->tf_svc_sp)
#define PMC_TRAPFRAME_TO_USR_SP(TF) ((TF)->tf_usr_sp)
#define PMC_TRAPFRAME_TO_SVC_LR(TF) ((TF)->tf_svc_lr)
#define PMC_TRAPFRAME_TO_USR_LR(TF) ((TF)->tf_usr_lr)
/* Build a fake kernel trapframe from current instruction pointer. */
#define PMC_FAKE_TRAPFRAME(TF) \

View File

@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include <machine/cpu.h>
#include <machine/md_var.h>
#include <machine/pmc_mdep.h>
#include <machine/stack.h>
#include <vm/vm.h>
#include <vm/vm_param.h>