diff options
Diffstat (limited to 'lib/libjove/include/arch/x86_64/object-pagemap.h')
-rw-r--r-- | lib/libjove/include/arch/x86_64/object-pagemap.h | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/lib/libjove/include/arch/x86_64/object-pagemap.h b/lib/libjove/include/arch/x86_64/object-pagemap.h index 55b0570..48e959e 100644 --- a/lib/libjove/include/arch/x86_64/object-pagemap.h +++ b/lib/libjove/include/arch/x86_64/object-pagemap.h @@ -2,13 +2,51 @@ #define _LIBJOVE_ARCH_x86_64_OBJECT_PAGEMAP_H 1 #include <jove/object-typed.h> +#include <jove/object-dir.h> +#include <jove/object-untyped.h> -typedef struct KernelObjectPageMapping +typedef struct KernelObjectPageMap { KernelObjectTyped typed; - uint8_t level; -} KernelObjectPageMapping; +} KernelObjectPageMap; +KernelObjectPageMap *jove_object_as_pagemap(KernelObjectTyped *typed); +/**@FUNC Populates a given region of memory for a page map value. + * @PARAM pagemap address of pagemap cache object. + * @PARAM dir directory this memory is a member of. + * @PARAM memb index into directory to place object.*/ +void _jove_alloc_pagemap_inplace( + KernelObjectPageMap *pagemap, + KernelObjectDirectory *dir, + uint8_t memb); + +/**@FUNC Allocates a region of memory to represent a page map. + * @PARAM dir directory to place new value in. + * @PARAM memb index into directory to place object. + * @RETURN newly allocated object. NULL on failure. + * Possible failures: + * EJOVE_FULL: Slot is already taken by an existing object. + * EJOVE_NOALLOC: libjove does not have an allocator yet.*/ +KernelObjectPageMap* _jove_alloc_pagemap( + KernelObjectDirectory *dir, + uint8_t memb); + +int jove_pagemap_exists( + KernelObjectPageMap *map, + uint8_t depth, + uint16_t *path); + +JoveError jove_pagemap_map( + KernelObjectPageMap *map, + uint8_t depth, + uint16_t *path, + KernelObjectUntyped *page); + +JoveError jove_pagemap_map_unmap( + KernelObjectPageMap *map, + uint8_t depth, + uint16_t *path, + KernelObjectUntyped *dest); #endif |