1
0
mirror of https://github.com/bmartini/zynq-axis.git synced 2024-09-05 19:19:27 +08:00

New function in library 'axis_memory_offset'

This function takes as argument an offset indexed from zero and returns a usage
pointer corresponding to the offset from the start of the CMA region. Thus an
argument offset of zero would give the pointer to the start of the CMA region.
This commit is contained in:
Berin Martini 2015-10-29 01:03:17 +00:00
parent a0c2bde576
commit dafc85637a
2 changed files with 9 additions and 0 deletions

View File

@ -183,6 +183,13 @@ unsigned int axis_memory_addr(void *ptr)
return (mem_start + ((unsigned int)ptr) - ((unsigned int)mem));
}
void *axis_memory_offset(unsigned int offset)
{
assert(offset < MEM_SIZE);
return &mem[offset];
}
unsigned int axis_stream_length(const int length, const int byte_nb)
{
assert(length);

View File

@ -37,6 +37,8 @@ extern "C" {
unsigned int axis_memory_addr(void *ptr);
void *axis_memory_offset(unsigned int offset);
unsigned int axis_stream_length(const int length, const int byte_nb);
#ifdef __cplusplus