EU1KY AA FW
sdram_heap.c File Reference
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "sdram_heap.h"

Macros

#define SDRH_BLKSIZE   128
 
#define SDRH_HEAPSIZE   0x200000
 
#define SDRH_NBLOCKS   (SDRH_HEAPSIZE / SDRH_BLKSIZE)
 
#define SDRH_ADDR(block)   (SDRH_START + block * SDRH_BLKSIZE)
 

Functions

static uint16_t __attribute__ ((section(".user_sdram")))
 
static bool _isValidPtr (void *ptr)
 
static uint32_t _find_area (uint32_t nblocks)
 
voidSDRH_malloc (size_t nbytes)
 
void SDRH_free (void *ptr)
 
voidSDRH_realloc (void *ptr, size_t nbytes)
 
voidSDRH_calloc (size_t nbytes)
 

Variables

uint8_t __sdram_heap_start__
 
uint8_t __sdram_heap_end__
 
static void *const SDRH_START = &__sdram_heap_start__
 
static void *const SDRH_END = &__sdram_heap_end__
 

Macro Definition Documentation

#define SDRH_ADDR (   block)    (SDRH_START + block * SDRH_BLKSIZE)
#define SDRH_BLKSIZE   128
#define SDRH_HEAPSIZE   0x200000
#define SDRH_NBLOCKS   (SDRH_HEAPSIZE / SDRH_BLKSIZE)

Function Documentation

static uint16_t __attribute__ ( (section(".user_sdram"))  )
static
static uint32_t _find_area ( uint32_t  nblocks)
static
static bool _isValidPtr ( void ptr)
static
void* SDRH_calloc ( size_t  nbytes)
void SDRH_free ( void ptr)
void* SDRH_malloc ( size_t  nbytes)
void* SDRH_realloc ( void ptr,
size_t  nbytes 
)

Variable Documentation

uint8_t __sdram_heap_end__
uint8_t __sdram_heap_start__
void* const SDRH_END = &__sdram_heap_end__
static
void* const SDRH_START = &__sdram_heap_start__
static