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:
parent
a0c2bde576
commit
dafc85637a
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user