diff options
author | Ian Moffett <ian@osmora.org> | 2025-05-14 22:44:47 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-05-14 22:44:47 -0400 |
commit | 9497b090cc1b53cea119b14d8b68d305cc2c73e0 (patch) | |
tree | 50b0d5cded6428f28a495b437fce23d9702c1893 /sys | |
parent | f470348df79c8dba142deccdbba74682ffc0c972 (diff) |
kernel: mach: Add TF_IP() macro
Add TF_IP() to extract the instruction pointer from a trapframe between
architectures.
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/include/arch/aarch64/frame.h | 2 | ||||
-rw-r--r-- | sys/include/arch/amd64/frame.h | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/sys/include/arch/aarch64/frame.h b/sys/include/arch/aarch64/frame.h index ec11533..fa4d33d 100644 --- a/sys/include/arch/aarch64/frame.h +++ b/sys/include/arch/aarch64/frame.h @@ -93,4 +93,6 @@ struct trapframe { lreg_t pc; }; +#define TF_IP(TFP) ((TFP)->pc) + #endif /* !_MACHINE_FRAME_H_ */ diff --git a/sys/include/arch/amd64/frame.h b/sys/include/arch/amd64/frame.h index 31dcdef..2bd9a7c 100644 --- a/sys/include/arch/amd64/frame.h +++ b/sys/include/arch/amd64/frame.h @@ -58,4 +58,6 @@ struct trapframe { uint64_t ss; }; +#define TF_IP(TFP) ((TFP)->rip) + #endif /* !_MACHINE_FRAME_H_ */ |