1 /******************************************************************************
3 © 1995-2003, 2004, 2005-2011 Freescale Semiconductor, Inc.
6 This is proprietary source code of Freescale Semiconductor Inc.,
7 and its use is subject to the NetComm Device Drivers EULA.
8 The copyright notice above does not evidence any actual or intended
9 publication of such source code.
11 ALTERNATIVELY, redistribution and use in source and binary forms, with
12 or without modification, are permitted provided that the following
14 * Redistributions of source code must retain the above copyright
15 notice, this list of conditions and the following disclaimer.
16 * Redistributions in binary form must reproduce the above copyright
17 notice, this list of conditions and the following disclaimer in the
18 documentation and/or other materials provided with the distribution.
19 * Neither the name of Freescale Semiconductor nor the
20 names of its contributors may be used to endorse or promote products
21 derived from this software without specific prior written permission.
23 THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 **************************************************************************/
36 /******************************************************************************
39 @Description BM header
40 *//***************************************************************************/
46 #define __ERR_MODULE__ MODULE_BM
48 #if defined(DEBUG) || !defined(DISABLE_ASSERTIONS)
49 /* Optionally compile-in assertion-checking */
51 #endif /* defined(DEBUG) || ... */
53 /* TODO: NB, we currently assume that CORE_MemoryBarier() and lwsync() imply compiler barriers
54 * and that dcbzl(), dcbfl(), and dcbi() won't fall victim to compiler or
55 * execution reordering with respect to other code/instructions that manipulate
56 * the same cacheline. */
60 __asm__ __volatile__ ("dcbf 0, %0" : : "r" (addr)); \
64 #define dcbt_ro(addr) \
66 __asm__ __volatile__ ("dcbt 0, %0" : : "r" (addr)); \
69 #define dcbt_rw(addr) \
71 __asm__ __volatile__ ("dcbtst 0, %0" : : "r" (addr)); \
76 __asm__ __volatile__ ("dcbzl 0,%0" : : "r" (p)); \
89 /* Commonly used combo */
100 __asm__ __volatile__ ("dcbt 0,%0" : : "r" (p)); \
105 __asm__ __volatile__ ("dcbz 0,%0" : : "r" (p)); \
109 dcbz((char *)p + 32); \
114 dcbf((char *)p + 32); \
117 /* Commonly used combo */
118 #define dcbit_ro(p) \
121 dcbi((char *)p + 32); \
123 dcbt_ro((char *)p + 32); \
126 #endif /* CORE_E500MC */
128 #define dcbi(p) dcbf(p)
131 void *addr_ce; /* cache-enabled */
132 void *addr_ci; /* cache-inhibited */
137 struct bm_rcr_entry *ring, *cursor;
138 uint8_t ci, available, ithresh, vbit;
141 e_BmPortalProduceMode pmode;
142 e_BmPortalRcrConsumeMode cmode;
143 #endif /* BM_CHECKING */
148 struct bm_mc_command *cr;
149 struct bm_mc_result *rr;
153 /* Can only be _mc_start()ed */
155 /* Can only be _mc_commit()ed or _mc_abort()ed */
157 /* Can only be _mc_retry()ed */
160 #endif /* BM_CHECKING */
163 /********************/
164 /* Portal structure */
165 /********************/
174 #endif /* __BMAN_PRIV_H */