1 /**
2 * \file
3 *
4 * \brief HAL cache functionality implementation.
5 *
6 * Copyright (c)2018 Microchip Technology Inc. and its subsidiaries.
7 *
8 * \asf_license_start
9 *
10 * \page License
11 *
12 * Subject to your compliance with these terms, you may use Microchip
13 * software and any derivatives exclusively with Microchip products.
14 * It is your responsibility to comply with third party license terms applicable
15 * to your use of third party software (including open source software) that
16 * may accompany Microchip software.
17 *
18 * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
19 * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
20 * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
21 * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
22 * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
23 * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
24 * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
25 * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
26 * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
27 * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
28 * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
29 *
30 * \asf_license_stop
31 *
32 */
33 /*
34 * Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a>
35 */
36
37 #include <compiler.h>
38 #include <hpl_cmcc.h>
39
40 /**
41 * \brief Initialize cache module
42 */
cache_init(void)43 int32_t cache_init(void)
44 {
45 return _cmcc_init();
46 }
47
48 /**
49 * \brief Enable cache module
50 */
cache_enable(const void * hw)51 int32_t cache_enable(const void *hw)
52 {
53 return _cmcc_enable(hw);
54 }
55
56 /**
57 * \brief Disable cache module
58 */
cache_disable(const void * hw)59 int32_t cache_disable(const void *hw)
60 {
61 return _cmcc_disable(hw);
62 }
63
64 /**
65 * \brief Configure cache module
66 */
cache_configure(const void * hw,struct _cache_cfg * cache)67 int32_t cache_configure(const void *hw, struct _cache_cfg *cache)
68 {
69 return _cmcc_configure(hw, cache);
70 }
71
72 /**
73 * \brief Invalidate entire cache entries
74 */
cache_invalidate_all(const void * hw)75 int32_t cache_invalidate_all(const void *hw)
76 {
77 return _cmcc_invalidate_all(hw);
78 }
79