public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Dave Hansen <haveblue@us.ibm.com>
Cc: "Martin J. Bligh" <mbligh@aracnet.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	lse-tech <lse-tech@lists.sourceforge.net>
Subject: Re: [Lse-tech] Re: 2.5.69-mjb1
Date: Mon, 12 May 2003 18:23:46 -0700	[thread overview]
Message-ID: <20030513012346.GQ19053@holomorphy.com> (raw)
In-Reply-To: <3EBFB82B.8040509@us.ibm.com>

On Mon, May 12, 2003 at 08:05:15AM -0700, Dave Hansen wrote:
> Wow, that's intuitive :)
> They're trying to access the variables that have been pushed onto the
> top of the stack.  The thread_info field points to the bottom of the
> kernel's stack (no matter how big it is).  I don't know where the -5 and
> -2 come from.  It needs a big, fat stinking comment.

I'm not 100% convinced it DTRT on modern kernels. I vaguely wonder if
the following would be more appropriate. Shame the typedef isn't there
yet; the _struct suffix is an eyesore.


-- wli


diff -prauN linux-2.5.69/include/asm-i386/processor.h kstk-2.5.69-1/include/asm-i386/processor.h
--- linux-2.5.69/include/asm-i386/processor.h	2003-05-04 16:53:00.000000000 -0700
+++ kstk-2.5.69-1/include/asm-i386/processor.h	2003-05-12 14:02:13.000000000 -0700
@@ -96,9 +96,9 @@ extern struct cpuinfo_x86 cpu_data[];
 
 extern char ignore_fpu_irq;
 
-extern void identify_cpu(struct cpuinfo_x86 *);
-extern void print_cpu_info(struct cpuinfo_x86 *);
-extern void dodgy_tsc(void);
+void identify_cpu(struct cpuinfo_x86 *);
+void print_cpu_info(struct cpuinfo_x86 *);
+void dodgy_tsc(void);
 
 /*
  * EFLAGS bits
@@ -457,21 +457,21 @@ struct task_struct;
 struct mm_struct;
 
 /* Free all resources held by a thread. */
-extern void release_thread(struct task_struct *);
+void release_thread(struct task_struct *);
 
 /* Prepare to copy thread state - unlazy all lazy status */
-extern void prepare_to_copy(struct task_struct *tsk);
+void prepare_to_copy(struct task_struct *);
 
 /*
  * create a kernel thread without removing it from tasklists
  */
-extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
+int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
 
-extern unsigned long thread_saved_pc(struct task_struct *tsk);
+unsigned long thread_saved_pc(struct task_struct *);
 
-unsigned long get_wchan(struct task_struct *p);
-#define KSTK_EIP(tsk)	(((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1019])
-#define KSTK_ESP(tsk)	(((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1022])
+unsigned long get_wchan(struct task_struct *);
+#define KSTK_EIP(task)	((task)->thread.eip)
+#define KSTK_ESP(task)	((task)->thread.esp)
 
 struct microcode {
 	unsigned int hdrver;

  reply	other threads:[~2003-05-13  1:11 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-11  3:44 2.5.69-mjb1 Martin J. Bligh
2003-05-11 13:33 ` 2.5.69-mjb1 Zwane Mwaikambo
2003-05-11 13:12   ` 2.5.69-mjb1 Martin J. Bligh
2003-05-12 13:29 ` 2.5.69-mjb1 William Lee Irwin III
2003-05-12 12:40   ` 2.5.69-mjb1 Martin J. Bligh
2003-05-12 15:03     ` 2.5.69-mjb1 William Lee Irwin III
2003-05-12 13:07       ` 2.5.69-mjb1 Martin J. Bligh
2003-05-12 15:34         ` 2.5.69-mjb1 Dave Hansen
2003-05-12 13:43           ` 2.5.69-mjb1 Martin J. Bligh
2003-05-12 15:11       ` 2.5.69-mjb1 Dave Hansen
2003-05-12 15:05     ` 2.5.69-mjb1 Dave Hansen
2003-05-13  1:23       ` William Lee Irwin III [this message]
2003-05-13  3:41         ` [Lse-tech] 2.5.69-mjb1 Martin J. Bligh
2003-05-13  6:27           ` William Lee Irwin III
2003-05-13  6:42           ` Andi Kleen
2003-05-12 20:51 ` 2.5.69-mjb1: undefined reference to `blk_queue_empty' Adrian Bunk
2003-05-13  3:51   ` Martin J. Bligh
2003-05-13  7:18     ` Bharata B Rao
2003-05-13 13:58       ` Martin J. Bligh
2003-05-13 18:11         ` Jens Axboe
2003-05-14  8:08           ` Bharata B Rao
2003-05-14  8:32             ` Jens Axboe
2003-05-15  4:07               ` Bharata B Rao
2003-05-15  7:29                 ` Jens Axboe
2003-05-15  9:16                   ` Bharata B Rao
2003-05-15 12:52                     ` Martin J. Bligh

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=20030513012346.GQ19053@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=haveblue@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lse-tech@lists.sourceforge.net \
    --cc=mbligh@aracnet.com \
    /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