Altera HWLIB  16.0
The Altera HW Manager API Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
alt_cache.h
1 /******************************************************************************
2 *
3 * Copyright 2013 Altera Corporation. All Rights Reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
14 *
15 * 3. Neither the name of the copyright holder nor the names of its contributors
16 * may be used to endorse or promote products derived from this software without
17 * specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 *
31 ******************************************************************************/
32 
33 /*
34  * $Id: //depot/embedded/rel/15.0/ip/hps/altera_hps/hwlib/include/alt_cache.h#1 $
35  */
36 
37 #ifndef __ALT_CACHE_H__
38 #define __ALT_CACHE_H__
39 
40 #include "hwlib.h"
41 
42 #ifdef __cplusplus
43 extern "C"
44 {
45 #endif
46 
115 #ifndef ALT_CACHE_SUPPORT_NON_FLAT_VIRTUAL_MEMORY
116 #define ALT_CACHE_SUPPORT_NON_FLAT_VIRTUAL_MEMORY (0)
117 #endif
118 
122 #define ALT_CACHE_LINE_SIZE 32
123 
134 ALT_STATUS_CODE alt_cache_system_enable(void);
135 
145 ALT_STATUS_CODE alt_cache_system_disable(void);
146 
179 ALT_STATUS_CODE alt_cache_system_invalidate(void * vaddress, size_t length);
180 
213 ALT_STATUS_CODE alt_cache_system_clean(void * vaddress, size_t length);
214 
249 ALT_STATUS_CODE alt_cache_system_purge(void * vaddress, size_t length);
250 
291 ALT_STATUS_CODE alt_cache_l1_enable_all(void);
292 
305 ALT_STATUS_CODE alt_cache_l1_disable_all(void);
306 
315 ALT_STATUS_CODE alt_cache_l1_instruction_enable(void);
316 
323 ALT_STATUS_CODE alt_cache_l1_instruction_disable(void);
324 
333 
347 ALT_STATUS_CODE alt_cache_l1_instruction_invalidate(void);
348 
358 ALT_STATUS_CODE alt_cache_l1_data_enable(void);
359 
369 ALT_STATUS_CODE alt_cache_l1_data_disable(void);
370 
379 
399 ALT_STATUS_CODE alt_cache_l1_data_invalidate(void * vaddress, size_t length);
400 
413 ALT_STATUS_CODE alt_cache_l1_data_invalidate_all(void);
414 
434 ALT_STATUS_CODE alt_cache_l1_data_clean(void * vaddress, size_t length);
435 
442 ALT_STATUS_CODE alt_cache_l1_data_clean_all(void);
443 
468 ALT_STATUS_CODE alt_cache_l1_data_purge(void * vaddress, size_t length);
469 
476 ALT_STATUS_CODE alt_cache_l1_data_purge_all(void);
477 
510 ALT_STATUS_CODE alt_cache_l1_parity_enable(void);
511 
518 ALT_STATUS_CODE alt_cache_l1_parity_disable(void);
519 
530 
541 ALT_STATUS_CODE alt_cache_l1_branch_enable(void);
542 
552 ALT_STATUS_CODE alt_cache_l1_branch_disable(void);
553 
563 
571 ALT_STATUS_CODE alt_cache_l1_branch_invalidate(void);
572 
584 ALT_STATUS_CODE alt_cache_l1_prefetch_enable(void);
585 
592 ALT_STATUS_CODE alt_cache_l1_prefetch_disable(void);
593 
602 
641 ALT_STATUS_CODE alt_cache_l2_init(void);
642 
649 ALT_STATUS_CODE alt_cache_l2_uninit(void);
650 
662 ALT_STATUS_CODE alt_cache_l2_prefetch_enable(void);
663 
675 ALT_STATUS_CODE alt_cache_l2_prefetch_disable(void);
676 
687 
713 ALT_STATUS_CODE alt_cache_l2_parity_enable(void);
714 
721 ALT_STATUS_CODE alt_cache_l2_parity_disable(void);
722 
733 
743 ALT_STATUS_CODE alt_cache_l2_enable(void);
744 
754 ALT_STATUS_CODE alt_cache_l2_disable(void);
755 
763 bool alt_cache_l2_is_enabled(void);
764 
772 ALT_STATUS_CODE alt_cache_l2_sync(void);
773 
794 ALT_STATUS_CODE alt_cache_l2_invalidate(void * paddress, size_t length);
795 
808 ALT_STATUS_CODE alt_cache_l2_invalidate_all(void);
809 
829 ALT_STATUS_CODE alt_cache_l2_clean(void * paddress, size_t length);
830 
840 ALT_STATUS_CODE alt_cache_l2_clean_all(void);
841 
861 ALT_STATUS_CODE alt_cache_l2_purge(void * paddress, size_t length);
862 
872 ALT_STATUS_CODE alt_cache_l2_purge_all(void);
873 
879 {
882 
885 
888 
891 
894 
897 
900 
903 
906 };
907 typedef enum ALT_CACHE_L2_INTERRUPT_e ALT_CACHE_L2_INTERRUPT_t;
908 
920 ALT_STATUS_CODE alt_cache_l2_int_enable(uint32_t interrupt);
921 
933 ALT_STATUS_CODE alt_cache_l2_int_disable(uint32_t interrupt);
934 
942 uint32_t alt_cache_l2_int_status_get(void);
943 
950 uint32_t alt_cache_l2_int_raw_status_get(void);
951 
964 ALT_STATUS_CODE alt_cache_l2_int_status_clear(uint32_t interrupt);
965 
974 #ifdef __cplusplus
975 }
976 #endif
977 
978 #endif /* __ALT_CACHE_H__ */