1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 06:34:57 +00:00

Kernel/riscv64: Add register state related headers

This commit is contained in:
Sönke Holz 2023-10-27 12:24:23 +02:00 committed by Andrew Kaster
parent 978cc1c197
commit 24e64cac7e
10 changed files with 260 additions and 0 deletions

View file

@ -12,4 +12,6 @@
# include "x86_64/regs.h"
#elif ARCH(AARCH64)
# include "aarch64/regs.h"
#elif ARCH(RISCV64)
# include "riscv64/regs.h"
#endif

View file

@ -0,0 +1,46 @@
/*
* Copyright (c) 2023, Sönke Holz <sholz8530@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Platform.h>
#if defined(__cplusplus) && defined(__cpp_concepts)
# include <AK/Types.h>
#else
# include <sys/types.h>
#endif
#include <Kernel/Arch/mcontext.h>
#ifdef __cplusplus
struct [[gnu::packed]] PtraceRegisters : public __mcontext {
# if defined(__cplusplus) && defined(__cpp_concepts)
FlatPtr ip() const
{
return pc;
}
void set_ip(FlatPtr ip)
{
pc = ip;
}
FlatPtr bp() const
{
return x[7];
}
void set_bp(FlatPtr bp)
{
x[7] = bp;
}
# endif
};
#else
typedef struct __mcontext PthreadRegisters;
#endif