~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/ppc/syslib/gen550_kgdb.c

Version: ~ [ linux-5.10-rc1 ] ~ [ linux-5.9.1 ] ~ [ linux-5.8.16 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.72 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.152 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.202 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.240 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.240 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * arch/ppc/syslib/gen550_kgdb.c
  3  *
  4  * Generic 16550 kgdb support intended to be useful on a variety
  5  * of platforms.  To enable this support, it is necessary to set
  6  * the CONFIG_GEN550 option.  Any virtual mapping of the serial
  7  * port(s) to be used can be accomplished by setting
  8  * ppc_md.early_serial_map to a platform-specific mapping function.
  9  *
 10  * Adapted from ppc4xx_kgdb.c.
 11  *
 12  * Author: Matt Porter <mporter@mvista.com>
 13  *
 14  * 2002-2003 (c) MontaVista Software, Inc.  This file is licensed under
 15  * the terms of the GNU General Public License version 2.  This program
 16  * is licensed "as is" without any warranty of any kind, whether express
 17  * or implied.
 18  */
 19 
 20 #include <linux/config.h>
 21 #include <linux/types.h>
 22 #include <linux/kernel.h>
 23 
 24 #include <asm/machdep.h>
 25 
 26 extern unsigned long serial_init(int, void *);
 27 extern unsigned long serial_getc(unsigned long);
 28 extern unsigned long serial_putc(unsigned long, unsigned char);
 29 
 30 #if defined(CONFIG_KGDB_TTYS0)
 31 #define KGDB_PORT 0
 32 #elif defined(CONFIG_KGDB_TTYS1)
 33 #define KGDB_PORT 1
 34 #elif defined(CONFIG_KGDB_TTYS2)
 35 #define KGDB_PORT 2
 36 #elif defined(CONFIG_KGDB_TTYS3)
 37 #define KGDB_PORT 3
 38 #else
 39 #error "invalid kgdb_tty port"
 40 #endif
 41 
 42 static volatile unsigned int kgdb_debugport;
 43 
 44 void putDebugChar(unsigned char c)
 45 {
 46         if (kgdb_debugport == 0)
 47                 kgdb_debugport = serial_init(KGDB_PORT, NULL);
 48 
 49         serial_putc(kgdb_debugport, c);
 50 }
 51 
 52 int getDebugChar(void)
 53 {
 54         if (kgdb_debugport == 0)
 55                 kgdb_debugport = serial_init(KGDB_PORT, NULL);
 56 
 57         return(serial_getc(kgdb_debugport));
 58 }
 59 
 60 void kgdb_interruptible(int enable)
 61 {
 62         return;
 63 }
 64 
 65 void putDebugString(char* str)
 66 {
 67         while (*str != '\0') {
 68                 putDebugChar(*str);
 69                 str++;
 70         }
 71         putDebugChar('\r');
 72         return;
 73 }
 74 
 75 /*
 76  * Note: gen550_init() must be called already on the port we are going
 77  * to use.
 78  */
 79 void
 80 kgdb_map_scc(void)
 81 {
 82         printk(KERN_DEBUG "kgdb init\n");
 83         kgdb_debugport = serial_init(KGDB_PORT, NULL);
 84 }
 85 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp