Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/include/counter.h
Show All 20 Lines | |||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifdef __arm__ | |||||
#include <arm/counter.h> | |||||
#else /* !__arm__ */ | |||||
#ifndef _MACHINE_COUNTER_H_ | #ifndef _MACHINE_COUNTER_H_ | ||||
#define _MACHINE_COUNTER_H_ | #define _MACHINE_COUNTER_H_ | ||||
#include <sys/pcpu.h> | #include <sys/pcpu.h> | ||||
#include <machine/atomic.h> | #include <machine/atomic.h> | ||||
#define EARLY_COUNTER &pcpu0.pc_early_dummy_counter | #define EARLY_COUNTER &pcpu0.pc_early_dummy_counter | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
static inline void | static inline void | ||||
counter_u64_add(counter_u64_t c, int64_t inc) | counter_u64_add(counter_u64_t c, int64_t inc) | ||||
{ | { | ||||
atomic_add_64((uint64_t *)zpcpu_get(c), inc); | atomic_add_64((uint64_t *)zpcpu_get(c), inc); | ||||
} | } | ||||
#endif /* ! _MACHINE_COUNTER_H_ */ | #endif /* ! _MACHINE_COUNTER_H_ */ | ||||
#endif /* !__arm__ */ |