xref: /illumos-gate/usr/src/uts/common/io/bnx/bnx_mm.h (revision 8a2b682e57a046b828f37bcde1776f131ef4629f)
1 /*
2  * Copyright 2014-2017 Cavium, Inc.
3  * The contents of this file are subject to the terms of the Common Development
4  * and Distribution License, v.1,  (the "License").
5  *
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the License at available
9  * at http://opensource.org/licenses/CDDL-1.0
10  *
11  * See the License for the specific language governing permissions and
12  * limitations under the License.
13  */
14 
15 /*
16  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
17  */
18 
19 #ifndef	_BNX_MM_H
20 #define	_BNX_MM_H
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #include <sys/atomic.h>
27 
28 #define	mm_read_barrier() membar_consumer()
29 #define	mm_write_barrier() membar_producer()
30 
31 #include "lm.h"
32 #include "lm5706.h"
33 
34 #define	FLUSHPOSTEDWRITES(_lmdevice)					\
35 	{								\
36 		volatile uint32_t dummy;				\
37 		REG_RD((_lmdevice), pci_config.pcicfg_int_ack_cmd, &dummy); \
38 	}
39 
40 #ifdef __cplusplus
41 }
42 #endif
43 
44 #endif	/* _BNX_MM_H */
45