mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
play a bit with the ARM PMU
This commit is contained in:
11
lkmc.c
11
lkmc.c
@@ -57,6 +57,17 @@ void lkmc_assert_memcmp(
|
||||
}
|
||||
}
|
||||
|
||||
void __attribute__ ((noinline)) lkmc_busy_loop(
|
||||
unsigned long long max,
|
||||
unsigned long long max2
|
||||
) {
|
||||
for (unsigned long long i = 0; i < max2; i++) {
|
||||
for (unsigned long long j = 0; j < max; j++) {
|
||||
__asm__ __volatile__ ("" : "+g" (i), "+g" (j) : :);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void lkmc_print_hex_32(uint32_t x) {
|
||||
printf("0x%08" PRIX32, x);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user