Date: Fri, 27 Mar 2015 08:47:17 +0000 (UTC) From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280737 - in head/sys: arm/include dev/hwpmc Message-ID: <201503270847.t2R8lHrI021245@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bz Date: Fri Mar 27 08:47:16 2015 New Revision: 280737 URL: https://svnweb.freebsd.org/changeset/base/280737 Log: 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 Modified: head/sys/arm/include/pmc_mdep.h head/sys/dev/hwpmc/hwpmc_arm.c Modified: head/sys/arm/include/pmc_mdep.h ============================================================================== --- head/sys/arm/include/pmc_mdep.h Fri Mar 27 08:47:02 2015 (r280736) +++ head/sys/arm/include/pmc_mdep.h Fri Mar 27 08:47:16 2015 (r280737) @@ -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) \ Modified: head/sys/dev/hwpmc/hwpmc_arm.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_arm.c Fri Mar 27 08:47:02 2015 (r280736) +++ head/sys/dev/hwpmc/hwpmc_arm.c Fri Mar 27 08:47:16 2015 (r280737) @@ -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>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503270847.t2R8lHrI021245>