From 82d56ef77c114ac0b375fef04cea3a50f10f1843 Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Tue, 22 Nov 2022 15:03:02 +0100 Subject: Improved single stepping and added initial cpuid events --- test/access-detect_guest.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/access-detect_guest.c (limited to 'test/access-detect_guest.c') diff --git a/test/access-detect_guest.c b/test/access-detect_guest.c new file mode 100644 index 0000000..442c88c --- /dev/null +++ b/test/access-detect_guest.c @@ -0,0 +1,26 @@ +#include "cachepc/uapi.h" + +#include +#include +#include +#include +#include + +int +main(int argc, const char **argv) +{ + void *buf; + + buf = NULL; + if (posix_memalign(&buf, L1_LINESIZE * L1_SETS, L1_LINESIZE * L1_SETS)) + err(1, "memalign"); + memset(buf, 0, L1_LINESIZE * L1_SETS); + + while (1) { + CPC_CPUID_SIGNAL(CPC_CPUID_START_TRACK, 0); + + *(uint8_t *)(buf + L1_LINESIZE * 5) += 1; + + CPC_CPUID_SIGNAL(CPC_CPUID_START_TRACK, 0); + } +} -- cgit v1.2.3-71-gd317