ptos/amd64+ke: Add system call groundwork + exit syscall
Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#define TRAP_STACK_SEG_FAULT 0x0C
|
||||
#define TRAP_GENERAL_PROTECTION 0x0D
|
||||
#define TRAP_PAGE_FAULT 0x0E
|
||||
#define TRAP_SYSCALL 0x2E
|
||||
|
||||
/* Prototypes of trap functions */
|
||||
VOID TrapDivError(VOID);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (c) 2026, Chloe M.
|
||||
* Provided under the BSD-3 clause.
|
||||
*
|
||||
* Description: System calls
|
||||
* Author: Chloe M.
|
||||
*/
|
||||
|
||||
#ifndef _KE_SYSCALL_H_
|
||||
#define _KE_SYSCALL_H_ 1
|
||||
|
||||
#include <ptapi/status.h>
|
||||
#include <ptapi/syscall.h>
|
||||
#include <ptdef.h>
|
||||
|
||||
/*
|
||||
* System call arguments passed to system call handlers
|
||||
*/
|
||||
typedef struct {
|
||||
UQUAD Arg[6];
|
||||
} SYSCALL_ARGS;
|
||||
|
||||
extern PT_STATUS(*SystemCallTable[_SYSCALL_MAX])(SYSCALL_ARGS *Args);
|
||||
|
||||
#endif /* !_KE_SYSCALL_H_ */
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (c) 2026, Chloe M.
|
||||
* Provided under the BSD-3 clause.
|
||||
*
|
||||
* Description: Process related user-API
|
||||
* Author: Chloe M.
|
||||
*/
|
||||
|
||||
#ifndef _PS_UAPI_H_
|
||||
#define _PS_UAPI_H_ 1
|
||||
|
||||
#include <ps/thread.h>
|
||||
#include <ke/syscall.h>
|
||||
|
||||
/*
|
||||
* Exit the current thread:
|
||||
*
|
||||
* @ARG[0]: Exit status code
|
||||
*/
|
||||
PT_STATUS PsSysThreadExit(SYSCALL_ARGS *Args);
|
||||
|
||||
#endif /* !_PS_UAPI_H_ */
|
||||
Reference in New Issue
Block a user