Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Mar 2016 17:20:33 -0400
From:      Paul Mather <paul@gromit.dlib.vt.edu>
To:        freebsd-arm <freebsd-arm@freebsd.org>
Subject:   filemon module on BeagleBone Black and cp15_pmccntr_get()
Message-ID:  <3875EACE-DAD6-41EF-A301-664CEDE35137@gromit.dlib.vt.edu>

next in thread | raw e-mail | index | archive | help
I just tried building the filemon kernel module on FreeBSD/arm =
11-CURRENT (r296804) on my BeagleBone Black.  It fails:

root@beaglebone:/usr/src/sys/modules/filemon # make
cc -O -pipe -mfloat-abi=3Dsoftfp  -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__=3D__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=3Dnone  -std=3Diso9899: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@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 =3D=3D 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=3D=3D6, 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=3D=3D6?  Is the CPU_ARM1176 =
CPU the only __ARM_ARCH=3D=3D6 CPU that supports these operations?

Cheers,

Paul.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3875EACE-DAD6-41EF-A301-664CEDE35137>