Skip to content

Commit 6fadc5e

Browse files
committed
gem5: get /m5ops.out working on arm
1 parent e269429 commit 6fadc5e

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

kernel_module/user/m5ops.c

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,39 @@
55
#include <stdlib.h>
66

77
#define ENABLED 1
8-
#if defined(__aarch64__)
8+
#if defined(__arm__)
99
static void m5_checkpoint()
1010
{
11-
__asm__ __volatile__ ("mov x0, 0; mov x1, 0; .inst 0xff000110 | (0x43 << 16);");
11+
__asm__ __volatile__ ("mov r0, #0; mov r1, #0; .inst 0xEE000110 | (0x43 << 16);");
1212
};
1313
static void m5_dump_stats()
1414
{
15-
__asm__ __volatile__ ("mov x0, 0; mov x1, 0; .inst 0xff000110 | (0x41 << 16);");
15+
__asm__ __volatile__ ("mov r0, #0; mov r1, #0; .inst 0xEE000110 | (0x41 << 16);");
1616
};
1717
static void m5_exit()
1818
{
19-
__asm__ __volatile__ ("mov x0, 0; .inst 0xff000110 | (0x21 << 16);");
19+
__asm__ __volatile__ ("mov r0, #0; .inst 0xEE000110 | (0x21 << 16);");
2020
};
2121
static void m5_reset_stats()
2222
{
23-
__asm__ __volatile__ ("mov x0, 0; mov x1, 0; .inst 0xff000110 | (0x40 << 16);");
23+
__asm__ __volatile__ ("mov r0, #0; mov r1, #0; .inst 0xEE000110 | (0x40 << 16);");
24+
};
25+
#elif defined(__aarch64__)
26+
static void m5_checkpoint()
27+
{
28+
__asm__ __volatile__ ("mov x0, #0; mov x1, #0; .inst 0xFF000110 | (0x43 << 16);");
29+
};
30+
static void m5_dump_stats()
31+
{
32+
__asm__ __volatile__ ("mov x0, #0; mov x1, #0; .inst 0xFF000110 | (0x41 << 16);");
33+
};
34+
static void m5_exit()
35+
{
36+
__asm__ __volatile__ ("mov x0, #0; .inst 0XFF000110 | (0x21 << 16);");
37+
};
38+
static void m5_reset_stats()
39+
{
40+
__asm__ __volatile__ ("mov x0, #0; mov x1, #0; .inst 0XFF000110 | (0x40 << 16);");
2441
};
2542
#else
2643
#undef ENABLED
@@ -35,7 +52,7 @@ void
3552
#endif
3653
)
3754
{
38-
#if defined(__aarch64__)
55+
#if ENABLED
3956
char action;
4057
if (argc > 1) {
4158
action = argv[1][0];

0 commit comments

Comments
 (0)