stos: pool: Add pool allocation header + tag usage
Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
@@ -32,6 +32,9 @@
|
||||
#define POOL_REAL_PAGESZ \
|
||||
(PAGESIZE - sizeof(MEMORY_PAGE))
|
||||
|
||||
/* Used to prevent corruption */
|
||||
#define POOL_MAGIC 0xCA7F00D
|
||||
|
||||
/*
|
||||
* Valid pool types
|
||||
*
|
||||
@@ -41,6 +44,20 @@ typedef enum {
|
||||
POOL_NON_PAGED
|
||||
} POOL_TYPE;
|
||||
|
||||
/*
|
||||
* Represents the header that goes before each returned
|
||||
* and allocated block.
|
||||
*
|
||||
* @Magic: Magic numbers
|
||||
* @MemoryTag: Tag assigned at allocation
|
||||
* @Length: Length of memory allocation
|
||||
*/
|
||||
typedef struct PACKED {
|
||||
ULONG Magic;
|
||||
ULONG MemoryTag;
|
||||
USIZE Length;
|
||||
} MEMORY_HEADER;
|
||||
|
||||
/*
|
||||
* Page data structure used internally to link together page
|
||||
* lists
|
||||
|
||||
Reference in New Issue
Block a user