Deleted Added
full compact
cop2.h (225394) cop2.h (227722)
1/*-
2 * Copyright 2003-2011 Netlogic Microsystems (Netlogic). All rights
3 * reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
8 *

--- 12 unchanged lines hidden (view full) ---

21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26 * THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * NETLOGIC_BSD
1/*-
2 * Copyright 2003-2011 Netlogic Microsystems (Netlogic). All rights
3 * reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
8 *

--- 12 unchanged lines hidden (view full) ---

21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26 * THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * NETLOGIC_BSD
29 * $FreeBSD: head/sys/mips/nlm/hal/cop2.h 225394 2011-09-05 10:45:29Z jchandra $
29 * $FreeBSD: head/sys/mips/nlm/hal/cop2.h 227722 2011-11-19 14:06:15Z jchandra $
30 */
31
32#ifndef __NLM_HAL_COP2_H__
30 */
31
32#ifndef __NLM_HAL_COP2_H__
33#define __NLM_HAL_COP2_H__
33#define __NLM_HAL_COP2_H__
34
34
35#define COP2_TX_BUF 0
36#define COP2_RX_BUF 1
37#define COP2_TXMSGSTATUS 2
38#define COP2_RXMSGSTATUS 3
39#define COP2_MSGSTATUS1 4
40#define COP2_MSGCONFIG 5
41#define COP2_MSGCONFIG1 6
35#define COP2_TX_BUF 0
36#define COP2_RX_BUF 1
37#define COP2_TXMSGSTATUS 2
38#define COP2_RXMSGSTATUS 3
39#define COP2_MSGSTATUS1 4
40#define COP2_MSGCONFIG 5
41#define COP2_MSGCONFIG1 6
42
42
43#define CROSSTHR_POPQ_EN 0x01
44#define VC0_POPQ_EN 0x02
45#define VC1_POPQ_EN 0x04
46#define VC2_POPQ_EN 0x08
47#define VC3_POPQ_EN 0x10
48#define ALL_VC_POPQ_EN 0x1E
49#define ALL_VC_CT_POPQ_EN 0x1F
43#define CROSSTHR_POPQ_EN 0x01
44#define VC0_POPQ_EN 0x02
45#define VC1_POPQ_EN 0x04
46#define VC2_POPQ_EN 0x08
47#define VC3_POPQ_EN 0x10
48#define ALL_VC_POPQ_EN 0x1E
49#define ALL_VC_CT_POPQ_EN 0x1F
50
51struct nlm_fmn_msg {
52 uint64_t msg[4];
53};
54
50
51struct nlm_fmn_msg {
52 uint64_t msg[4];
53};
54
55#define NLM_DEFINE_COP2_ACCESSORS32(name, reg, sel) \
55#define NLM_DEFINE_COP2_ACCESSORS32(name, reg, sel) \
56static inline uint32_t nlm_read_c2_##name(void) \
57{ \
58 uint32_t __rv; \
59 __asm__ __volatile__ ( \
60 ".set push\n" \
61 ".set noreorder\n" \
62 ".set mips64\n" \
63 "mfc2 %0, $%1, %2\n" \

--- 10 unchanged lines hidden (view full) ---

74 ".set noreorder\n" \
75 ".set mips64\n" \
76 "mtc2 %0, $%1, %2\n" \
77 ".set pop\n" \
78 : : "r" (val), "i" (reg), "i" (sel)); \
79} struct __hack
80
81#if (__mips == 64)
56static inline uint32_t nlm_read_c2_##name(void) \
57{ \
58 uint32_t __rv; \
59 __asm__ __volatile__ ( \
60 ".set push\n" \
61 ".set noreorder\n" \
62 ".set mips64\n" \
63 "mfc2 %0, $%1, %2\n" \

--- 10 unchanged lines hidden (view full) ---

74 ".set noreorder\n" \
75 ".set mips64\n" \
76 "mtc2 %0, $%1, %2\n" \
77 ".set pop\n" \
78 : : "r" (val), "i" (reg), "i" (sel)); \
79} struct __hack
80
81#if (__mips == 64)
82#define NLM_DEFINE_COP2_ACCESSORS64(name, reg, sel) \
82#define NLM_DEFINE_COP2_ACCESSORS64(name, reg, sel) \
83static inline uint64_t nlm_read_c2_##name(void) \
84{ \
85 uint64_t __rv; \
86 __asm__ __volatile__ ( \
87 ".set push\n" \
88 ".set noreorder\n" \
89 ".set mips64\n" \
90 "dmfc2 %0, $%1, %2\n" \

--- 11 unchanged lines hidden (view full) ---

102 ".set mips64\n" \
103 "dmtc2 %0, $%1, %2\n" \
104 ".set pop\n" \
105 : : "r" (val), "i" (reg), "i" (sel)); \
106} struct __hack
107
108#else
109
83static inline uint64_t nlm_read_c2_##name(void) \
84{ \
85 uint64_t __rv; \
86 __asm__ __volatile__ ( \
87 ".set push\n" \
88 ".set noreorder\n" \
89 ".set mips64\n" \
90 "dmfc2 %0, $%1, %2\n" \

--- 11 unchanged lines hidden (view full) ---

102 ".set mips64\n" \
103 "dmtc2 %0, $%1, %2\n" \
104 ".set pop\n" \
105 : : "r" (val), "i" (reg), "i" (sel)); \
106} struct __hack
107
108#else
109
110#define NLM_DEFINE_COP2_ACCESSORS64(name, reg, sel) \
110#define NLM_DEFINE_COP2_ACCESSORS64(name, reg, sel) \
111static inline uint64_t nlm_read_c2_##name(void) \
112{ \
113 uint32_t __high, __low; \
114 __asm__ __volatile__ ( \
115 ".set push\n" \
116 ".set noreorder\n" \
117 ".set mips64\n" \
118 "dmfc2 $8, $%2, %3\n" \

--- 181 unchanged lines hidden ---
111static inline uint64_t nlm_read_c2_##name(void) \
112{ \
113 uint32_t __high, __low; \
114 __asm__ __volatile__ ( \
115 ".set push\n" \
116 ".set noreorder\n" \
117 ".set mips64\n" \
118 "dmfc2 $8, $%2, %3\n" \

--- 181 unchanged lines hidden ---