mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
arch: regs: add abstractions to manipulate errno and return regs
This commit is contained in:
@@ -4,6 +4,8 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
typedef uint64_t arch_reg;
|
||||||
|
|
||||||
typedef struct{
|
typedef struct{
|
||||||
uint64_t gsbase, fsbase;
|
uint64_t gsbase, fsbase;
|
||||||
uint8_t fx[512];
|
uint8_t fx[512];
|
||||||
@@ -17,4 +19,12 @@ void arch_regs_setupextra(arch_extraregs* regs);
|
|||||||
void arch_regs_setupkernel(arch_regs* regs, void* ip, void* stack, bool interrupts);
|
void arch_regs_setupkernel(arch_regs* regs, void* ip, void* stack, bool interrupts);
|
||||||
void arch_regs_setupuser(arch_regs* regs, void* ip, void* stack, bool interrupts);
|
void arch_regs_setupuser(arch_regs* regs, void* ip, void* stack, bool interrupts);
|
||||||
|
|
||||||
|
static inline void arch_regs_setret(arch_regs* regs, arch_reg reg){
|
||||||
|
regs->rax = reg;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void arch_regs_seterrno(arch_regs* regs, arch_reg reg){
|
||||||
|
regs->rdx = reg;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user