public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@kernel.crashing.org>
To: Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Pavel Machek <pavel@suse.cz>,
	"Amit S. Kale" <amitkale@emsyssoft.com>,
	kgdb-bugreport@lists.sourceforge.net
Subject: [KGDB PATCH][6/7] KGDBOE fixes
Date: Fri, 27 Feb 2004 14:52:11 -0700	[thread overview]
Message-ID: <20040227215211.GI1052@smtp.west.cox.net> (raw)
In-Reply-To: <20040227214605.GH1052@smtp.west.cox.net>

Hello.  The following is a couple of small but important cleanups to kgdboe.
- memset out_buf in case we don't have it full when we flush.
- In rx_hook, if netpoll_trap() is set, clear it.  If kgdb_isn't connected,
  schedule a breakpoint, and never call breakpoint() directly.
- In kgdb_serial->hook, set netpoll_trap(1).  kgdb_serial->hook must be
  called prior to using a 'serial' port, so this is where we should stick
  this.
- Backout unneeded changes to other files.

--- linux-2.6.3/drivers/net/kgdb_eth.c.orig	2004-02-27 13:27:53.778658691 -0700
+++ linux-2.6.3/drivers/net/kgdb_eth.c	2004-02-27 13:32:07.920255062 -0700
@@ -18,6 +18,7 @@
  * Refactored for netpoll API by Matt Mackall <mpm@selenic.com>
  *
  * Some cleanups by Pavel Machek <pavel@suse.cz>
+ * Further cleanups by Tom Rini <trini@mvista.com>
  */
 
 #include <linux/module.h>
@@ -60,7 +61,6 @@
 static atomic_t in_count;
 int kgdboe = 0;			/* Default to tty mode */
 
-extern void breakpoint(void);
 static void rx_hook(struct netpoll *np, int port, char *msg, int len);
 
 static struct netpoll np = {
@@ -89,6 +89,7 @@
 {
 	if (out_count && np.dev) {
 		netpoll_send_udp(&np, out_buf, out_count);
+		memset(out_buf, 0, sizeof(out_buf));
 		out_count = 0;
 	}
 }
@@ -107,12 +108,15 @@
 	np->remote_port = port;

+	/* Do we need to clear the trap? */
+	if (netpoll_trap())
+		netpoll_set_trap(0);
 	/* Is this gdb trying to attach? */
-	if (!netpoll_trap() && len == 8 && !strncmp(msg, "$Hc-1#09", 8))
-		breakpoint();
+	if (kgdb_connected) {
+		kgdb_schedule_breakpoint();
 
 	for (i = 0; i < len; i++) {
 		if (msg[i] == 3)
-			breakpoint();
+			kgdb_schedule_breakpoint();
 
 		if (atomic_read(&in_count) >= IN_BUF_SIZE) {
 			/* buffer overflow, clear it */
@@ -138,6 +141,9 @@
 	/* Un-initalized, don't go further. */
 	if (kgdboe != 1)
 		return 1;
+
+	netpoll_set_trap(1);
+
 	return 0;
 }
 
--- linux-2.6.3/net/core/skbuff.c.orig	2004-02-27 13:30:21.107968572 -0700
+++ linux-2.6.3/net/core/skbuff.c	2004-02-27 13:30:44.279825113 -0700
@@ -55,7 +55,6 @@
 #include <linux/rtnetlink.h>
 #include <linux/init.h>
 #include <linux/highmem.h>
-#include <linux/debugger.h>
 
 #include <net/protocol.h>
 #include <net/dst.h>
--- linux-2.6.3/net/core/dev.c.orig	2004-02-27 13:30:27.687508165 -0700
+++ linux-2.6.3/net/core/dev.c	2004-02-27 13:30:44.261829108 -0700
@@ -1547,6 +1547,7 @@
 }
 #endif
 
+
 /**
  *	netif_rx	-	post buffer to the network code
  *	@skb: buffer to post

-- 
Tom Rini
http://gate.crashing.org/~trini/

  reply	other threads:[~2004-02-27 21:52 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-27 21:23 [KGDB PATCH][1/7] Add / use kernel/Kconfig.kgdb Tom Rini
2004-02-27 21:25 ` [KGDB PATCH][2/7] Serial updates, take 2 Tom Rini
2004-02-27 21:32   ` [KGDB PATCH][3/7] SysRq-G Tom Rini
2004-02-27 21:40     ` [KGDB PATCH][4/7] Fix x86_64 hooks Tom Rini
2004-02-27 21:46       ` [KGDB PATCH][5/7] Fix ppc32 hooks Tom Rini
2004-02-27 21:52         ` Tom Rini [this message]
2004-02-27 21:54           ` [KGDB PATCH][7/7] Move debugger_entry() Tom Rini
2004-02-27 22:53             ` [Kgdb-bugreport] " George Anzinger
2004-02-27 23:08               ` Tom Rini
2004-03-01 10:08             ` Amit S. Kale
2004-03-03  1:08               ` George Anzinger
2004-03-03  5:45                 ` Amit S. Kale
2004-03-11 21:24                   ` George Anzinger
2004-03-11 22:27                     ` Tom Rini
2004-03-11 22:49                       ` George Anzinger
2004-03-11 22:58                         ` Tom Rini
2004-03-12  4:42                     ` Amit S. Kale
2004-03-12 15:11                       ` Tom Rini
2004-03-01 10:42           ` [KGDB PATCH][6/7] KGDBOE fixes Amit S. Kale
2004-03-01 12:31         ` [KGDB PATCH][5/7] Fix ppc32 hooks Amit S. Kale
2004-03-01 12:33       ` [KGDB PATCH][4/7] Fix x86_64 hooks Amit S. Kale
2004-02-27 22:49     ` [Kgdb-bugreport] [KGDB PATCH][3/7] SysRq-G George Anzinger
2004-03-01 10:05       ` Amit S. Kale
2004-02-27 22:44   ` [Kgdb-bugreport] [KGDB PATCH][2/7] Serial updates, take 2 George Anzinger
2004-02-27 23:11     ` Tom Rini
2004-02-27 23:53       ` George Anzinger
2004-03-01 15:28         ` Tom Rini
2004-03-02 11:36           ` Amit S. Kale
2004-03-02 15:04             ` Tom Rini
2004-02-27 22:30 ` [Kgdb-bugreport] [KGDB PATCH][1/7] Add / use kernel/Kconfig.kgdb George Anzinger
2004-02-27 22:39   ` Tom Rini
2004-02-27 23:50   ` Pavel Machek
2004-02-28  1:08     ` George Anzinger
2004-03-01  9:24       ` Amit S. Kale
2004-03-02 21:38         ` George Anzinger
2004-03-03  5:30           ` Amit S. Kale
2004-03-04  0:15             ` George Anzinger
2004-03-01  9:28 ` Amit S. Kale
2004-03-02 11:39 ` Amit S. Kale
2004-03-02 15:05   ` Tom Rini
2004-03-02 22:23     ` Pavel Machek
2004-03-02 22:34       ` Tom Rini
2004-03-02 22:35         ` Pavel Machek
2004-03-03  7:54           ` Amit S. Kale

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040227215211.GI1052@smtp.west.cox.net \
    --to=trini@kernel.crashing.org \
    --cc=amitkale@emsyssoft.com \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox