forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We currently don't really populate most of the fields, but that can wait :^)
- Loading branch information
1 parent
585054d
commit 4bd01b7
Showing
12 changed files
with
406 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright (c) 2022, Ali Mohammad Pur <[email protected]> | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <Kernel/API/POSIX/sys/types.h> | ||
#include <Kernel/Arch/mcontext.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef struct __mcontext mcontext_t; | ||
|
||
typedef struct __ucontext { | ||
struct __ucontext* uc_link; | ||
sigset_t uc_sigmask; | ||
stack_t uc_stack; | ||
mcontext_t uc_mcontext; | ||
} ucontext_t; | ||
|
||
#define ILL_ILLOPC 0 | ||
#define ILL_ILLOPN 1 | ||
#define ILL_ILLADR 2 | ||
#define ILL_ILLTRP 3 | ||
#define ILL_PRVOPC 4 | ||
#define ILL_PRVREG 5 | ||
#define ILL_COPROC 6 | ||
#define ILL_BADSTK 7 | ||
|
||
#define FPE_INTDIV 0 | ||
#define FPE_INTOVF 1 | ||
#define FPE_FLTDIV 2 | ||
#define FPE_FLTOVF 3 | ||
#define FPE_FLTUND 4 | ||
#define FPE_FLTRES 5 | ||
#define FPE_FLTINV 6 | ||
|
||
#define SEGV_MAPERR 0 | ||
#define SEGV_ACCERR 1 | ||
|
||
#define BUS_ADRALN 0 | ||
#define BUS_ADRERR 1 | ||
#define BUS_OBJERR 2 | ||
|
||
#define TRAP_BRKPT 0 | ||
#define TRAP_TRACE 1 | ||
|
||
#define SI_USER 0x40000000 | ||
#define SI_QUEUE 0x40000001 | ||
#define SI_TIMER 0x40000002 | ||
#define SI_ASYNCIO 0x40000003 | ||
#define SI_MESGQ 0x40000004 | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright (c) 2022, the SerenityOS developers. | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <AK/Platform.h> | ||
|
||
#if ARCH(X86_64) || ARCH(I386) | ||
# include <Kernel/Arch/x86/mcontext.h> | ||
#elif ARCH(AARCH64) | ||
# error "Unknown architecture" | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (c) 2022, the SerenityOS developers. | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <AK/Platform.h> | ||
#include <Kernel/API/POSIX/sys/types.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
struct __attribute__((packed)) __mcontext { | ||
#if ARCH(I386) | ||
uint32_t eax; | ||
uint32_t ecx; | ||
uint32_t edx; | ||
uint32_t ebx; | ||
uint32_t esp; | ||
uint32_t ebp; | ||
uint32_t esi; | ||
uint32_t edi; | ||
uint32_t eip; | ||
uint32_t eflags; | ||
#else | ||
uint64_t rax; | ||
uint64_t rcx; | ||
uint64_t rdx; | ||
uint64_t rbx; | ||
uint64_t rsp; | ||
uint64_t rbp; | ||
uint64_t rsi; | ||
uint64_t rdi; | ||
uint64_t rip; | ||
uint64_t r8; | ||
uint64_t r9; | ||
uint64_t r10; | ||
uint64_t r11; | ||
uint64_t r12; | ||
uint64_t r13; | ||
uint64_t r14; | ||
uint64_t r15; | ||
uint64_t rflags; | ||
#endif | ||
uint32_t cs; | ||
uint32_t ss; | ||
uint32_t ds; | ||
uint32_t es; | ||
uint32_t fs; | ||
uint32_t gs; | ||
}; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.