RTEMS: bsps/arm/altera-cyclone-v/include/bsp/alt_cache.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
alt_cache.h
Go to the documentation of this file.
1
7/******************************************************************************
8 *
9 * Copyright 2013 Altera Corporation. All Rights Reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions are met:
13 *
14 * 1. Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
16 *
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 *
21 * 3. The name of the author may not be used to endorse or promote products
22 * derived from this software without specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY EXPRESS OR
25 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO
27 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
29 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
32 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
33 * OF SUCH DAMAGE.
34 *
35 ******************************************************************************/
36
37#ifndef __ALT_CACHE_H__
38#define __ALT_CACHE_H__
39
40#include "hwlib.h"
41
42#ifdef __cplusplus
43extern "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
332 bool alt_cache_l1_instruction_is_enabled(void);
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
378 bool alt_cache_l1_data_is_enabled(void);
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
529 bool alt_cache_l1_parity_is_enabled(void);
530
541 ALT_STATUS_CODE alt_cache_l1_branch_enable(void);
542
552 ALT_STATUS_CODE alt_cache_l1_branch_disable(void);
553
562 bool alt_cache_l1_branch_is_enabled(void);
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
601 bool alt_cache_l1_prefetch_is_enabled(void);
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
686 bool alt_cache_l2_prefetch_is_enabled(void);
687
713 ALT_STATUS_CODE alt_cache_l2_parity_enable(void);
714
721 ALT_STATUS_CODE alt_cache_l2_parity_disable(void);
722
732 bool alt_cache_l2_parity_is_enabled(void);
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
878 enum ALT_CACHE_L2_INTERRUPT_e
879{
881 ALT_CACHE_L2_INTERRUPT_DECERR = 1 << 8,
882
884 ALT_CACHE_L2_INTERRUPT_SLVERR = 1 << 7,
885
887 ALT_CACHE_L2_INTERRUPT_ERRRD = 1 << 6,
888
890 ALT_CACHE_L2_INTERRUPT_ERRRT = 1 << 5,
891
893 ALT_CACHE_L2_INTERRUPT_ERRWD = 1 << 4,
894
896 ALT_CACHE_L2_INTERRUPT_ERRWT = 1 << 3,
897
899 ALT_CACHE_L2_INTERRUPT_PARRD = 1 << 2,
900
902 ALT_CACHE_L2_INTERRUPT_PARRT = 1 << 1,
903
905 ALT_CACHE_L2_INTERRUPT_ECNTR = 1 << 0
906};
907typedef 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
942uint32_t alt_cache_l2_int_status_get(void);
943
956 ALT_STATUS_CODE alt_cache_l2_int_status_clear(uint32_t interrupt);
957
966#ifdef __cplusplus
967}
968#endif
969
970#endif /* __ALT_CACHE_H__ */
alt_cache_l1_prefetch_disable
ALT_STATUS_CODE alt_cache_l1_prefetch_disable(void)
alt_cache_l1_disable_all
ALT_STATUS_CODE alt_cache_l1_disable_all(void)
alt_cache_l1_data_is_enabled
bool alt_cache_l1_data_is_enabled(void)
alt_cache_l1_instruction_is_enabled
bool alt_cache_l1_instruction_is_enabled(void)
alt_cache_l1_prefetch_is_enabled
bool alt_cache_l1_prefetch_is_enabled(void)
alt_cache_l1_instruction_enable
ALT_STATUS_CODE alt_cache_l1_instruction_enable(void)
alt_cache_l1_branch_enable
ALT_STATUS_CODE alt_cache_l1_branch_enable(void)
alt_cache_l1_parity_enable
ALT_STATUS_CODE alt_cache_l1_parity_enable(void)
alt_cache_l1_data_invalidate
ALT_STATUS_CODE alt_cache_l1_data_invalidate(void *vaddress, size_t length)
alt_cache_l1_parity_disable
ALT_STATUS_CODE alt_cache_l1_parity_disable(void)
alt_cache_l1_data_invalidate_all
ALT_STATUS_CODE alt_cache_l1_data_invalidate_all(void)
alt_cache_l1_data_clean_all
ALT_STATUS_CODE alt_cache_l1_data_clean_all(void)
alt_cache_l1_instruction_disable
ALT_STATUS_CODE alt_cache_l1_instruction_disable(void)
alt_cache_l1_prefetch_enable
ALT_STATUS_CODE alt_cache_l1_prefetch_enable(void)
alt_cache_l1_data_enable
ALT_STATUS_CODE alt_cache_l1_data_enable(void)
alt_cache_l1_branch_is_enabled
bool alt_cache_l1_branch_is_enabled(void)
alt_cache_l1_branch_invalidate
ALT_STATUS_CODE alt_cache_l1_branch_invalidate(void)
alt_cache_l1_data_clean
ALT_STATUS_CODE alt_cache_l1_data_clean(void *vaddress, size_t length)
alt_cache_l1_data_purge_all
ALT_STATUS_CODE alt_cache_l1_data_purge_all(void)
alt_cache_l1_parity_is_enabled
bool alt_cache_l1_parity_is_enabled(void)
alt_cache_l1_instruction_invalidate
ALT_STATUS_CODE alt_cache_l1_instruction_invalidate(void)
alt_cache_l1_data_purge
ALT_STATUS_CODE alt_cache_l1_data_purge(void *vaddress, size_t length)
alt_cache_l1_data_disable
ALT_STATUS_CODE alt_cache_l1_data_disable(void)
alt_cache_l1_branch_disable
ALT_STATUS_CODE alt_cache_l1_branch_disable(void)
alt_cache_l1_enable_all
ALT_STATUS_CODE alt_cache_l1_enable_all(void)
alt_cache_l2_parity_enable
ALT_STATUS_CODE alt_cache_l2_parity_enable(void)
alt_cache_l2_clean_all
ALT_STATUS_CODE alt_cache_l2_clean_all(void)
alt_cache_l2_invalidate_all
ALT_STATUS_CODE alt_cache_l2_invalidate_all(void)
alt_cache_l2_prefetch_enable
ALT_STATUS_CODE alt_cache_l2_prefetch_enable(void)
alt_cache_l2_int_status_get
uint32_t alt_cache_l2_int_status_get(void)
alt_cache_l2_prefetch_disable
ALT_STATUS_CODE alt_cache_l2_prefetch_disable(void)
alt_cache_l2_clean
ALT_STATUS_CODE alt_cache_l2_clean(void *paddress, size_t length)
alt_cache_l2_prefetch_is_enabled
bool alt_cache_l2_prefetch_is_enabled(void)
alt_cache_l2_purge
ALT_STATUS_CODE alt_cache_l2_purge(void *paddress, size_t length)
alt_cache_l2_purge_all
ALT_STATUS_CODE alt_cache_l2_purge_all(void)
alt_cache_l2_int_enable
ALT_STATUS_CODE alt_cache_l2_int_enable(uint32_t interrupt)
alt_cache_l2_is_enabled
bool alt_cache_l2_is_enabled(void)
alt_cache_l2_uninit
ALT_STATUS_CODE alt_cache_l2_uninit(void)
alt_cache_l2_parity_disable
ALT_STATUS_CODE alt_cache_l2_parity_disable(void)
ALT_CACHE_L2_INTERRUPT_e
ALT_CACHE_L2_INTERRUPT_e
Definition: alt_cache.h:879
alt_cache_l2_invalidate
ALT_STATUS_CODE alt_cache_l2_invalidate(void *paddress, size_t length)
alt_cache_l2_init
ALT_STATUS_CODE alt_cache_l2_init(void)
alt_cache_l2_enable
ALT_STATUS_CODE alt_cache_l2_enable(void)
alt_cache_l2_int_status_clear
ALT_STATUS_CODE alt_cache_l2_int_status_clear(uint32_t interrupt)
alt_cache_l2_disable
ALT_STATUS_CODE alt_cache_l2_disable(void)
alt_cache_l2_int_disable
ALT_STATUS_CODE alt_cache_l2_int_disable(uint32_t interrupt)
alt_cache_l2_sync
ALT_STATUS_CODE alt_cache_l2_sync(void)
alt_cache_l2_parity_is_enabled
bool alt_cache_l2_parity_is_enabled(void)
ALT_CACHE_L2_INTERRUPT_PARRD
@ ALT_CACHE_L2_INTERRUPT_PARRD
Definition: alt_cache.h:899
ALT_CACHE_L2_INTERRUPT_ERRWD
@ ALT_CACHE_L2_INTERRUPT_ERRWD
Definition: alt_cache.h:893
ALT_CACHE_L2_INTERRUPT_ERRRD
@ ALT_CACHE_L2_INTERRUPT_ERRRD
Definition: alt_cache.h:887
ALT_CACHE_L2_INTERRUPT_ERRRT
@ ALT_CACHE_L2_INTERRUPT_ERRRT
Definition: alt_cache.h:890
ALT_CACHE_L2_INTERRUPT_PARRT
@ ALT_CACHE_L2_INTERRUPT_PARRT
Definition: alt_cache.h:902
ALT_CACHE_L2_INTERRUPT_SLVERR
@ ALT_CACHE_L2_INTERRUPT_SLVERR
Definition: alt_cache.h:884
ALT_CACHE_L2_INTERRUPT_DECERR
@ ALT_CACHE_L2_INTERRUPT_DECERR
Definition: alt_cache.h:881
ALT_CACHE_L2_INTERRUPT_ERRWT
@ ALT_CACHE_L2_INTERRUPT_ERRWT
Definition: alt_cache.h:896
ALT_CACHE_L2_INTERRUPT_ECNTR
@ ALT_CACHE_L2_INTERRUPT_ECNTR
Definition: alt_cache.h:905
alt_cache_system_disable
ALT_STATUS_CODE alt_cache_system_disable(void)
alt_cache_system_invalidate
ALT_STATUS_CODE alt_cache_system_invalidate(void *vaddress, size_t length)
alt_cache_system_enable
ALT_STATUS_CODE alt_cache_system_enable(void)
alt_cache_system_purge
ALT_STATUS_CODE alt_cache_system_purge(void *vaddress, size_t length)
alt_cache_system_clean
ALT_STATUS_CODE alt_cache_system_clean(void *vaddress, size_t length)
hwlib.h
ALT_STATUS_CODE
int32_t ALT_STATUS_CODE
Definition: hwlib.h:60