|
|
1.1 root 1: /******************************************************************************
2: * Copyright (c) 2004, 2008 IBM Corporation
3: * All rights reserved.
4: * This program and the accompanying materials
5: * are made available under the terms of the BSD License
6: * which accompanies this distribution, and is available at
7: * http://www.opensource.org/licenses/bsd-license.php
8: *
9: * Contributors:
10: * IBM Corporation - initial implementation
11: *****************************************************************************/
12:
13: #ifndef __CACHE_H
14: #define __CACHE_H
15:
16: #include <cpu.h>
17: #include <stdint.h>
18:
19: #define cache_inhibited_access(type,name) \
20: static inline type ci_read_##name(type * addr) \
21: { \
22: type val; \
23: set_ci(); \
24: val = *addr; \
25: clr_ci(); \
26: return val; \
27: } \
28: static inline void ci_write_##name(type * addr, type data) \
29: { \
30: set_ci(); \
31: *addr = data; \
32: clr_ci(); \
33: }
34:
35: cache_inhibited_access(uint8_t, 8)
36: cache_inhibited_access(uint16_t, 16)
37: cache_inhibited_access(uint32_t, 32)
38: cache_inhibited_access(uint64_t, 64)
39:
40: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.