2022-11-15 19:10:32 +01:00
|
|
|
#pragma once
|
2022-12-04 12:42:43 +01:00
|
|
|
#include <luna/Result.h>
|
2022-11-15 19:10:32 +01:00
|
|
|
|
2022-11-16 17:37:18 +01:00
|
|
|
struct Registers;
|
|
|
|
|
2022-11-15 19:10:32 +01:00
|
|
|
namespace CPU
|
|
|
|
{
|
|
|
|
Result<const char*> identify();
|
2022-11-18 21:04:53 +01:00
|
|
|
const char* platform_string();
|
|
|
|
|
2022-11-15 19:10:32 +01:00
|
|
|
void platform_init();
|
2022-11-19 20:01:01 +01:00
|
|
|
void platform_finish_init();
|
2022-11-15 19:10:32 +01:00
|
|
|
|
|
|
|
[[noreturn]] void efficient_halt();
|
2022-11-15 20:41:59 +01:00
|
|
|
|
2022-12-07 14:46:56 +01:00
|
|
|
[[noreturn]] void idle_loop();
|
2022-12-07 12:26:09 +01:00
|
|
|
|
2022-11-15 20:41:59 +01:00
|
|
|
void switch_kernel_stack(u64 top);
|
2022-11-19 20:01:01 +01:00
|
|
|
|
|
|
|
void enable_interrupts();
|
|
|
|
void disable_interrupts();
|
|
|
|
void wait_for_interrupt();
|
2022-12-07 17:39:59 +01:00
|
|
|
|
|
|
|
void get_stack_trace(void (*callback)(u64, void*), void* arg);
|
2022-12-07 18:11:24 +01:00
|
|
|
void print_stack_trace();
|
2022-12-07 17:39:59 +01:00
|
|
|
void get_stack_trace_at(Registers* regs, void (*callback)(u64, void*), void* arg);
|
2022-12-07 18:11:24 +01:00
|
|
|
void print_stack_trace_at(Registers* regs);
|
2022-12-17 10:45:55 +01:00
|
|
|
|
|
|
|
void pause();
|
2022-12-07 15:55:58 +01:00
|
|
|
}
|