problem with including if_var.h and cpu.h header in program, raspberry pi 2 B

on a raspberry pi 2 B that has FreeBSD 11.0-current on it, I need to have some kind of a network interface created (meaning that if for example ifconfig is typed, my network interface and its options must be shown alongside lo0 & ue0 ).

and to do just that, I need ifnet and other structures that are defined in if_var.h header. so I include this header in my program, but when I make the ( .c ) file, I get the following error:
In file included from cc2530.c:24:
In file included from /sys/net/if_var.h:74:
In file included from /sys/sys/buf_ring.h:33:
./machine/cpu.h:48:10: error : implicit declaration of function 'cp15_pmccntr_get' is invalid ...

one more thing to mention is that I even tested FreeBSD's usb_ethernet.c: I copy the ( .c ) file and its make file from their original directory to some other directory, and when I make it to see if this FreeBSD original driver can be compiled again exactly the same error appears and the point is that, this problem does not exist in amd64 architecture.

what do you think? any ideas, solutions?
i noticed something interesting, in one hand i have FreeBSD 11 on my raspberry and in the other i have it in my virtualbox.
(I had previously built the world and the kernel for my RPI2 by cross compiling on virtualbox )
now, I cd to /boot/kernel and then kldload ./uether.ko in both RPI2 and vbox.
in vbox the module gets loaded and i can see it after in kldstat, but in raspberry it says:
interface uether.1 already present in the KLD 'kernel'!
kldload: can't load ./uether.ko: module already loaded or in kernel

what does it mean? is it something about a cross compile?
How about cross compiling or build with poudriere or synth.
the kind of cross compile that i'm familiar with, as I said, is for building the kernel completely. and when you say cross compile do you mean the kind that I have done, or do you mean another?
is there a way to just cross compile my program?
What you say is correct. And in fact that is exactly what I have done so that Raspberry can detect my cc2530 and I can send and receive data. But what I am going to do now is to tell kernel that my chip is a network interface. How? By providing kernel with (ifnet) and (ifmedia) structures, the ifnet structure is defined in if_var.h and as the error message shows, including this header (in any program in ARM) leads to an implicit declaration of cp15_pmccntr_get().
And I don't know why?