PatchworkOS  19e446b
A non-POSIX operating system.
Loading...
Searching...
No Matches
mdl.h File Reference
#include <kernel/mem/paging_types.h>
#include <kernel/mem/pmm.h>
#include <kernel/mem/pool.h>
#include <kernel/mem/space.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/list.h>
Include dependency graph for mdl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mdl_seg_t
 Memory Descriptor List Segment structure. More...
 
struct  mdl_t
 Memory Descriptor List structure. More...
 
struct  mdl_iter_t
 Memory Descriptor List Iterator structure. More...
 

Macros

#define MDL_SEGS_SMALL_MAX   2
 Amount of memory segments statically allocated for small MDLs.
 
#define MDL_ITER_CREATE(_mdl)
 Create a Memory Descriptor List Iterator initializer.
 
#define MDL_FOR_EACH(_byte, _mdl)   for (mdl_iter_t _iter = MDL_ITER_CREATE(_mdl); mdl_iter_next(&_iter, (_byte));)
 Iterate over bytes within a Memory Descriptor List.
 

Typedefs

typedef struct process process_t
 

Functions

static void mdl_init (mdl_t *next, mdl_t *prev)
 Initialize a Memory Descriptor List.
 
void mdl_deinit (mdl_t *mdl)
 Deinitialize a Memory Descriptor List.
 
void mdl_free_chain (mdl_t *mdl, void(*free)(void *))
 Free a Memory Descriptor List chain.
 
uint64_t mdl_from_region (mdl_t *mdl, mdl_t *prev, space_t *space, const void *addr, size_t size)
 Initialize a Memory Descriptor List from a memory region.
 
uint64_t mdl_add (mdl_t *mdl, space_t *space, const void *addr, size_t size)
 Add a memory region to the Memory Descriptor List.
 
uint64_t mdl_read (mdl_t *mdl, void *buffer, size_t count, size_t offset)
 Read from a Memory Descriptor List into a buffer.
 
uint64_t mdl_write (mdl_t *mdl, const void *buffer, size_t count, size_t offset)
 Write to a Memory Descriptor List from a buffer.
 
static bool mdl_iter_next (mdl_iter_t *iter, uint8_t *byte)
 Get the next byte from a Memory Descriptor List Iterator.
 

Typedef Documentation

◆ process_t

typedef struct process process_t

Definition at line 12 of file mdl.h.