svn commit: r211996 - in head/sys/mips/rmi: . dev/nlge dev/xlr

Jayachandran C. jchandra at FreeBSD.org
Mon Aug 30 13:26:07 UTC 2010


Author: jchandra
Date: Mon Aug 30 13:26:07 2010
New Revision: 211996
URL: http://svn.freebsd.org/changeset/base/211996

Log:
  Move debug.h to the the rge driver directory. rge.c is the only user of
  debug.h. Remove debug.h references from other files.

Added:
  head/sys/mips/rmi/dev/xlr/debug.h
     - copied unchanged from r211994, head/sys/mips/rmi/debug.h
Deleted:
  head/sys/mips/rmi/debug.h
Modified:
  head/sys/mips/rmi/dev/nlge/if_nlge.c
  head/sys/mips/rmi/dev/xlr/rge.c
  head/sys/mips/rmi/msgring.h

Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c
==============================================================================
--- head/sys/mips/rmi/dev/nlge/if_nlge.c	Mon Aug 30 13:08:13 2010	(r211995)
+++ head/sys/mips/rmi/dev/nlge/if_nlge.c	Mon Aug 30 13:26:07 2010	(r211996)
@@ -102,7 +102,6 @@ __FBSDID("$FreeBSD$");
 #include <mips/rmi/interrupt.h>
 #include <mips/rmi/msgring.h>
 #include <mips/rmi/iomap.h>
-#include <mips/rmi/debug.h>
 #include <mips/rmi/pic.h>
 #include <mips/rmi/board.h>
 #include <mips/rmi/rmi_mips_exts.h>

