b556b35e98
This - switches the INT3 handler to run on an IST stack (to cope with breakpoints set by a kernel debugger on places where the kernel's %gs base hasn't been set up, yet); the IST stack used is shared with the INT1 handler's [AK: this also allows setting a kprobe on the interrupt/exception entry points] - allows nesting of INT1/INT3 handlers so that one can, with a kernel debugger, debug (at least) the user-mode portions of the INT1/INT3 handling; the nesting isn't actively enabled here since a kernel- debugger-free kernel doesn't need it Signed-Off-By: Jan Beulich <jbeulich@novell.com> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
73 lines
1.7 KiB
C
73 lines
1.7 KiB
C
/*
|
|
* Generate definitions needed by assembly language modules.
|
|
* This code generates raw asm output which is post-processed to extract
|
|
* and format the required data.
|
|
*/
|
|
|
|
#include <linux/sched.h>
|
|
#include <linux/stddef.h>
|
|
#include <linux/errno.h>
|
|
#include <linux/hardirq.h>
|
|
#include <linux/suspend.h>
|
|
#include <asm/pda.h>
|
|
#include <asm/processor.h>
|
|
#include <asm/segment.h>
|
|
#include <asm/thread_info.h>
|
|
#include <asm/ia32.h>
|
|
|
|
#define DEFINE(sym, val) \
|
|
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
|
|
|
|
#define BLANK() asm volatile("\n->" : : )
|
|
|
|
int main(void)
|
|
{
|
|
#define ENTRY(entry) DEFINE(tsk_ ## entry, offsetof(struct task_struct, entry))
|
|
ENTRY(state);
|
|
ENTRY(flags);
|
|
ENTRY(thread);
|
|
ENTRY(pid);
|
|
BLANK();
|
|
#undef ENTRY
|
|
#define ENTRY(entry) DEFINE(threadinfo_ ## entry, offsetof(struct thread_info, entry))
|
|
ENTRY(flags);
|
|
ENTRY(addr_limit);
|
|
ENTRY(preempt_count);
|
|
BLANK();
|
|
#undef ENTRY
|
|
#define ENTRY(entry) DEFINE(pda_ ## entry, offsetof(struct x8664_pda, entry))
|
|
ENTRY(kernelstack);
|
|
ENTRY(oldrsp);
|
|
ENTRY(pcurrent);
|
|
ENTRY(irqcount);
|
|
ENTRY(cpunumber);
|
|
ENTRY(irqstackptr);
|
|
BLANK();
|
|
#undef ENTRY
|
|
#ifdef CONFIG_IA32_EMULATION
|
|
#define ENTRY(entry) DEFINE(IA32_SIGCONTEXT_ ## entry, offsetof(struct sigcontext_ia32, entry))
|
|
ENTRY(eax);
|
|
ENTRY(ebx);
|
|
ENTRY(ecx);
|
|
ENTRY(edx);
|
|
ENTRY(esi);
|
|
ENTRY(edi);
|
|
ENTRY(ebp);
|
|
ENTRY(esp);
|
|
ENTRY(eip);
|
|
BLANK();
|
|
#undef ENTRY
|
|
DEFINE(IA32_RT_SIGFRAME_sigcontext,
|
|
offsetof (struct rt_sigframe32, uc.uc_mcontext));
|
|
BLANK();
|
|
#endif
|
|
DEFINE(pbe_address, offsetof(struct pbe, address));
|
|
DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
|
|
DEFINE(pbe_next, offsetof(struct pbe, next));
|
|
BLANK();
|
|
#if DEBUG_STKSZ > EXCEPTION_STKSZ
|
|
DEFINE(DEBUG_IST, DEBUG_STACK);
|
|
#endif
|
|
return 0;
|
|
}
|