source: rtems/cpukit/libmisc/serdbg/serdbg.h @ 45e4f321

4.104.114.84.95
Last change on this file since 45e4f321 was 9e633f5, checked in by Joel Sherrill <joel.sherrill@…>, on 06/27/02 at 21:25:14

2002-06-25 Thomas Doerfler <Thomas.Doerfler@…>

  • With the addition of serdbg, the standard polled I/O functions for gdbstub and/or printk are optionally routed to any termios-aware device driver, that supports polled mode. See libmisc/serdbg/README.
  • serdbg/Makefile.am, serdbg/README, serdbg/serdbg.c, serdbg/serdbg.h, serdbg/serdbgcnf.h, serdbg/serdbgio.c, serdbg/termios_printk.c, serdbg/termios_printk.h, serdbg/termios_printk_cnf.h, serdbg/.cvsignore: New files.
  • configure.ac, Makefile.am, wrapup/Makefile.am: Modified to reflect addition.
  • Property mode set to 100644
File size: 9.4 KB
Line 
1/*===============================================================*\
2| Project: RTEMS remote gdb over serial line                      |
3+-----------------------------------------------------------------+
4| File: serdbg.h                                                  |
5+-----------------------------------------------------------------+
6|                    Copyright (c) 2002 IMD                       |
7|      Ingenieurbuero fuer Microcomputertechnik Th. Doerfler      |
8|               <Thomas.Doerfler@imd-systems.de>                  |
9|                       all rights reserved                       |
10+-----------------------------------------------------------------+
11| this file declares intialization functions to add               |
12| a gdb remote debug stub to an RTEMS system                      |
13|                                                                 |
14+-----------------------------------------------------------------+
15|   date                      history                        ID   |
16| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
17| 04.04.02  creation                                         doe  |
18\*===============================================================*/
19/*
20 * $Id$
21 */
22#ifndef _SERDBG_H
23#define _SERDBG_H
24
25#include <rtems.h>
26#include <termios.h>
27
28typedef struct {
29  unsigned32 baudrate;      /* debug baud rate, e.g. 57600            */
30  void (*callout)(void);    /* callout pointer during polling         */
31  int  (*open_io)(const char *dev_name,unsigned32 baudrate); /* I/O open fnc */
32  const char *devname;      /* debug device, e.g. "/dev/tty01"        */
33  unsigned8 skip_init_bkpt; /* if TRUE, do not stop when initializing */
34} serdbg_conf_t;
35
36/*
37 * must be defined in init module...
38 */
39extern serdbg_conf_t serdbg_conf;
40
41
42/*=========================================================================*\
43| Function:                                                                 |
44\*-------------------------------------------------------------------------*/
45void putDebugChar
46(
47/*-------------------------------------------------------------------------*\
48| Purpose:                                                                  |
49|   send character to remote debugger                                       |
50+---------------------------------------------------------------------------+
51| Input Parameters:                                                         |
52\*-------------------------------------------------------------------------*/
53 char        c                          /* char to send                    */
54 );
55/*-------------------------------------------------------------------------*\
56| Return Value:                                                             |
57|    <none>                                                                 |
58\*=========================================================================*/
59
60/*=========================================================================*\
61| Function:                                                                 |
62\*-------------------------------------------------------------------------*/
63int getDebugChar
64(
65/*-------------------------------------------------------------------------*\
66| Purpose:                                                                  |
67|   get character from remote debugger                                      |
68+---------------------------------------------------------------------------+
69| Input Parameters:                                                         |
70\*-------------------------------------------------------------------------*/
71 void                                   /* <none>                          */
72 );
73/*-------------------------------------------------------------------------*\
74| Return Value:                                                             |
75|    <none>                                                                 |
76\*=========================================================================*/
77
78/*=========================================================================*\
79| Function:                                                                 |
80\*-------------------------------------------------------------------------*/
81void serdbg_exceptionHandler
82(
83/*-------------------------------------------------------------------------*\
84| Purpose:                                                                  |
85|   hook directly to an exception vector                                    |
86+---------------------------------------------------------------------------+
87| Input Parameters:                                                         |
88\*-------------------------------------------------------------------------*/
89 int vecnum,                            /* vector index to hook at         */
90 void *vector                           /* address of handler function     */
91 );
92/*-------------------------------------------------------------------------*\
93| Return Value:                                                             |
94|    <none>                                                                 |
95\*=========================================================================*/
96
97/*=========================================================================*\
98| Function:                                                                 |
99\*-------------------------------------------------------------------------*/
100int serdbg_init
101(
102/*-------------------------------------------------------------------------*\
103| Purpose:                                                                  |
104|   initialize remote gdb session over serial line                          |
105+---------------------------------------------------------------------------+
106| Input Parameters:                                                         |
107\*-------------------------------------------------------------------------*/
108 void
109 );
110/*-------------------------------------------------------------------------*\
111| Return Value:                                                             |
112|    rtems_status_code                                                      |
113\*=========================================================================*/
114
115/*
116 * stuff from serdbgio.c
117 */
118/*=========================================================================*\
119| Function:                                                                 |
120\*-------------------------------------------------------------------------*/
121int serdbg_open
122
123/*-------------------------------------------------------------------------*\
124| Purpose:                                                                  |
125|    try to open given serial debug port                                    |
126+---------------------------------------------------------------------------+
127| Input Parameters:                                                         |
128\*-------------------------------------------------------------------------*/
129(
130 const char *dev_name, /* name of device to open */
131 unsigned32 baudrate   /* baud rate to use       */
132 );
133/*-------------------------------------------------------------------------*\
134| Return Value:                                                             |
135|    0 on success, -1 and errno otherwise                                   |
136\*=========================================================================*/
137
138/*=========================================================================*\
139| Function:                                                                 |
140\*-------------------------------------------------------------------------*/
141void putDebugChar
142/*-------------------------------------------------------------------------*\
143| Purpose:                                                                  |
144|    send one character to serial port                                      |
145+---------------------------------------------------------------------------+
146| Input Parameters:                                                         |
147\*-------------------------------------------------------------------------*/
148(
149 char c  /* character to print */
150 );
151/*-------------------------------------------------------------------------*\
152| Return Value:                                                             |
153|    <none>                                                                 |
154\*=========================================================================*/
155
156/*=========================================================================*\
157| Function:                                                                 |
158\*-------------------------------------------------------------------------*/
159int getDebugChar
160/*-------------------------------------------------------------------------*\
161| Purpose:                                                                  |
162|    wait for one character from serial port                                |
163+---------------------------------------------------------------------------+
164| Input Parameters:                                                         |
165\*-------------------------------------------------------------------------*/
166(
167 void  /* none */
168 );
169/*-------------------------------------------------------------------------*\
170| Return Value:                                                             |
171|    received character                                                     |
172\*=========================================================================*/
173
174#endif /* _SERDBG_H */
Note: See TracBrowser for help on using the repository browser.