1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-11-13 11:04:27 -05:00
libkernaux/include/kernaux/pfa.h

45 lines
866 B
C
Raw Normal View History

#ifndef KERNAUX_INCLUDED_PFA
#define KERNAUX_INCLUDED_PFA 1
2020-11-27 04:28:13 -05:00
2020-12-06 05:16:15 -05:00
#include <stdbool.h>
#define KERNAUX_PFA_PAGE_SIZE (4 * 1024)
#define KERNAUX_PFA_PAGES_COUNT_MAX (1024 * 1024)
2020-11-27 04:28:13 -05:00
#ifdef __cplusplus
extern "C" {
#endif
struct KernAux_PFA {
2020-12-06 05:16:15 -05:00
bool pages[KERNAUX_PFA_PAGES_COUNT_MAX];
};
2020-11-30 18:38:55 -05:00
void KernAux_PFA_initialize(struct KernAux_PFA *pfa)
__attribute__((nonnull));
void KernAux_PFA_mark_available(
struct KernAux_PFA *pfa,
unsigned int start,
unsigned int end
)
__attribute__((nonnull));
void KernAux_PFA_mark_unavailable(
struct KernAux_PFA *pfa,
unsigned int start,
unsigned int end
)
__attribute__((nonnull));
2020-11-30 18:38:55 -05:00
unsigned int KernAux_PFA_alloc_page(struct KernAux_PFA *pfa)
__attribute__((nonnull));
void KernAux_PFA_free_page(struct KernAux_PFA *pfa, unsigned int page_addr)
__attribute__((nonnull));
2020-11-27 04:28:13 -05:00
#ifdef __cplusplus
}
#endif
#endif