diff options
| author | Ian Moffett <ian@osmora.org> | 2025-12-22 20:02:03 -0500 |
|---|---|---|
| committer | Ian Moffett <ian@osmora.org> | 2025-12-22 20:02:09 -0500 |
| commit | 982c66a2104a3eaaa41bf7e0e79c772a3d8994dd (patch) | |
| tree | fe5ec25b5d0fc667c047c7a4e96c82a23df961b9 | |
| parent | 6c49129750fc2d8778d30f623b0a1ea22fa79328 (diff) | |
mos: bpt: Add bpt_kernel_base() helper
Signed-off-by: Ian Moffett <ian@osmora.org>
| -rw-r--r-- | mos/sys/inc/kern/bpt.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mos/sys/inc/kern/bpt.h b/mos/sys/inc/kern/bpt.h index 3e3c3f2..e343f7b 100644 --- a/mos/sys/inc/kern/bpt.h +++ b/mos/sys/inc/kern/bpt.h @@ -8,6 +8,7 @@ #include <sdk/types.h> #include <sdk/status.h> +#include <sdk/defs.h> /* * Represents memory map entry types @@ -80,4 +81,16 @@ MOS_STATUS bpt_get_mementry(USIZE index, BPT_MEMENTRY *res); */ MOS_STATUS bpt_init(void); +ALWAYS_INLINE static inline UPTR +bpt_kernel_base(void) +{ + BPT_VARS vars; + + if (bpt_get_vars(&vars) != STATUS_SUCCESS) { + return 0; + } + + return vars.kernel_base; +} + #endif /* !_KERN_BPT_H_ */ |
