summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-12-22 20:02:03 -0500
committerIan Moffett <ian@osmora.org>2025-12-22 20:02:09 -0500
commit982c66a2104a3eaaa41bf7e0e79c772a3d8994dd (patch)
treefe5ec25b5d0fc667c047c7a4e96c82a23df961b9
parent6c49129750fc2d8778d30f623b0a1ea22fa79328 (diff)
mos: bpt: Add bpt_kernel_base() helper
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r--mos/sys/inc/kern/bpt.h13
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_ */