31 lines
1022 B
C++
31 lines
1022 B
C++
/*
|
|
* S3State.hpp
|
|
* CPU state saved across S3 by S3Wake.asm
|
|
* Copyright (c) 2026 Daniel Hammer
|
|
*/
|
|
|
|
#pragma once
|
|
#include <cstdint>
|
|
|
|
namespace Hal {
|
|
namespace AcpiSleep {
|
|
|
|
// ============================================================================
|
|
// Layout must match S3Wake.asm offsets exactly.
|
|
// No FPU/SSE state — the kernel is compiled with -mno-sse.
|
|
struct CpuState {
|
|
uint64_t Rax, Rbx, Rcx, Rdx; // 0x00 - 0x18
|
|
uint64_t Rsi, Rdi, Rbp, Rsp; // 0x20 - 0x38
|
|
uint64_t R8, R9, R10, R11; // 0x40 - 0x58
|
|
uint64_t R12, R13, R14, R15; // 0x60 - 0x78
|
|
uint64_t Rflags; // 0x80
|
|
uint64_t Rip; // 0x88
|
|
uint64_t Cr3; // 0x90
|
|
uint64_t Cr0, Cr4; // 0x98, 0xA0
|
|
uint8_t GdtPtr[10]; // 0xA8
|
|
uint8_t IdtPtr[10]; // 0xB2
|
|
} __attribute__((aligned(16)));
|
|
|
|
};
|
|
};
|