From 341290a2665ca8ccec27d9611e09118c760d1551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Thu, 26 Sep 2013 17:00:50 +0200 Subject: [PATCH] trace: implement timestamp also for ARMv6 Fixes #894. --- os/include/arm_v6/trace/timestamp.h | 33 ++++++++++++++++++++ os/include/{arm => arm_v7}/trace/timestamp.h | 0 2 files changed, 33 insertions(+) create mode 100644 os/include/arm_v6/trace/timestamp.h rename os/include/{arm => arm_v7}/trace/timestamp.h (100%) diff --git a/os/include/arm_v6/trace/timestamp.h b/os/include/arm_v6/trace/timestamp.h new file mode 100644 index 0000000000..8e4d2aae39 --- /dev/null +++ b/os/include/arm_v6/trace/timestamp.h @@ -0,0 +1,33 @@ +/* + * \brief Trace timestamp + * \author Stefan Kalkowski + * \date 2013-08-20 + * + * Serialized reading of performance counter on ARM. + */ + +/* + * Copyright (C) 2013 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU General Public License version 2. + */ + +#ifndef _INCLUDE__TRACE_TIMESTAMP_H_ +#define _INCLUDE__TRACE_TIMESTAMP_H_ + +#include + +namespace Genode { namespace Trace { + + typedef uint32_t Timestamp; + + inline Timestamp timestamp() + { + uint32_t t; + asm volatile("mrc p15, 0, %0, c15, c12, 1" : "=r"(t)); + return t; + } +} } + +#endif /* _INCLUDE__TRACE_TIMESTAMP_H_ */ diff --git a/os/include/arm/trace/timestamp.h b/os/include/arm_v7/trace/timestamp.h similarity index 100% rename from os/include/arm/trace/timestamp.h rename to os/include/arm_v7/trace/timestamp.h