annotate packages/hal/powerpc/ppc40x/current/include/var_cache.h @ 3292:7f8e529b4d82 default tip

Fix FREESCALE_EDMA_NBYTES_MLOFFYES_MLOFF() so it works with negative offsets.
author vae
date Wed, 29 Apr 2015 23:31:48 +0000
parents 74dbf4c3f2e1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
134
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
1 #ifndef CYGONCE_VAR_CACHE_H
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
2 #define CYGONCE_VAR_CACHE_H
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
3 //=============================================================================
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
4 //
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
5 // var_cache.h
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
6 //
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
7 // Variant HAL cache control API
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
8 //
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
9 //=============================================================================
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
10 // ####ECOSGPLCOPYRIGHTBEGIN####
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
11 // -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
12 // This file is part of eCos, the Embedded Configurable Operating System.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
13 // Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 136
diff changeset
14 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
15 // eCos is free software; you can redistribute it and/or modify it under
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
16 // the terms of the GNU General Public License as published by the Free
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
17 // Software Foundation; either version 2 or (at your option) any later
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
18 // version.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 136
diff changeset
19 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
20 // eCos is distributed in the hope that it will be useful, but WITHOUT
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
21 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
22 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
23 // for more details.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 136
diff changeset
24 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
25 // You should have received a copy of the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
26 // along with eCos; if not, write to the Free Software Foundation, Inc.,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
27 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 136
diff changeset
28 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
29 // As a special exception, if other files instantiate templates or use
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
30 // macros or inline functions from this file, or you compile this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
31 // and link it with other works to produce a work based on this file,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
32 // this file does not by itself cause the resulting work to be covered by
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
33 // the GNU General Public License. However the source code for this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
34 // must still be made available in accordance with section (3) of the GNU
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
35 // General Public License v2.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 136
diff changeset
36 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
37 // This exception does not invalidate any other reasons why a work based
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
38 // on this file might be covered by the GNU General Public License.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
39 // -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2058
diff changeset
40 // ####ECOSGPLCOPYRIGHTEND####
134
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
41 //=============================================================================
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
42 //#####DESCRIPTIONBEGIN####
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
43 //
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
44 // Author(s): nickg
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
45 // Contributors:nickg, jskov
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
46 // Date: 2000-04-02
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
47 // Purpose: Variant cache control API
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
48 // Description: The macros defined here provide the HAL APIs for handling
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
49 // cache control operations on the PPC60x variant CPUs.
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
50 // Usage: Is included via the architecture cache header:
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
51 // #include <cyg/hal/hal_cache.h>
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
52 // ...
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
53 //
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
54 //####DESCRIPTIONEND####
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
55 //
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
56 //=============================================================================
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
57
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
58 #include <pkgconf/hal.h>
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
59 #include <cyg/infra/cyg_type.h>
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
60
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
61 #include <cyg/hal/ppc_regs.h>
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
62
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
63 #include <cyg/hal/plf_cache.h>
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
64
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
65
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
66 //-----------------------------------------------------------------------------
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
67 // Cache dimensions
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
68
1223
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
69 #if defined(CYGHWR_HAL_POWERPC_PPC4XX_403)
134
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
70 // Data cache
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
71 #define HAL_DCACHE_SIZE 8192 // Size of data cache in bytes
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
72 #define HAL_DCACHE_LINE_SIZE 16 // Size of a data cache line
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
73 #define HAL_DCACHE_WAYS 2 // Associativity of the cache
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
74
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
75 // Instruction cache
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
76 #define HAL_ICACHE_SIZE 16384 // Size of cache in bytes
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
77 #define HAL_ICACHE_LINE_SIZE 16 // Size of a cache line
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
78 #define HAL_ICACHE_WAYS 2 // Associativity of the cache
1223
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
79 #endif // 403
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
80
2058
8d6df59beb34 Add support for PPC405EP, from Markus Schade
gthomas
parents: 1223
diff changeset
81 #if defined(CYGHWR_HAL_POWERPC_PPC4XX_405) || defined(CYGHWR_HAL_POWERPC_PPC4XX_405GP) || defined(CYGHWR_HAL_POWERPC_PPC4XX_405EP)
1223
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
82 // Data cache
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
83 #define HAL_DCACHE_SIZE (16*1024) // Size of data cache in bytes
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
84 #define HAL_DCACHE_LINE_SIZE 32 // Size of a data cache line
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
85 #define HAL_DCACHE_WAYS 2 // Associativity of the cache
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
86
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
87 // Instruction cache
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
88 #define HAL_ICACHE_SIZE (16*1024) // Size of cache in bytes
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
89 #define HAL_ICACHE_LINE_SIZE 32 // Size of a cache line
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
90 #define HAL_ICACHE_WAYS 2 // Associativity of the cache
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
91 #endif // 405
134
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
92
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
93 #define HAL_DCACHE_SETS (HAL_DCACHE_SIZE/(HAL_DCACHE_LINE_SIZE*HAL_DCACHE_WAYS))
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
94 #define HAL_ICACHE_SETS (HAL_ICACHE_SIZE/(HAL_ICACHE_LINE_SIZE*HAL_ICACHE_WAYS))
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
95
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
96 //-----------------------------------------------------------------------------
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
97 // Global control of data cache
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
98
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
99 // Enable the data cache - this is implicit whenever the MMU is turned on
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
100 #define HAL_DCACHE_ENABLE()
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
101
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
102 // Disable the data cache
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
103 #define HAL_DCACHE_DISABLE()
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
104
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
105 // Invalidate the entire cache
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
106 #define HAL_DCACHE_INVALIDATE_ALL() \
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
107 CYG_MACRO_START \
136
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
108 int _i_, _ix_, _indx_; \
134
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
109 _indx_ = 0; \
136
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
110 _ix_ = HAL_DCACHE_SIZE/2; \
134
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
111 for (_i_ = 0; _i_ < HAL_DCACHE_SETS; _i_++) { \
1223
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
112 asm volatile ("dccci 0,%0;" :: "r"(_indx_)); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
113 asm volatile ("dccci %1,%0;" :: "r"(_indx_), "r"(_ix_)); \
134
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
114 _indx_ += HAL_DCACHE_LINE_SIZE; \
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
115 } \
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
116 CYG_MACRO_END
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
117
1223
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
118 #if 0
136
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
119 // Synchronize the contents of the cache with memory.
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
120 #define HAL_DCACHE_SYNC() \
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
121 CYG_MACRO_START \
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
122 int _indx_; \
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
123 for (_indx_ = 0; _indx_ < HAL_DCACHE_SIZE; _indx_ += HAL_DCACHE_LINE_SIZE) { \
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
124 asm volatile ("dcbf 0,%0;" :: "r"(_indx_)); \
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
125 } \
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
126 CYG_MACRO_END
1223
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
127 #else
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
128 // Synchronize the contents of the cache with memory.
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
129 #define HAL_DCACHE_SYNC() \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
130 CYG_MACRO_START \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
131 cyg_int32 i; \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
132 cyg_uint32 *__base = (cyg_uint32 *) (0); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
133 /* for (i = 0; i < HAL_DCACHE_SIZE; i += sizeof(cyg_uint32)) { */ \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
134 for (i = 0; i < (HAL_DCACHE_SIZE/HAL_DCACHE_LINE_SIZE); i++, __base += HAL_DCACHE_LINE_SIZE/4){\
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
135 asm volatile ("lwz %%r0,0(%0)" : : "r" (__base) : "r0"); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
136 } \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
137 CYG_MACRO_END
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
138 #endif
134
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
139
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
140 // Query the state of the data cache
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
141 #define HAL_DCACHE_IS_ENABLED(_state_) \
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
142 CYG_MACRO_START \
136
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
143 (_state_) = 1; \
134
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
144 CYG_MACRO_END
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
145
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
146 // Set the data cache refill burst size
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
147 //#define HAL_DCACHE_BURST_SIZE(_size_)
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
148
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
149 // Set the data cache write mode
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
150 //#define HAL_DCACHE_WRITE_MODE( _mode_ )
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
151
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
152 //#define HAL_DCACHE_WRITETHRU_MODE 0
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
153 //#define HAL_DCACHE_WRITEBACK_MODE 1
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
154
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
155 // Load the contents of the given address range into the data cache
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
156 // and then lock the cache so that it stays there.
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
157 //#define HAL_DCACHE_LOCK(_base_, _size_)
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
158
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
159 // Undo a previous lock operation
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
160 //#define HAL_DCACHE_UNLOCK(_base_, _size_)
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
161
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
162 // Unlock entire cache
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
163 #define HAL_DCACHE_UNLOCK_ALL()
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
164
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
165 //-----------------------------------------------------------------------------
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
166 // Data cache line control
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
167
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
168 // Allocate cache lines for the given address range without reading its
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
169 // contents from memory.
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
170 //#define HAL_DCACHE_ALLOCATE( _base_ , _size_ )
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
171
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
172 // Write dirty cache lines to memory and invalidate the cache entries
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
173 // for the given address range.
1223
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
174 #define HAL_DCACHE_FLUSH( _base_ , _size_ ) \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
175 CYG_MACRO_START \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
176 cyg_uint32 __base = (cyg_uint32) (_base_); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
177 cyg_int32 __size = (cyg_int32) (_size_); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
178 while (__size > 0) { \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
179 asm volatile ("dcbf 0,%0;sync;" : : "r" (__base)); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
180 __base += HAL_DCACHE_LINE_SIZE; \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
181 __size -= HAL_DCACHE_LINE_SIZE; \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
182 } \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
183 CYG_MACRO_END
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
184
134
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
185 // Invalidate cache lines in the given range without writing to memory.
1223
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
186 #define HAL_DCACHE_INVALIDATE( _base_ , _size_ ) \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
187 CYG_MACRO_START \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
188 cyg_uint32 __base = (cyg_uint32) (_base_); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
189 cyg_int32 __size = (cyg_int32) (_size_); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
190 while (__size > 0) { \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
191 asm volatile ("dcbi 0,%0;sync;" : : "r" (__base)); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
192 __base += HAL_DCACHE_LINE_SIZE; \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
193 __size -= HAL_DCACHE_LINE_SIZE; \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
194 } \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
195 CYG_MACRO_END
134
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
196
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
197 // Write dirty cache lines to memory for the given address range.
1223
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
198 #define HAL_DCACHE_STORE( _base_ , _size_ ) \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
199 CYG_MACRO_START \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
200 cyg_uint32 __base = (cyg_uint32) (_base_); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
201 cyg_int32 __size = (cyg_int32) (_size_); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
202 while (__size > 0) { \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
203 asm volatile ("dcbst 0,%0;sync;" : : "r" (__base)); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
204 __base += HAL_DCACHE_LINE_SIZE; \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
205 __size -= HAL_DCACHE_LINE_SIZE; \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
206 } \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
207 CYG_MACRO_END
134
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
208
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
209 // Preread the given range into the cache with the intention of reading
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
210 // from it later.
1223
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
211 #define HAL_DCACHE_READ_HINT( _base_ , _size_ ) \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
212 CYG_MACRO_START \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
213 cyg_uint32 __base = (cyg_uint32) (_base_); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
214 cyg_int32 __size = (cyg_int32) (_size_); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
215 while (__size > 0) { \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
216 asm volatile ("dcbt 0,%0;" : : "r" (__base)); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
217 __base += HAL_DCACHE_LINE_SIZE; \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
218 __size -= HAL_DCACHE_LINE_SIZE; \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
219 } \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
220 CYG_MACRO_END
134
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
221
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
222 // Preread the given range into the cache with the intention of writing
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
223 // to it later.
1223
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
224 #define HAL_DCACHE_WRITE_HINT( _base_ , _size_ ) \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
225 CYG_MACRO_START \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
226 cyg_uint32 __base = (cyg_uint32) (_base_); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
227 cyg_int32 __size = (cyg_int32) (_size_); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
228 while (__size > 0) { \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
229 asm volatile ("dcbtst 0,%0;" : : "r" (__base)); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
230 __base += HAL_DCACHE_LINE_SIZE; \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
231 __size -= HAL_DCACHE_LINE_SIZE; \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
232 } \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
233 CYG_MACRO_END
134
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
234
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
235 // Allocate and zero the cache lines associated with the given range.
1223
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
236 #define HAL_DCACHE_ZERO( _base_ , _size_ ) \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
237 CYG_MACRO_START \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
238 cyg_uint32 __base = (cyg_uint32) (_base_); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
239 cyg_int32 __size = (cyg_int32) (_size_); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
240 while (__size > 0) { \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
241 asm volatile ("dcbz 0,%0;" : : "r" (__base)); \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
242 __base += HAL_DCACHE_LINE_SIZE; \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
243 __size -= HAL_DCACHE_LINE_SIZE; \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
244 } \
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
245 CYG_MACRO_END
134
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
246
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
247 //-----------------------------------------------------------------------------
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
248 // Global control of Instruction cache
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
249
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
250 // Enable the instruction cache
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
251 #define HAL_ICACHE_ENABLE()
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
252
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
253 // Disable the instruction cache
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
254 #define HAL_ICACHE_DISABLE()
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
255
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
256 // Invalidate the entire cache
136
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
257 #define HAL_ICACHE_INVALIDATE_ALL() \
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
258 CYG_MACRO_START \
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
259 int _i_, _indx_; \
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
260 _indx_ = 0; \
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
261 for (_i_ = 0; _i_ < HAL_ICACHE_SETS; _i_++) { \
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
262 asm volatile ("iccci 0,%0;" :: "r"(_indx_)); \
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
263 _indx_ += HAL_ICACHE_LINE_SIZE; \
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
264 } \
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
265 CYG_MACRO_END
134
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
266
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
267 // Synchronize the contents of the cache with memory.
136
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
268 #define HAL_ICACHE_SYNC() HAL_ICACHE_INVALIDATE_ALL()
134
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
269
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
270 // Query the state of the instruction cache
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
271 #define HAL_ICACHE_IS_ENABLED(_state_) \
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
272 CYG_MACRO_START \
136
a9ac27ec7abc Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents: 134
diff changeset
273 (_state_) = 1; \
134
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
274 CYG_MACRO_END
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
275
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
276 // Set the instruction cache refill burst size
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
277 //#define HAL_ICACHE_BURST_SIZE(_size_)
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
278
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
279 // Load the contents of the given address range into the instruction cache
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
280 // and then lock the cache so that it stays there.
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
281 //#define HAL_ICACHE_LOCK(_base_, _size_)
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
282
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
283 // Undo a previous lock operation
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
284 //#define HAL_ICACHE_UNLOCK(_base_, _size_)
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
285
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
286 // Unlock entire cache
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
287 #define HAL_ICACHE_UNLOCK_ALL()
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
288
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
289 //-----------------------------------------------------------------------------
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
290 // Instruction cache line control
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
291
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
292 // Invalidate cache lines in the given range without writing to memory.
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
293 //#define HAL_ICACHE_INVALIDATE( _base_ , _size_ )
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
294
1223
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
295 #ifdef CYGHWR_HAL_POWERPC_ENABLE_MMU
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
296 // Map a RAM address to a non-cached mirror
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
297 #define CYGARC_UNCACHED_ADDRESS(p) ((unsigned long)(p) | 0x80000000)
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
298 #else
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
299 #define CYGARC_UNCACHED_ADDRESS(p) (p)
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
300 #endif
dbcfe4e0dbd2 New platform - TAMS MOAB - and generic changes to support it
gthomas
parents: 210
diff changeset
301
134
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
302 //-----------------------------------------------------------------------------
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
303 #endif // ifndef CYGONCE_VAR_CACHE_H
d2f49caf9e38 Merge from eCos master repository on 2000-11-03-09:00:49-GMT
jlarmour
parents:
diff changeset
304 // End of var_cache.h