diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/kmi/assert.h | 2 | ||||
| -rw-r--r-- | include/kmi/regions.h | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/kmi/assert.h b/include/kmi/assert.h index ecf5272..14e0679 100644 --- a/include/kmi/assert.h +++ b/include/kmi/assert.h @@ -18,6 +18,7 @@ * Catastrophic assertions warn about the assertion and crash the kernel. */ +#include <kmi/power.h> #include <kmi/debug.h> #include <kmi/utils.h> @@ -35,6 +36,7 @@ if (unlikely(!(x))) { \ error("assertion failed: " #x "\n"); \ while (1) { \ + poweroff(SYS_COLD_REBOOT); \ } \ } \ } while (0); diff --git a/include/kmi/regions.h b/include/kmi/regions.h index ebaa07a..5167d28 100644 --- a/include/kmi/regions.h +++ b/include/kmi/regions.h @@ -78,6 +78,8 @@ struct mem_region_root { * track of free and used regions, respectively. All regions are chained * together with a doubly linked list, so that the next region's start address * should be the current region's end address. + * + * Note that addresses are expressed in pages! */ struct mem_region { /** Sp-tree node slot. */ @@ -98,6 +100,11 @@ struct mem_region { /** In shared regions, mark the other pid that shared the region. */ id_t pid; + union { + vm_t shaddr; + size_t refcount; + }; + /** Memory region flags, both access as well as metadata. \see MR_USED, * MR_SHARED, MR_OWNED, MR_COW, MR_KEEP. */ vmflags_t flags; |
