forked from weston-embedded/uC-CPU
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpu_cache.h
135 lines (105 loc) · 4.64 KB
/
cpu_cache.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/*
*********************************************************************************************************
* uC/CPU
* CPU CONFIGURATION & PORT LAYER
*
* Copyright 2004-2021 Silicon Laboratories Inc. www.silabs.com
*
* SPDX-License-Identifier: APACHE-2.0
*
* This software is subject to an open source license and is distributed by
* Silicon Laboratories Inc. pursuant to the terms of the Apache License,
* Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
*
*********************************************************************************************************
*/
/*
*********************************************************************************************************
*
* CACHE CPU MODULE
*
* Filename : cpu_cache.h
* Version : V1.32.01
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* MODULE
*
* Note(s) : (1) This cache CPU header file is protected from multiple pre-processor inclusion through use of
* the cache CPU module present pre-processor macro definition.
*********************************************************************************************************
*/
#ifndef CPU_CACHE_MODULE_PRESENT /* See Note #1. */
#define CPU_CACHE_MODULE_PRESENT
/*
*********************************************************************************************************
* EXTERNS
*********************************************************************************************************
*/
#ifdef CPU_CACHE_MODULE
#define CPU_CACHE_EXT
#else
#define CPU_CACHE_EXT extern
#endif
/*
*********************************************************************************************************
* INCLUDE FILES
*********************************************************************************************************
*/
#include <cpu.h>
#include <lib_def.h>
#include <cpu_cfg.h>
/*
*********************************************************************************************************
* CACHE CONFIGURATION
*********************************************************************************************************
*/
#ifndef CPU_CFG_CACHE_MGMT_EN
#define CPU_CFG_CACHE_MGMT_EN DEF_DISABLED
#endif
/*
*********************************************************************************************************
* CACHE OPERATIONS DEFINES
*********************************************************************************************************
*/
#if (CPU_CFG_CACHE_MGMT_EN == DEF_ENABLED)
#ifndef CPU_DCACHE_RANGE_FLUSH
#define CPU_DCACHE_RANGE_FLUSH(addr_start, len) CPU_DCache_RangeFlush(addr_start, len)
#endif /* CPU_DCACHE_RANGE_FLUSH */
#else
#define CPU_DCACHE_RANGE_FLUSH(addr_start, len)
#endif /* CPU_CFG_CACHE_MGMT_EN) */
#if (CPU_CFG_CACHE_MGMT_EN == DEF_ENABLED)
#ifndef CPU_DCACHE_RANGE_INV
#define CPU_DCACHE_RANGE_INV(addr_start, len) CPU_DCache_RangeInv(addr_start, len)
#endif /* CPU_DCACHE_RANGE_INV */
#else
#define CPU_DCACHE_RANGE_INV(addr_start, len)
#endif /* CPU_CFG_CACHE_MGMT_EN) */
/*
*********************************************************************************************************
* FUNCTION PROTOTYPES
*********************************************************************************************************
*/
#if (CPU_CFG_CACHE_MGMT_EN == DEF_ENABLED)
#ifdef __cplusplus
extern "C" {
#endif
void CPU_Cache_Init (void);
void CPU_DCache_RangeFlush(void *addr_start,
CPU_ADDR len);
void CPU_DCache_RangeInv (void *addr_start,
CPU_ADDR len);
#ifdef __cplusplus
}
#endif
#endif /* CPU_CFG_CACHE_MGMT_EN */
/*
*********************************************************************************************************
* MODULE END
*
* Note(s) : (1) See 'cpu_core.h MODULE'.
*********************************************************************************************************
*/
#endif /* End of CPU core module include. */