Mercurial > flash_v2
annotate packages/hal/i386/arch/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 | feb0fcf83327 |
| 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 | |
| 38 // Contributors:proven | |
| 39 // Date: 1998-10-29 | |
| 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 //####DESCRIPTIONEND#### | |
| 48 // | |
| 49 //============================================================================= | |
| 50 | |
| 51 #include <cyg/infra/cyg_type.h> | |
| 52 | |
| 53 //----------------------------------------------------------------------------- | |
| 54 // Cache dimensions | |
| 55 | |
| 56 // Data cache | |
| 57 #define HAL_DCACHE_SIZE 4096 // Size of data cache in bytes | |
| 58 #define HAL_DCACHE_LINE_SIZE 16 // Size of a data cache line | |
| 59 #define HAL_DCACHE_WAYS 2 // Associativity of the cache | |
| 60 | |
| 61 // Instruction cache | |
| 62 #define HAL_ICACHE_SIZE 4096 // Size of cache in bytes | |
| 63 #define HAL_ICACHE_LINE_SIZE 16 // Size of a cache line | |
| 64 #define HAL_ICACHE_WAYS 2 // Associativity of the cache | |
| 65 | |
| 66 #define HAL_DCACHE_SETS (HAL_DCACHE_SIZE/(HAL_DCACHE_LINE_SIZE*HAL_DCACHE_WAYS)) | |
| 67 #define HAL_ICACHE_SETS (HAL_ICACHE_SIZE/(HAL_ICACHE_LINE_SIZE*HAL_ICACHE_WAYS)) | |
| 68 | |
| 69 //----------------------------------------------------------------------------- | |
| 70 // Global control of data cache | |
| 71 | |
| 72 // Enable the data cache | |
| 73 #define HAL_DCACHE_ENABLE() | |
| 74 | |
| 75 // Disable the data cache | |
| 76 #define HAL_DCACHE_DISABLE() | |
| 77 | |
| 78 // Invalidate the entire cache | |
| 79 #define HAL_DCACHE_INVALIDATE_ALL() | |
| 80 | |
| 81 // Synchronize the contents of the cache with memory. | |
| 82 #define HAL_DCACHE_SYNC() | |
| 83 | |
| 84 // Set the data cache refill burst size | |
| 85 //#define HAL_DCACHE_BURST_SIZE(_size_) | |
| 86 | |
| 87 // Set the data cache write mode | |
| 88 //#define HAL_DCACHE_WRITE_MODE( _mode_ ) | |
| 89 | |
| 90 //#define HAL_DCACHE_WRITETHRU_MODE 0 | |
| 91 //#define HAL_DCACHE_WRITEBACK_MODE 1 | |
| 92 | |
| 93 // Load the contents of the given address range into the data cache | |
| 94 // and then lock the cache so that it stays there. | |
| 95 //#define HAL_DCACHE_LOCK(_base_, _size_) | |
| 96 | |
| 97 // Undo a previous lock operation | |
| 98 //#define HAL_DCACHE_UNLOCK(_base_, _size_) | |
| 99 | |
| 100 // Unlock entire cache | |
| 101 //#define HAL_DCACHE_UNLOCK_ALL() | |
| 102 | |
| 103 //----------------------------------------------------------------------------- | |
| 104 // Data cache line control | |
| 105 | |
| 106 // Allocate cache lines for the given address range without reading its | |
| 107 // contents from memory. | |
| 108 //#define HAL_DCACHE_ALLOCATE( _base_ , _size_ ) | |
| 109 | |
| 110 // Write dirty cache lines to memory and invalidate the cache entries | |
| 111 // for the given address range. | |
| 112 //#define HAL_DCACHE_FLUSH( _base_ , _size_ ) | |
| 113 | |
| 114 // Invalidate cache lines in the given range without writing to memory. | |
| 115 //#define HAL_DCACHE_INVALIDATE( _base_ , _size_ ) | |
| 116 | |
| 117 // Write dirty cache lines to memory for the given address range. | |
| 118 //#define HAL_DCACHE_STORE( _base_ , _size_ ) | |
| 119 | |
| 120 // Preread the given range into the cache with the intention of reading | |
| 121 // from it later. | |
| 122 //#define HAL_DCACHE_READ_HINT( _base_ , _size_ ) | |
| 123 | |
| 124 // Preread the given range into the cache with the intention of writing | |
| 125 // to it later. | |
| 126 //#define HAL_DCACHE_WRITE_HINT( _base_ , _size_ ) | |
| 127 | |
| 128 // Allocate and zero the cache lines associated with the given range. | |
| 129 //#define HAL_DCACHE_ZERO( _base_ , _size_ ) | |
| 130 | |
| 131 //----------------------------------------------------------------------------- | |
| 132 // Global control of Instruction cache | |
| 133 | |
| 134 // Enable the instruction cache | |
| 135 #define HAL_ICACHE_ENABLE() | |
| 136 | |
| 137 // Disable the instruction cache | |
| 138 #define HAL_ICACHE_DISABLE() | |
| 139 | |
| 140 // Invalidate the entire cache | |
| 141 #define HAL_ICACHE_INVALIDATE_ALL() | |
| 142 | |
| 143 // Synchronize the contents of the cache with memory. | |
| 144 #define HAL_ICACHE_SYNC() | |
| 145 | |
| 146 // Set the instruction cache refill burst size | |
| 147 //#define HAL_ICACHE_BURST_SIZE(_size_) | |
| 148 | |
| 149 // Load the contents of the given address range into the instruction cache | |
| 150 // and then lock the cache so that it stays there. | |
| 151 //#define HAL_ICACHE_LOCK(_base_, _size_) | |
| 152 | |
| 153 // Undo a previous lock operation | |
| 154 //#define HAL_ICACHE_UNLOCK(_base_, _size_) | |
| 155 | |
| 156 //----------------------------------------------------------------------------- | |
| 157 // Instruction cache line control | |
| 158 | |
| 159 // Invalidate cache lines in the given range without writing to memory. | |
| 160 //#define HAL_ICACHE_INVALIDATE( _base_ , _size_ ) | |
| 161 | |
| 162 //----------------------------------------------------------------------------- | |
| 163 #endif // ifndef CYGONCE_HAL_CACHE_H | |
| 164 // End of hal_cache.h |
