diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-08-09 17:35:26 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-08-09 17:35:26 +0300 |
| commit | 489beadf61d05f40dd4ac40e4e5290502f7ad078 (patch) | |
| tree | 58241d94c3376aae6b081c6fe16288aa0f4d8593 /tests/simple_torus3d/test.c | |
| parent | 1853f5d6594bc371e4d8e631c24acd011a620915 (diff) | |
| download | gran-489beadf61d05f40dd4ac40e4e5290502f7ad078.tar.gz gran-489beadf61d05f40dd4ac40e4e5290502f7ad078.zip | |
format
Diffstat (limited to 'tests/simple_torus3d/test.c')
| -rw-r--r-- | tests/simple_torus3d/test.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/simple_torus3d/test.c b/tests/simple_torus3d/test.c index 2953d41..646b387 100644 --- a/tests/simple_torus3d/test.c +++ b/tests/simple_torus3d/test.c @@ -6,7 +6,8 @@ static inline void print_int8(volatile char *uart, unsigned x) } __attribute__((always_inline)) -static inline void print_addr(volatile char *uart, unsigned x, unsigned y, unsigned z) +static inline void print_addr(volatile char *uart, unsigned x, unsigned y, + unsigned z) { *uart = '('; print_int8(uart, x); @@ -27,7 +28,8 @@ static inline unsigned wrap(unsigned x, unsigned X) } __attribute__((always_inline)) -static inline unsigned next_idx(unsigned x, unsigned y, unsigned z, unsigned X, unsigned Y, unsigned Z) +static inline unsigned next_idx(unsigned x, unsigned y, unsigned z, unsigned X, + unsigned Y, unsigned Z) { unsigned zi = wrap(z, Z); unsigned yi = zi < z ? wrap(y, Y) : y; @@ -36,7 +38,8 @@ static inline unsigned next_idx(unsigned x, unsigned y, unsigned z, unsigned X, return (xi << 16) | (yi << 8) | zi; } -void _start(unsigned x, unsigned y, unsigned z, unsigned X, unsigned Y, unsigned Z) +void _start(unsigned x, unsigned y, unsigned z, unsigned X, unsigned Y, + unsigned Z) { volatile char *uart = (char *)4096; /* x = 1ULL << 32, y = 1ULL << 40, z = 1ULL << 48 I guess */ @@ -54,7 +57,7 @@ do_work: *control = next_idx(x, y, z, X, Y, Z); if (x == X - 1 && y == Y - 1 && z == Z - 1) - asm("ebreak"); + asm ("ebreak"); /* otherwise just loop */ while (1) {} |
