mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Henrik Kretzschmar <henne@nachtwindheim.de>
To: jonathan@buzzard.org.uk
Cc: alan@linux.intel.com, tlinux-users@tce.toshiba-dme.co.jp,
	linux-kernel@vger.kernel.org,
	Henrik Kretzschmar <henne@nachtwindheim.de>
Subject: [PATCH 4/4] [DRIVERS] add a register dumper for debugging
Date: Fri, 22 Jan 2010 22:41:12 +0100	[thread overview]
Message-ID: <1264196472-5387-4-git-send-email-henne@nachtwindheim.de> (raw)
In-Reply-To: <1264196472-5387-3-git-send-email-henne@nachtwindheim.de>

Add a dumper to examine the changes of the registers before and after
calling the Toshiba SMM.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
---
 drivers/char/toshiba.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/drivers/char/toshiba.c b/drivers/char/toshiba.c
index 111baba..626d281 100644
--- a/drivers/char/toshiba.c
+++ b/drivers/char/toshiba.c
@@ -75,6 +75,20 @@
 #define DRV_NAME "toshiba"
 #define TOSH_MINOR_DEV 181
 
+#if TOSH_DEBUG == 1
+static void pr_smmregs(SMMRegisters *regs)
+{
+	printk(KERN_DEBUG DRV_NAME " EAX: 0x%08x EBX: 0x%08x ECX: 0x%08x\n",
+	       regs->eax, regs->ebx, regs->ecx);
+	printk(KERN_DEBUG DRV_NAME " EDX: 0x%08x ESI: 0x%08x EDI: 0x%08x\n",
+	       regs->edx, regs->esi, regs->edi);
+}
+#else
+static inline void pr_smmregs(SMMRegisters *regs)
+{
+}
+#endif
+
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Jonathan Buzzard <jonathan@buzzard.org.uk>");
 MODULE_DESCRIPTION("Toshiba laptop SMM driver");
@@ -220,6 +234,9 @@ int tosh_smm(SMMRegisters *regs)
 {
 	int eax;
 
+	printk(KERN_DEBUG DRV_NAME " %s start\n", __func__);
+	pr_smmregs(regs);
+
 	asm ("# load the values into the registers\n\t" \
 		"pushl %%eax\n\t" \
 		"movl 0(%%eax),%%edx\n\t" \
@@ -249,6 +266,9 @@ int tosh_smm(SMMRegisters *regs)
 		: "a" (regs)
 		: "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory");
 
+	pr_smmregs(regs);
+	printk(KERN_DEBUG DRV_NAME " %s done\n", __func__);
+
 	return eax;
 }
 EXPORT_SYMBOL(tosh_smm);
-- 
1.6.5


      reply	other threads:[~2010-01-22 21:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-22 21:41 [PATCH 1/4] [DRIVERS]: add Toshiba Portege M100 Fn key port Henrik Kretzschmar
2010-01-22 21:41 ` [PATCH 2/4] [DRIVERS]: use __init in drivers/char/toshiba.c Henrik Kretzschmar
2010-01-22 21:41   ` [PATCH 3/4] [DRIVERS] loglevel clenup in toshiba.c Henrik Kretzschmar
2010-01-22 21:41     ` Henrik Kretzschmar [this message]

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=1264196472-5387-4-git-send-email-henne@nachtwindheim.de \
    --to=henne@nachtwindheim.de \
    --cc=alan@linux.intel.com \
    --cc=jonathan@buzzard.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tlinux-users@tce.toshiba-dme.co.jp \
    /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

all inboxes | Powered by JetHome®