@web-font-path: "roboto-debian.css";
v2.2.0 (RP2040)
Loading...
Searching...
No Matches
xip_cache.h
Go to the documentation of this file.
/*
* Copyright (c) 2024 Raspberry Pi Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _HARDWARE_XIP_CACHE_H
#define _HARDWARE_XIP_CACHE_H
#include "pico.h"
#include "hardware/regs/addressmap.h"
// PICO_CONFIG: PARAM_ASSERTIONS_ENABLED_HARDWARE_XIP_CACHE, Enable/disable assertions in the hardware_xip_cache module, type=bool, default=0, group=hardware_xip_cache
#ifndef PARAM_ASSERTIONS_ENABLED_HARDWARE_XIP_CACHE
#define PARAM_ASSERTIONS_ENABLED_HARDWARE_XIP_CACHE 0
#endif
#define XIP_CACHE_LINE_SIZE _u(8)
#define XIP_CACHE_SIZE (_u(16) * _u(1024))
#if PICO_RP2040
#define XIP_CACHE_ADDRESS_SPACE_SIZE (_u(16) * _u(1024) * _u(1024))
#else
#define XIP_CACHE_ADDRESS_SPACE_SIZE (XIP_END - XIP_BASE)
#endif
// A read-only cache never requires cleaning (you can still call the functions, they are just no-ops)
#if PICO_RP2040
#define XIP_CACHE_IS_READ_ONLY 1
#else
#define XIP_CACHE_IS_READ_ONLY 0
#endif
#ifndef __ASSEMBLER__
#ifdef __cplusplus
extern "C" {
#endif
void xip_cache_invalidate_all(void);
void xip_cache_invalidate_range(uintptr_t start_offset, uintptr_t size_bytes);
#if !XIP_CACHE_IS_READ_ONLY || PICO_COMBINED_DOCS
void xip_cache_clean_all(void);
void xip_cache_clean_range(uintptr_t start_offset, uintptr_t size_bytes);
#else
// Stub these out inline to avoid generating a call to an empty function when they are no-ops
static inline void xip_cache_clean_all(void) {}
static inline void xip_cache_clean_range(uintptr_t start_offset, uintptr_t size_bytes) {
(void)start_offset;
(void)size_bytes;
}
#endif
#if !PICO_RP2040 || PICO_COMBINED_DOCS
void xip_cache_pin_range(uintptr_t start_offset, uintptr_t size_bytes);
#endif
#ifdef __cplusplus
}
#endif
#endif // !__ASSEMBLER__
#endif // !_HARDWARE_XIP_CACHE_H
xip_cache_invalidate_all
void xip_cache_invalidate_all(void)
Invalidate the cache for the entire XIP address space.
Definition xip_cache.c:54
xip_cache_invalidate_range
void xip_cache_invalidate_range(uintptr_t start_offset, uintptr_t size_bytes)
Invalidate a range of offsets within the XIP address space.
Definition xip_cache.c:65
pico.h