Lazuli
Functions
memory.c File Reference

Kernel memory functions. More...

#include <stdint.h>
#include <Lazuli/common.h>
#include <Lazuli/config.h>
#include <Lazuli/sys/arch/AVR/registers.h>
#include <Lazuli/sys/kernel.h>
#include <Lazuli/sys/memory.h>

Go to the source code of this file.

Functions

static void * SetBreak (const unsigned int increment, AllocationMap *const map)
 Set break position of a memory region. More...
 
void * KIncrementalMalloc (const size_t size)
 Allocate memory for kernel objects using incremental method. More...
 
void Memory_Copy (const void *source, void *destination, const size_t size)
 Copy bytes from one location to another in main memory. More...
 

Detailed Description

Kernel memory functions.

Memory functions for the kernel: allocation, copy, ...

Definition in file memory.c.

Function Documentation

◆ SetBreak()

static void* SetBreak ( const unsigned int  increment,
AllocationMap *const  map 
)
static

Set break position of a memory region.

Parameters
incrementThe number of bytes to increment the break.
mapA pointer to the concerned allocation map.
Returns
A pointer to the beginning of the allocated memory block, or NULL if can't set break, or the current break position if increment is zero.

Definition at line 34 of file memory.c.

◆ KIncrementalMalloc()

void* KIncrementalMalloc ( const size_t  size)

Allocate memory for kernel objects using incremental method.

Parameters
sizeThe size in bytes to allocate.
Returns
A pointer to the allocated region, or NULL if allocation is impossible.

Definition at line 67 of file memory.c.

◆ Memory_Copy()

void Memory_Copy ( const void *  source,
void *  destination,
const size_t  size 
)

Copy bytes from one location to another in main memory.

Parameters
sourceA pointer to the source address in RAM.
destinationA pointer to the destination address in RAM.
sizeThe number of bytes to copy.

Definition at line 73 of file memory.c.