hwpmc: use kstack_contains()
This existing helper function is preferable to the hand-rolled calculation of the kstack bounds. Make some small style improvements while here. Notably, rename every instance of "r", the return address, to "ra". Tidy the includes in the affected files. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39909
This commit is contained in:
@@ -52,11 +52,9 @@ union pmc_md_pmc {
|
||||
struct pmc_md_armv7_pmc pm_armv7;
|
||||
};
|
||||
|
||||
#define PMC_IN_KERNEL_STACK(S,START,END) \
|
||||
((S) >= (START) && (S) < (END))
|
||||
#define PMC_IN_KERNEL_STACK(va) kstack_contains(curthread, (va), sizeof(va))
|
||||
#define PMC_IN_KERNEL(va) INKERNEL((va))
|
||||
|
||||
#define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS)
|
||||
#define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS)
|
||||
|
||||
#define PMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_pc)
|
||||
#define PMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_r11)
|
||||
|
||||
Reference in New Issue
Block a user