root/include/asm-sparc/kdebug.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. sp_enter_debugger

   1 /* kdebug.h:  Defines and definitions for debugging the Linux kernel
   2  *            under various kernel debuggers.
   3  *
   4  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
   5  */
   6 #ifndef _SPARC_KDEBUG_H
   7 #define _SPARC_KDEBUG_H
   8 
   9 #include <asm/openprom.h>
  10 
  11 /* The debugger lives in 1MB of virtual address space right underneath
  12  * the boot prom.
  13  */
  14 
  15 #define DEBUG_FIRSTVADDR       0xffc00000
  16 #define DEBUG_LASTVADDR       LINUX_OPPROM_BEGVM
  17 
  18 /* Breakpoints are enter through trap table entry 126.  So in sparc assembly
  19  * if you want to drop into the debugger you do:
  20  *
  21  * t DEBUG_BP_TRAP
  22  */
  23 
  24 #define DEBUG_BP_TRAP     126
  25 
  26 #ifndef __ASSEMBLY__
  27 /* The debug vector is passed in %o1 at boot time.  It is a pointer to
  28  * a structure in the debuggers address space.  Here is it's format.
  29  */
  30 
  31 typedef unsigned int (*debugger_funct)(void);
  32 
  33 struct kernel_debug {
  34         /* First the entry point into the debugger.  You jump here
  35          * to give control over to the debugger.
  36          */
  37         unsigned long kdebug_entry;
  38         unsigned long kdebug_trapme;   /* Figure out later... */
  39         /* The following is the number of pages that the debugger has
  40          * taken from to total pool.
  41          */
  42         unsigned long *kdebug_stolen_pages;
  43         /* Ok, after you remap yourself and/or change the trap table
  44          * from what you were left with at boot time you have to call
  45          * this synchronization function so the debugger can check out
  46          * what you have done.
  47          */
  48         debugger_funct teach_debugger;
  49 }; /* I think that is it... */
  50 
  51 extern struct kernel_debug *linux_dbvec;
  52 
  53 /* Use this macro in C-code to enter the debugger. */
  54 extern __inline__ void sp_enter_debugger(void)
     /* [previous][next][first][last][top][bottom][index][help] */
  55 {
  56         printk("Entering debugger in file %s line %d\n", __FILE__, __LINE__);
  57         __asm__ __volatile__("jmpl %0, %%o7\n\t"
  58                              "nop\n\t" : :
  59                              "r" (linux_dbvec) : "o7", "memory");
  60 }
  61 
  62 #define SP_ENTER_DEBUGGER do { \
  63              if((linux_dbvec!=0) && ((*(short *)linux_dbvec)!=-1)) \
  64                sp_enter_debugger(); \
  65                        } while(0)
  66 
  67 #endif /* !(__ASSEMBLY__) */
  68 
  69 /* Some nice offset defines for assembler code. */
  70 #define KDEBUG_ENTRY_OFF    0x0
  71 #define KDEBUG_DUNNO_OFF    0x4
  72 #define KDEBUG_DUNNO2_OFF   0x8
  73 #define KDEBUG_TEACH_OFF    0xc
  74 
  75 #endif /* !(_SPARC_KDEBUG_H) */

/* [previous][next][first][last][top][bottom][index][help] */