Skip to content

Commit 2e06543

Browse files
committed
test: limine.c now uses outw() for QEMU-specific fast path shutdown.
1 parent 5b05e90 commit 2e06543

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/limine.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
int memcmp(const void *, const void *, size_t);
1010

11+
static inline void outw(uint16_t port, uint16_t value) {
12+
asm volatile ("outw %%ax, %1" : : "a" (value), "Nd" (port) : "memory");
13+
}
14+
1115
__attribute__((section(".limine_requests")))
1216
static volatile uint64_t limine_base_revision[] = LIMINE_BASE_REVISION(6);
1317

@@ -742,5 +746,6 @@ FEAT_START
742746
e9_printf("Exec time: %d usec", perf_response->exec_usec);
743747
FEAT_END
744748

749+
outw(0x604, 0x2000); /* QEMU-specific shutdown, used by automated tests. */
745750
for (;;);
746751
}

0 commit comments

Comments
 (0)