CardSight 0.1.0
C API reference for the CardSight firmware and application
Loading...
Searching...
No Matches
cache.h File Reference

Data cache maintenance for DMA. More...

#include <stddef.h>

Go to the source code of this file.

Macros

#define CACHE_LINE_BYTES   64U
 Size of one data cache line in bytes.

Functions

void dcache_clean_range (const void *address, size_t length)
 Write the dirty lines of the range back to memory.
void dcache_invalidate_range (const void *address, size_t length)
 Drop the cached copy of the range.

Detailed Description

Data cache maintenance for DMA.

The C907 has the T-Head cache maintenance operations, which work on physical addresses; the range operations round outwards to whole cache lines.

Function Documentation

◆ dcache_clean_range()

void dcache_clean_range ( const void * address,
size_t length )

Write the dirty lines of the range back to memory.

The start is rounded down and the end up to whole cache lines; the range is fenced before and after the T-Head clean operations.

Parameters
[in]addressPhysical start address of the range.
[in]lengthLength in bytes; zero does nothing.

◆ dcache_invalidate_range()

void dcache_invalidate_range ( const void * address,
size_t length )

Drop the cached copy of the range.

Data written to memory by a device is read back on the next access. The range is rounded outwards to whole cache lines and fenced before and after the T-Head invalidate operations.

Parameters
[in]addressPhysical start address of the range.
[in]lengthLength in bytes; zero does nothing.