filemon module on BeagleBone Black and cp15_pmccntr_get()

Paul Mather paul at gromit.dlib.vt.edu
Sun Mar 13 21:20:35 UTC 2016


I just tried building the filemon kernel module on FreeBSD/arm 11-CURRENT (r296804) on my BeagleBone Black.  It fails:

root at beaglebone:/usr/src/sys/modules/filemon # make
cc -O -pipe -mfloat-abi=softfp  -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/usr/src/sys/modules/filemon/../.. -fno-common  -funwind-tables  -MD -MP -MF.depend.filemon.o -MTfilemon.o -ffreestanding -fwrapv -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__  -Wmissing-include-dirs -fdiagnostics-show-option  -Wno-unknown-pragmas  -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality -Wno-error-unused-function  -Wno-error-pointer-sign -Wno-error-shift-negative-value  -mno-movt -mfpu=none  -std=iso9899:1999 -c /usr/src/sys/modules/filemon/../../dev/filemon/filemon.c -o filemon.o
In file included from /usr/src/sys/modules/filemon/../../dev/filemon/filemon.c:37:
In file included from /usr/src/sys/modules/filemon/../../sys/buf.h:263:
In file included from /usr/src/sys/modules/filemon/../../sys/proc.h:66:
In file included from /usr/src/sys/modules/filemon/../../sys/_vm_domain.h:34:
In file included from /usr/src/sys/modules/filemon/../../sys/seq.h:70:
./machine/cpu.h:48:10: error: implicit declaration of function
      'cp15_pmccntr_get' is invalid in C99
      [-Werror,-Wimplicit-function-declaration]
                return cp15_pmccntr_get();
                       ^
1 error generated.
*** Error code 1

Stop.
make: stopped in /usr/src/sys/modules/filemon
root at beaglebone:/usr/src/sys/modules/filemon #


I notice that cp15_pmcr_get() is defined in /usr/src/sys/arm/include/cpu-v6.h:

[[...]]
/* Performance Monitor registers */

#if __ARM_ARCH == 6 && defined(CPU_ARM1176)
_RF0(cp15_pmuserenr_get, CP15_PMUSERENR(%0))
_WF1(cp15_pmuserenr_set, CP15_PMUSERENR(%0))
_RF0(cp15_pmcr_get, CP15_PMCR(%0))
_WF1(cp15_pmcr_set, CP15_PMCR(%0))
_RF0(cp15_pmccntr_get, CP15_PMCCNTR(%0))
_WF1(cp15_pmccntr_set, CP15_PMCCNTR(%0))
#elif __ARM_ARCH > 6
_RF0(cp15_pmcr_get, CP15_PMCR(%0))
_WF1(cp15_pmcr_set, CP15_PMCR(%0))
_RF0(cp15_pmcnten_get, CP15_PMCNTENSET(%0))
_WF1(cp15_pmcnten_set, CP15_PMCNTENSET(%0))
_WF1(cp15_pmcnten_clr, CP15_PMCNTENCLR(%0))
_RF0(cp15_pmovsr_get, CP15_PMOVSR(%0))
_WF1(cp15_pmovsr_set, CP15_PMOVSR(%0))
_WF1(cp15_pmswinc_set, CP15_PMSWINC(%0))
_RF0(cp15_pmselr_get, CP15_PMSELR(%0))
_WF1(cp15_pmselr_set, CP15_PMSELR(%0))
_RF0(cp15_pmccntr_get, CP15_PMCCNTR(%0))
_WF1(cp15_pmccntr_set, CP15_PMCCNTR(%0))
_RF0(cp15_pmxevtyper_get, CP15_PMXEVTYPER(%0))
_WF1(cp15_pmxevtyper_set, CP15_PMXEVTYPER(%0))
_RF0(cp15_pmxevcntr_get, CP15_PMXEVCNTRR(%0))
_WF1(cp15_pmxevcntr_set, CP15_PMXEVCNTRR(%0))
_RF0(cp15_pmuserenr_get, CP15_PMUSERENR(%0))
_WF1(cp15_pmuserenr_set, CP15_PMUSERENR(%0))
_RF0(cp15_pminten_get, CP15_PMINTENSET(%0))
_WF1(cp15_pminten_set, CP15_PMINTENSET(%0))
_WF1(cp15_pminten_clr, CP15_PMINTENCLR(%0))
#endif


If I read that right, for __ARM_ARCH==6, cp15_pmccntr_get() is only defined for CPU types CPU_ARM1176, i.e. those in the Raspberry Pi.  Isn't the BeagleBone Black also __ARM_ARCH==6?  Is the CPU_ARM1176 CPU the only __ARM_ARCH==6 CPU that supports these operations?

Cheers,

Paul.


More information about the freebsd-arm mailing list