LF OS
Hobby operating system for amd64 with high ambitions
Loading...
Searching...
No Matches
tpa.h
Go to the documentation of this file.
1#ifndef _TPA_H_INCLUDED
2#define _TPA_H_INCLUDED
3
4#include <allocator.h>
5#include <stdint.h>
6
7typedef struct tpa tpa_t;
8
20
26void tpa_delete(tpa_t* tpa);
27
35void* tpa_get(tpa_t* tpa, size_t idx);
36
45void tpa_set(tpa_t* tpa, size_t idx, void* data);
46
53size_t tpa_size(tpa_t* tpa);
54
63
71size_t tpa_entries(tpa_t* tpa);
72
82size_t tpa_next(tpa_t* tpa, size_t cur);
83
84#endif
unsigned long uint64_t
Definition arch.h:14
int64_t ssize_t
Definition arch.h:19
allocator_t * alloc
uint64_t entry_size
Size of each entry.
Definition tpa.c:39
uint64_t page_size
Size of each data page.
Definition tpa.c:42
Header of a TPA.
Definition tpa.c:34
tpa_t * tpa_new(allocator_t *alloc, uint64_t entry_size, uint64_t page_size, tpa_t *tpa)
Definition tpa.c:48
void tpa_set(tpa_t *tpa, size_t idx, void *data)
Definition tpa.c:174
void tpa_delete(tpa_t *tpa)
Definition tpa.c:61
size_t tpa_size(tpa_t *tpa)
Definition tpa.c:72
void * tpa_get(tpa_t *tpa, size_t idx)
Definition tpa.c:144
size_t tpa_next(tpa_t *tpa, size_t cur)
Definition tpa.c:223
ssize_t tpa_length(tpa_t *tpa)
Definition tpa.c:87
size_t tpa_entries(tpa_t *tpa)
Definition tpa.c:110