4 #include "cpu-features.h"
6 static void panic(const char* msg
) {
7 fprintf(stderr
, "ERROR: %s\n", msg
);
12 int count
, cpu_count
= 10;
13 uint64_t features
, cpu_features
= 0xaabdedf012934839ULL
;
15 count
= android_getCpuCount();
16 features
= android_getCpuFeatures();
18 printf("Retrieved cpu_count=%d, features=%08llx\n",
21 // Check that android_setCpu() will fail when it is called after
22 // android_getCpuCount / android_getCpuFeatures.
24 printf("Trying to set cpu_count=%d, features=%08llx\n",
28 if (android_setCpu(cpu_count
, cpu_features
))
29 panic("android_setCpu() call should have failed!");
31 printf("android_setCpu() call fail as expected.\n");