From 9e0e01b7f4375063f06e494113187d48614628e0 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 30 Nov 2021 22:25:37 +0800 Subject: +init --- .../libfixmath/benchmarks/interface-arm.c | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Client/ThirdParty/libfixmath/benchmarks/interface-arm.c (limited to 'Client/ThirdParty/libfixmath/benchmarks/interface-arm.c') diff --git a/Client/ThirdParty/libfixmath/benchmarks/interface-arm.c b/Client/ThirdParty/libfixmath/benchmarks/interface-arm.c new file mode 100644 index 0000000..d0e9969 --- /dev/null +++ b/Client/ThirdParty/libfixmath/benchmarks/interface-arm.c @@ -0,0 +1,28 @@ +#include "interface.h" +#include +#include + +// This targets an ARM Cortex M3 core using QEmu LM3S6965 emulation. +#define STBASE 0xE000E000 +#define STCTRL (*(volatile uint32_t*)(0x010 + STBASE)) +#define STRELOAD (*(volatile uint32_t*)(0x014 + STBASE)) +#define STCURRENT (*(volatile uint32_t*)(0x018 + STBASE)) + + +void interface_init() +{ + STRELOAD = 0x00FFFFFF; + STCTRL = 5; +} + +void start_timing() +{ + STCURRENT = 0; +} + +uint16_t end_timing() +{ + return 0x00FFFFFF - STCURRENT - 4; +} + + -- cgit v1.1-26-g67d0