1
/******************************************************************************
2
* Copyright (c) 2004, 2008 IBM Corporation
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
10
* IBM Corporation - initial implementation
11
*****************************************************************************/
30
#define SETCI(r) sync; \
42
#define CLRCI(r) sync; \
55
/* This macro uses r0 */
56
#define FLUSH_CACHE(r, n) add n, n, r; \
58
rlwinm r, r, 0,0,24; \
59
rlwinm n, n, 0,0,24; \
72
#define STRINGIFY(x...) #x
73
#define EXPAND(x) STRINGIFY(x)
79
asm volatile(EXPAND(SETCI(%0)) : "=r"(tmp) :: "memory", "cc");
86
asm volatile(EXPAND(CLRCI(%0)) : "=r"(tmp) :: "memory", "cc");
92
asm volatile ("eieio":::"memory");
96
flush_cache(void* r, long n)
98
asm volatile(EXPAND(FLUSH_CACHE(%0, %1)) : "+r"(r), "+r"(n) :: "memory", "cc", "r0", "ctr");
101
#endif /* __ASSEMBLER__ */