From: jmerkey@wolfmountaingroup.com
To: linux-kernel@vger.kernel.org
Subject: [PATCH 2.6.26 9/25] mdb: Merkey's Kernel Debugger
Date: Sun, 3 Aug 2008 20:11:57 -0600 (MDT) [thread overview]
Message-ID: <57510.166.70.238.45.1217815917.squirrel@webmail.wolfmountaingroup.com> (raw)
In-Reply-To:
Netware Style Debugger for Linux written by Jeffrey Vernon Merkey
--- linux-2.6.26/debug/mdb-ia32.h 1969-12-31 17:00:00.000000000 -0700 +++
linux-2.6.26-mdb/debug/mdb-ia32.h 2008-08-03 12:49:01.000000000 -0600 @@
-0,0 +1,175 @@
+
+/***************************************************************************
+*
+* Copyright (c) 2008 Jeff V. Merkey All Rights Reserved.
+* 1058 East 50 South
+* Lindon, Utah 84042
+* jmerkey@wolfmountaingroup.com
+*
+* This program is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation, version 3.
+*
+* This program is distributed in the hope that it will be useful, but
+* WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +*
General Public License for more details.
+*
+* You are free to modify and re-distribute this program in accordance
+* with the terms specified in the GNU Public License. The copyright +*
contained in this code is required to be present in any derivative +*
works and you are required to provide the source code for this +*
program as part of any commercial or non-commercial distribution. +* You
are required to respect the rights of the Copyright holders +* named
within this code.
+*
+* jmerkey@wolfmountaingroup.com is the official maintainer of
+* this code. You are encouraged to report any bugs, problems, fixes,
+* suggestions, and comments about this software.
+*
+* AUTHOR : Jeff V. Merkey
+* FILE : MDB-IA32.H
+* DESCRIP : Merkey's NetWare Debugger
+* DATE : April 8, 2008
+*
+***************************************************************************/
+
+#ifndef _MDB_IA32_H
+#define _MDB_IA32_H
+
+typedef struct _StackFrame {
+ ULONG tReserved[7];
+ ULONG *tCR3;
+ ULONG tEIP;
+ ULONG tSystemFlags;
+ ULONG tEAX;
+ ULONG tECX;
+ ULONG tEDX;
+ ULONG tEBX;
+ ULONG tESP;
+ ULONG tEBP;
+ ULONG tESI;
+ ULONG tEDI;
+ WORD tES;
+ WORD Res1;
+ WORD tCS;
+ WORD Res2;
+ WORD tSS;
+ WORD Res3;
+ WORD tDS;
+ WORD Res4;
+ WORD tFS;
+ WORD Res5;
+ WORD tGS;
+ WORD Res6;
+ WORD tLDT;
+ WORD Res7;
+ ULONG tIOMap;
+} StackFrame;
+
+// 128 bytes total size numeric register context
+
+typedef struct _NPXREG {
+ WORD sig0; // 10 bytes total size this structure
+ WORD sig1;
+ WORD sig2;
+ WORD sig3;
+ WORD exponent:15;
+ WORD sign:1;
+} NUMERIC_REGISTER_CONTEXT;
+
+typedef struct _NPX {
+ ULONG control;
+ ULONG status;
+ ULONG tag;
+ ULONG eip;
+ ULONG cs;
+ ULONG dataptr;
+ ULONG datasel;
+ NUMERIC_REGISTER_CONTEXT reg[8]; // 80 bytes
+ ULONG pad[5];
+} NUMERIC_FRAME;
+
+// 128 bytes total size register context
+
+typedef struct _CONTEXT_FRAME {
+ WORD cBackLink;
+ WORD cTSSReserved;
+ ULONG cESP0;
+ WORD cSS0;
+ WORD cSS0res;
+ ULONG cESP1;
+ WORD cSS1;
+ WORD cSS1res;
+ ULONG cESP2;
+ WORD cSS2;
+ WORD cSS2res;
+ ULONG cCR3;
+ ULONG cEIP;
+ ULONG cSystemFlags;
+ ULONG cEAX;
+ ULONG cECX;
+ ULONG cEDX;
+ ULONG cEBX;
+ ULONG cESP;
+ ULONG cEBP;
+ ULONG cESI;
+ ULONG cEDI;
+ ULONG cES;
+ ULONG cCS;
+ ULONG cSS;
+ ULONG cDS;
+ ULONG cFS;
+ ULONG cGS;
+ ULONG cLDT;
+ ULONG cIOPermissMap;
+ ULONG pad[6];
+} CONTEXT_FRAME;
+
+static inline void _cli(void)
+{
+ __asm__ __volatile__("cli" : : : "memory");
+}
+
+static inline void _sti(void)
+{
+ __asm__ __volatile__("sti" : : : "memory");
+}
+
+static inline unsigned long get_flags(void)
+{
+ unsigned long flags;
+
+ __asm__ __volatile__(
+ "pushfl ; popl %0"
+ : "=g" (flags)
+ : /* no input */
+ );
+ return flags;
+}
+
+static inline unsigned long save_flags(void)
+{
+ unsigned long flags;
+
+ __asm__ __volatile__(
+ "pushfl ; popl %0"
+ : "=g" (flags)
+ : /* no input */
+ );
+ __asm__ __volatile__("cli" : : : "memory");
+ return flags;
+}
+
+static inline void restore_flags(unsigned long flags)
+{
+ __asm__ __volatile__(
+ "pushl %0 ; popfl"
+ :
+ :"g" (flags)
+ :"memory", "cc"
+ );
+}
+
+#endif
+
By making a contribution to this project, I certify that the contribution
was created in whole or in part by me and I have the right to submit it
under the open source license indicated in the file
Jeffrey Vernon Merkey
reply other threads:[~2008-08-04 2:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=57510.166.70.238.45.1217815917.squirrel@webmail.wolfmountaingroup.com \
--to=jmerkey@wolfmountaingroup.com \
--cc=linux-kernel@vger.kernel.org \
/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®