Mercurial > ecos-v2_0-branch
annotate packages/hal/arm/pid/current/include/hal_cache.h @ 66:bf00f99aec69 ecos-sw-2000-02-02
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
| author | jlarmour |
|---|---|
| date | Wed, 02 Feb 2000 19:57:02 +0000 |
| parents | c38311975d4f |
| children | b939e9cada46 |
| rev | line source |
|---|---|
| 2 | 1 #ifndef CYGONCE_HAL_CACHE_H |
| 2 #define CYGONCE_HAL_CACHE_H | |
| 3 | |
| 4 //============================================================================= | |
| 5 // | |
| 6 // hal_cache.h | |
| 7 // | |
| 8 // HAL cache control API | |
| 9 // | |
| 10 //============================================================================= | |
| 11 //####COPYRIGHTBEGIN#### | |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
12 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
13 // ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
14 // The contents of this file are subject to the Red Hat eCos Public License |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
15 // Version 1.1 (the "License"); you may not use this file except in |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
16 // compliance with the License. You may obtain a copy of the License at |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
17 // http://www.redhat.com/ |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
18 // |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
19 // Software distributed under the License is distributed on an "AS IS" |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
20 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
21 // License for the specific language governing rights and limitations under |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
22 // the License. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
23 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
24 // The Original Code is eCos - Embedded Configurable Operating System, |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
25 // released September 30, 1998. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
26 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
27 // The Initial Developer of the Original Code is Red Hat. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
28 // Portions created by Red Hat are |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
29 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
30 // All Rights Reserved. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
31 // ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
32 // |
| 2 | 33 //####COPYRIGHTEND#### |
| 34 //============================================================================= | |
| 35 //#####DESCRIPTIONBEGIN#### | |
| 36 // | |
| 37 // Author(s): nickg, gthomas | |
| 38 // Contributors: nickg, gthomas | |
| 39 // Date: 1998-09-28 | |
| 40 // Purpose: Cache control API | |
| 41 // Description: The macros defined here provide the HAL APIs for handling | |
| 42 // cache control operations. | |
| 43 // Usage: | |
| 44 // #include <cyg/hal/hal_cache.h> | |
| 45 // ... | |
| 46 // | |
| 47 // | |
| 48 //####DESCRIPTIONEND#### | |
| 49 // | |
| 50 //============================================================================= | |
| 51 | |
| 52 #include <cyg/infra/cyg_type.h> | |
| 53 | |
| 54 //----------------------------------------------------------------------------- | |
| 55 // Cache dimensions | |
| 56 | |
| 57 // Data cache | |
| 58 #define HAL_DCACHE_SIZE 0 // Size of data cache in bytes | |
| 59 #define HAL_DCACHE_LINE_SIZE 0 // Size of a data cache line | |
| 60 #define HAL_DCACHE_WAYS 0 // Associativity of the cache | |
| 61 | |
| 62 // Instruction cache | |
| 63 #define HAL_ICACHE_SIZE 0 // Size of cache in bytes | |
| 64 #define HAL_ICACHE_LINE_SIZE 0 // Size of a cache line | |
| 65 #define HAL_ICACHE_WAYS 0 // Associativity of the cache | |
| 66 | |
| 67 #define HAL_DCACHE_SETS (HAL_DCACHE_SIZE/(HAL_DCACHE_LINE_SIZE*HAL_DCACHE_WAYS)) | |
| 68 #define HAL_ICACHE_SETS (HAL_ICACHE_SIZE/(HAL_ICACHE_LINE_SIZE*HAL_ICACHE_WAYS)) | |
| 69 | |
| 70 //----------------------------------------------------------------------------- | |
| 71 // Global control of data cache | |
| 72 | |
| 73 // Enable the data cache | |
| 74 #define HAL_DCACHE_ENABLE() | |
| 75 | |
| 76 // Disable the data cache | |
| 77 #define HAL_DCACHE_DISABLE() | |
| 78 | |
| 79 // Invalidate the entire cache | |
| 80 #define HAL_DCACHE_INVALIDATE_ALL() | |
| 81 | |
| 82 // Synchronize the contents of the cache with memory. | |
| 83 #define HAL_DCACHE_SYNC() | |
| 84 | |
| 85 // Purge contents of data cache | |
| 86 #define HAL_DCACHE_PURGE_ALL() | |
| 87 | |
| 88 // Set the data cache refill burst size | |
| 89 //#define HAL_DCACHE_BURST_SIZE(_size_) | |
| 90 | |
| 91 // Set the data cache write mode | |
| 92 //#define HAL_DCACHE_WRITE_MODE( _mode_ ) | |
| 93 | |
| 94 //#define HAL_DCACHE_WRITETHRU_MODE 0 | |
| 95 //#define HAL_DCACHE_WRITEBACK_MODE 1 | |
| 96 | |
| 97 // Load the contents of the given address range into the data cache | |
| 98 // and then lock the cache so that it stays there. | |
| 99 //#define HAL_DCACHE_LOCK(_base_, _size_) | |
| 100 | |
| 101 // Undo a previous lock operation | |
| 102 //#define HAL_DCACHE_UNLOCK(_base_, _size_) | |
| 103 | |
| 104 // Unlock entire cache | |
| 105 //#define HAL_DCACHE_UNLOCK_ALL() | |
| 106 | |
| 107 //----------------------------------------------------------------------------- | |
| 108 // Data cache line control | |
| 109 | |
| 110 // Allocate cache lines for the given address range without reading its | |
| 111 // contents from memory. | |
| 112 //#define HAL_DCACHE_ALLOCATE( _base_ , _size_ ) | |
| 113 | |
| 114 // Write dirty cache lines to memory and invalidate the cache entries | |
| 115 // for the given address range. | |
| 116 //#define HAL_DCACHE_FLUSH( _base_ , _size_ ) | |
| 117 | |
| 118 // Invalidate cache lines in the given range without writing to memory. | |
| 119 //#define HAL_DCACHE_INVALIDATE( _base_ , _size_ ) | |
| 120 | |
| 121 // Write dirty cache lines to memory for the given address range. | |
| 122 //#define HAL_DCACHE_STORE( _base_ , _size_ ) | |
| 123 | |
| 124 // Preread the given range into the cache with the intention of reading | |
| 125 // from it later. | |
| 126 //#define HAL_DCACHE_READ_HINT( _base_ , _size_ ) | |
| 127 | |
| 128 // Preread the given range into the cache with the intention of writing | |
| 129 // to it later. | |
| 130 //#define HAL_DCACHE_WRITE_HINT( _base_ , _size_ ) | |
| 131 | |
| 132 // Allocate and zero the cache lines associated with the given range. | |
| 133 //#define HAL_DCACHE_ZERO( _base_ , _size_ ) | |
| 134 | |
| 135 //----------------------------------------------------------------------------- | |
| 136 // Global control of Instruction cache | |
| 137 | |
| 138 // Enable the instruction cache | |
| 139 #define HAL_ICACHE_ENABLE() | |
| 140 | |
| 141 // Disable the instruction cache | |
| 142 #define HAL_ICACHE_DISABLE() | |
| 143 | |
| 144 // Invalidate the entire cache | |
| 145 #define HAL_ICACHE_INVALIDATE_ALL() | |
| 146 | |
| 147 // Synchronize the contents of the cache with memory. | |
| 148 #define HAL_ICACHE_SYNC() | |
| 149 | |
| 150 // Set the instruction cache refill burst size | |
| 151 //#define HAL_ICACHE_BURST_SIZE(_size_) | |
| 152 | |
| 153 // Load the contents of the given address range into the instruction cache | |
| 154 // and then lock the cache so that it stays there. | |
| 155 //#define HAL_ICACHE_LOCK(_base_, _size_) | |
| 156 | |
| 157 // Undo a previous lock operation | |
| 158 //#define HAL_ICACHE_UNLOCK(_base_, _size_) | |
| 159 | |
| 160 // Unlock entire cache | |
| 161 //#define HAL_ICACHE_UNLOCK_ALL() | |
| 162 | |
| 163 //----------------------------------------------------------------------------- | |
| 164 // Instruction cache line control | |
| 165 | |
| 166 // Invalidate cache lines in the given range without writing to memory. | |
| 167 //#define HAL_ICACHE_INVALIDATE( _base_ , _size_ ) | |
| 168 | |
| 169 //----------------------------------------------------------------------------- | |
| 170 #endif // ifndef CYGONCE_HAL_CACHE_H | |
| 171 // End of hal_cache.h |