Copied: head/sys/mips/rmi/dev/xlr/debug.h (from r211994, head/sys/mips/rmi/debug.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/rmi/dev/xlr/debug.h	Mon Aug 30 13:26:07 2010	(r211996, copy of r211994, head/sys/mips/rmi/debug.h)
@@ -0,0 +1,105 @@
+/*-
+ * Copyright (c) 2003-2009 RMI Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of RMI Corporation, nor the names of its contributors,
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * RMI_BSD
+ * $FreeBSD$
+ */
+#ifndef _RMI_DEBUG_H_
+#define _RMI_DEBUG_H_
+
+#include <machine/atomic.h>
+
+enum {
+	//cacheline 0
+	MSGRNG_INT,
+	MSGRNG_PIC_INT,
+	MSGRNG_MSG,
+	MSGRNG_EXIT_STATUS,
+	MSGRNG_MSG_CYCLES,
+	//cacheline 1
+	NETIF_TX = 8,
+	NETIF_RX,
+	NETIF_TX_COMPLETE,
+	NETIF_TX_COMPLETE_TX,
+	NETIF_RX_CYCLES,
+	NETIF_TX_COMPLETE_CYCLES,
+	NETIF_TX_CYCLES,
+	NETIF_TIMER_START_Q,
+	//NETIF_REG_FRIN,
+	//NETIF_INT_REG,
+	//cacheline 2
+	REPLENISH_ENTER = 16,
+	REPLENISH_ENTER_COUNT,
+	REPLENISH_CPU,
+	REPLENISH_FRIN,
+	REPLENISH_CYCLES,
+	NETIF_STACK_TX,
+	NETIF_START_Q,
+	NETIF_STOP_Q,
+	//cacheline 3
+	USER_MAC_START = 24,
+	USER_MAC_INT = 24,
+	USER_MAC_TX_COMPLETE,
+	USER_MAC_RX,
+	USER_MAC_POLL,
+	USER_MAC_TX,
+	USER_MAC_TX_FAIL,
+	USER_MAC_TX_COUNT,
+	USER_MAC_FRIN,
+	//cacheline 4
+	USER_MAC_TX_FAIL_GMAC_CREDITS = 32,
+	USER_MAC_DO_PAGE_FAULT,
+	USER_MAC_UPDATE_TLB,
+	USER_MAC_UPDATE_BIGTLB,
+	USER_MAC_UPDATE_TLB_PFN0,
+	USER_MAC_UPDATE_TLB_PFN1,
+
+	XLR_MAX_COUNTERS = 40
+};
+extern int xlr_counters[MAXCPU][XLR_MAX_COUNTERS];
+extern __uint32_t msgrng_msg_cycles;
+
+#ifdef ENABLE_DEBUG
+#define xlr_inc_counter(x) atomic_add_int(&xlr_counters[PCPU_GET(cpuid)][(x)], 1)
+#define xlr_dec_counter(x) atomic_subtract_int(&xlr_counters[PCPU_GET(cpuid)][(x)], 1)
+#define xlr_set_counter(x, value) atomic_set_int(&xlr_counters[PCPU_GET(cpuid)][(x)], (value))
+#define xlr_get_counter(x) (&xlr_counters[0][(x)])
+
+#else				/* default mode */
+
+#define xlr_inc_counter(x)
+#define xlr_dec_counter(x)
+#define xlr_set_counter(x, value)
+#define xlr_get_counter(x)
+
+#endif
+
+#define dbg_msg(fmt, args...) printf(fmt, ##args)
+#define dbg_panic(fmt, args...) panic(fmt, ##args)
+
+#endif

Modified: head/sys/mips/rmi/dev/xlr/rge.c
==============================================================================
--- head/sys/mips/rmi/dev/xlr/rge.c	Mon Aug 30 13:08:13 2010	(r211995)
+++ head/sys/mips/rmi/dev/xlr/rge.c	Mon Aug 30 13:26:07 2010	(r211996)
@@ -95,11 +95,12 @@ __FBSDID("$FreeBSD$");
 #include <mips/rmi/interrupt.h>
 #include <mips/rmi/msgring.h>
 #include <mips/rmi/iomap.h>
-#include <mips/rmi/debug.h>
 #include <mips/rmi/pic.h>
 #include <mips/rmi/rmi_mips_exts.h>
 #include <mips/rmi/rmi_boot_info.h>
 #include <mips/rmi/board.h>
+
+#include <mips/rmi/dev/xlr/debug.h>
 #include <mips/rmi/dev/xlr/atx_cpld.h>
 #include <mips/rmi/dev/xlr/xgmac_mdio.h>
 #include <mips/rmi/dev/xlr/rge.h>

Modified: head/sys/mips/rmi/msgring.h
==============================================================================
--- head/sys/mips/rmi/msgring.h	Mon Aug 30 13:08:13 2010	(r211995)
+++ head/sys/mips/rmi/msgring.h	Mon Aug 30 13:26:07 2010	(r211996)
@@ -374,18 +374,12 @@ message_send(unsigned int size, unsigned
 
 	for (i = 0; i < 16; i++) {
 		status = msgrng_read_status();
-		//dbg_msg("status = %Lx\n", status);
 
 		if (status & 0x6) {
 			continue;
 		} else
 			break;
 	}
-	if (i == 16) {
-		if (dest == 0x61)
-			//dbg_msg("Processor %x: Unable to send msg to %llx\n", processor_id(), dest);
-		return status & 0x6;
-	}
 	return msgrng_read_status() & 0x06;
 }
 
@@ -417,16 +411,10 @@ static __inline__ int 
 message_receive(int pri, int *size, int *code, int *src_id,
     struct msgrng_msg *msg)
 {
-	int res = message_receive_fast(pri, *size, *code, *src_id, msg->msg0, msg->msg1, msg->msg2, msg->msg3);
-
-#ifdef MSGRING_DUMP_MESSAGES
-	if (!res) {
-		dbg_msg("Received msg <%llx, %llx, %llx, %llx> <%d,%d,%d>\n",
-		    msg->msg0, msg->msg1, msg->msg2, msg->msg3,
-		    *size, *code, *src_id);
-	}
-#endif
-
+	int res;
+       
+	res = message_receive_fast(pri, *size, *code, *src_id,
+			msg->msg0, msg->msg1, msg->msg2, msg->msg3);
 	return res;
 }
 


More information about the svn-src-all mailing list