Turnstone Operating System
|
frame allocator header More...
Classes | |
struct | frame_t |
frame definition More... | |
struct | frame_allocator_t |
frame allocator class More... | |
Macros | |
#define | ___MEMORY_FRAME_H 0 |
#define | FRAME_SIZE 4096 |
#define | FRAME_ATTRIBUTE_OLD_RESERVED 0x0000000100000000 |
#define | FRAME_ATTRIBUTE_ACPI_RECLAIM_MEMORY 0x0000000200000000 |
#define | FRAME_ATTRIBUTE_ACPI 0x0000000400000000 |
#define | FRAME_ATTRIBUTE_RESERVED_PAGE_MAPPED 0x0000000800000000 |
#define | frame_allocator_new() frame_allocator_new_ext(NULL); |
Typedefs | |
typedef enum frame_type_t | frame_type_t |
short hand for enum frame_type_e | |
typedef enum frame_allocation_type_t | frame_allocation_type_t |
short hand for enum frame_allocation_type_e | |
typedef struct frame_t | frame_t |
short hand for struct frame_s | |
typedef int8_t(* | fa_allocate_frame_by_count_f) (struct frame_allocator_t *self, uint64_t count, frame_allocation_type_t fa_type, frame_t **fs, uint64_t *alloc_list_size) |
allocate frame with count More... | |
typedef int8_t(* | fa_allocate_frame_f) (struct frame_allocator_t *self, frame_t *f) |
allocate frame with given reference frame, ref frame not used in anywhere as is. it is only for reference. More... | |
typedef int8_t(* | fa_release_frame_f) (struct frame_allocator_t *self, frame_t *f) |
release frame with given reference frame, ref frame not used in anywhere as is. it is only for reference. More... | |
typedef frame_t *(* | fa_get_reserved_frames_of_address_f) (struct frame_allocator_t *self, void *address) |
returns the frame that address resides or null More... | |
typedef int8_t(* | fa_cleanup_f) (struct frame_allocator_t *self) |
cleans old reserved frames More... | |
typedef int8_t(* | fa_reserve_system_frames_f) (struct frame_allocator_t *self, frame_t *f) |
reserve frames for mmio More... | |
typedef int8_t(* | fa_release_acpi_reclaim_memory_f) (struct frame_allocator_t *self) |
release frames with attribute FRAME_TYPE_ACPI_RECLAIM_MEMORY More... | |
typedef uint64_t(* | fa_get_total_frame_count_f) (struct frame_allocator_t *self) |
returns total frame count More... | |
typedef uint64_t(* | fa_get_allocated_frame_count_f) (struct frame_allocator_t *self) |
returns used frame count More... | |
typedef uint64_t(* | fa_get_free_frame_count_f) (struct frame_allocator_t *self) |
returns free frame count More... | |
typedef struct frame_allocator_t | frame_allocator_t |
short hand for struct frame_allocator_t | |
Enumerations | |
enum | frame_type_t { FRAME_TYPE_FREE , FRAME_TYPE_USED , FRAME_TYPE_RESERVED , FRAME_TYPE_ACPI_RECLAIM_MEMORY , FRAME_TYPE_ACPI_CODE , FRAME_TYPE_ACPI_DATA } |
frame types More... | |
enum | frame_allocation_type_t { FRAME_ALLOCATION_TYPE_RELAX = 1 << 1 , FRAME_ALLOCATION_TYPE_BLOCK = 1 << 2 , FRAME_ALLOCATION_TYPE_UNDER_4G = 1 << 3 , FRAME_ALLOCATION_TYPE_USED = 1 << 7 , FRAME_ALLOCATION_TYPE_RESERVED = 1 << 8 , FRAME_ALLOCATION_TYPE_OLD_RESERVED = 1 << 15 } |
frame allocation types More... | |
Functions | |
frame_allocator_t * | frame_allocator_new_ext (memory_heap_t *heap) |
creates a frame allocator More... | |
void | frame_allocator_print (frame_allocator_t *fa) |
prints frame allocator contents More... | |
void | frame_allocator_map_page_of_acpi_code_data_frames (frame_allocator_t *fa) |
map virtual pages of acpi code and data frames More... | |
frame_allocator_t * | frame_get_allocator (void) |
void | frame_set_allocator (frame_allocator_t *fa) |
frame allocator header
This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.
#define ___MEMORY_FRAME_H 0 |
prevent duplicate header error macro
#define frame_allocator_new | ( | ) | frame_allocator_new_ext(NULL); |
creates frame allocator at default heap
#define FRAME_ATTRIBUTE_ACPI 0x0000000400000000 |
frame attribure for acpi memory
#define FRAME_ATTRIBUTE_ACPI_RECLAIM_MEMORY 0x0000000200000000 |
frame attribure for acpi reclaim memory
#define FRAME_ATTRIBUTE_OLD_RESERVED 0x0000000100000000 |
frame attribure for reserved frames before relinked start
#define FRAME_ATTRIBUTE_RESERVED_PAGE_MAPPED 0x0000000800000000 |
frame attribure for reserved pages which are mapped
#define FRAME_SIZE 4096 |
frame size (4K)
typedef int8_t(* fa_allocate_frame_by_count_f) (struct frame_allocator_t *self, uint64_t count, frame_allocation_type_t fa_type, frame_t **fs, uint64_t *alloc_list_size) |
allocate frame with count
[in] | self | frame allocator |
[in] | count | frame count for allocation |
[in] | fa_type | frame allocation types can be or'ed values |
[out] | fs | list of frames that allocated |
[out] | alloc_list_size | fs length |
typedef int8_t(* fa_allocate_frame_f) (struct frame_allocator_t *self, frame_t *f) |
allocate frame with given reference frame, ref frame not used in anywhere as is. it is only for reference.
[in] | self | frame allocator |
[in] | f | referance frame, |
typedef int8_t(* fa_cleanup_f) (struct frame_allocator_t *self) |
cleans old reserved frames
[in] | self | frame allocator |
typedef uint64_t(* fa_get_allocated_frame_count_f) (struct frame_allocator_t *self) |
returns used frame count
[in] | self | frame allocator |
typedef uint64_t(* fa_get_free_frame_count_f) (struct frame_allocator_t *self) |
returns free frame count
[in] | self | frame allocator |
typedef frame_t *(* fa_get_reserved_frames_of_address_f) (struct frame_allocator_t *self, void *address) |
returns the frame that address resides or null
[in] | self | frame allocator |
[in] | address | search address |
typedef uint64_t(* fa_get_total_frame_count_f) (struct frame_allocator_t *self) |
returns total frame count
[in] | self | frame allocator |
typedef int8_t(* fa_release_acpi_reclaim_memory_f) (struct frame_allocator_t *self) |
release frames with attribute FRAME_TYPE_ACPI_RECLAIM_MEMORY
[in] | self | frame allocator |
typedef int8_t(* fa_release_frame_f) (struct frame_allocator_t *self, frame_t *f) |
release frame with given reference frame, ref frame not used in anywhere as is. it is only for reference.
[in] | self | frame allocator |
[in] | f | referance frame, |
typedef int8_t(* fa_reserve_system_frames_f) (struct frame_allocator_t *self, frame_t *f) |
reserve frames for mmio
[in] | self | frame allocator |
[in] | f | reference frame not used as is. |
frame allocation types
enum frame_type_t |
void frame_allocator_map_page_of_acpi_code_data_frames | ( | frame_allocator_t * | fa | ) |
map virtual pages of acpi code and data frames
[in] | fa | frame allocator |
frame_allocator_t * frame_allocator_new_ext | ( | memory_heap_t * | heap | ) |
creates a frame allocator
[in] | heap | where frame will be reside |
void frame_allocator_print | ( | frame_allocator_t * | fa | ) |
prints frame allocator contents
[in] | fa | frame allocator |