libnx  v4.2.2
cache.h
Go to the documentation of this file.
1 /**
2  * @file cache.h
3  * @brief AArch64 cache operations.
4  * @author plutoo
5  * @copyright libnx Authors
6  */
7 #pragma once
8 #include "../types.h"
9 
10 /**
11  * @brief Performs a data cache flush on the specified buffer.
12  * @param addr Address of the buffer.
13  * @param size Size of the buffer, in bytes.
14  * @remarks Cache flush is defined as Clean + Invalidate.
15  * @note The start and end addresses of the buffer are forcibly rounded to cache line boundaries (read from CTR_EL0 system register).
16  */
17 void armDCacheFlush(void* addr, size_t size);
18 
19 /**
20  * @brief Performs a data cache clean on the specified buffer.
21  * @param addr Address of the buffer.
22  * @param size Size of the buffer, in bytes.
23  * @note The start and end addresses of the buffer are forcibly rounded to cache line boundaries (read from CTR_EL0 system register).
24  */
25 void armDCacheClean(void* addr, size_t size);
26 
27 /**
28  * @brief Performs an instruction cache invalidation clean on the specified buffer.
29  * @param addr Address of the buffer.
30  * @param size Size of the buffer, in bytes.
31  * @note The start and end addresses of the buffer are forcibly rounded to cache line boundaries (read from CTR_EL0 system register).
32  */
33 void armICacheInvalidate(void* addr, size_t size);
34 
35 /**
36  * @brief Performs a data cache zeroing operation on the specified buffer.
37  * @param addr Address of the buffer.
38  * @param size Size of the buffer, in bytes.
39  * @note The start and end addresses of the buffer are forcibly rounded to cache line boundaries (read from CTR_EL0 system register).
40  */
41 void armDCacheZero(void* addr, size_t size);
armDCacheFlush
void armDCacheFlush(void *addr, size_t size)
Performs a data cache flush on the specified buffer.
armICacheInvalidate
void armICacheInvalidate(void *addr, size_t size)
Performs an instruction cache invalidation clean on the specified buffer.
armDCacheZero
void armDCacheZero(void *addr, size_t size)
Performs a data cache zeroing operation on the specified buffer.
armDCacheClean
void armDCacheClean(void *addr, size_t size)
Performs a data cache clean on the specified buffer.