source: rtems/c/src/lib/libbsp/powerpc/ppcn_60x/console/debugio.c @ 3492f29

4.104.114.84.95
Last change on this file since 3492f29 was 3492f29, checked in by Joel Sherrill <joel.sherrill@…>, on 02/18/99 at 16:47:06

./clock/Makefile.in,v
./clock/clock.c,v
./console/Makefile.in,v
./console/config.c,v
./console/console.c,v
./console/console.h,v
./console/debugio.c,v
./console/i8042.c,v
./console/i8042_p.h,v
./console/i8042vga.c,v./console/i8042vga.h,v
./console/ns16550.c,v
./console/ns16550.h,v
./console/ns16550_p.h,v
./console/ns16550cfg.c,v
./console/ns16550cfg.h,v
./console/vga.c,v
./console/vga_p.h,v
./console/z85c30.c,v
./console/z85c30.h,v
./console/z85c30_p.h,v
./console/z85c30cfg.c,v
./console/z85c30cfg.h,v
./include/Makefile.in,v
./include/bsp.h,v
./include/chain.h,v
./include/coverhd.h,v
./include/extisrdrv.h,v
./include/nvram.h,v
./include/pci.h,v
./include/tod.h,v
./network/Makefile.in,v
./network/amd79c970.c,v
./network/amd79c970.h,v
./nvram/Makefile.in,v
./nvram/ds1385.h,v
./nvram/mk48t18.h,v
./nvram/nvram.c,v
./nvram/prepnvr.h,v
./nvram/stk11c68.h,v
./pci/Makefile.in,v
./pci/pci.c,v
./start/Makefile.in,v
./start/start.s,v
./startup/Makefile.in,v
./startup/bspclean.c,v
./startup/bspstart.c,v
./startup/bsptrap.s,v
./startup/device-tree,v
./startup/genpvec.c,v
./startup/linkcmds,v
./startup/rtems-ctor.cc,v
./startup/sbrk.c,v
./startup/setvec.c,v
./startup/spurious.c,v
./startup/swap.c,v
./timer/Makefile.in,v
./timer/timer.c,v
./tod/Makefile.in,v
./tod/cmos.h,v
./tod/tod.c,v
./universe/Makefile.in,v
./universe/universe.c,v
./vectors/Makefile.in,v
./vectors/README,v
./vectors/align_h.s,v
./vectors/vectors.s,v
./wrapup/Makefile.in,v
./Makefile.in,v
./README,v
./STATUS,v
./bsp_specs,v

  • Property mode set to 100644
File size: 2.7 KB
Line 
1/*
2 *  This file contains the debug IO support.
3 *
4 *  COPYRIGHT (c) 1998 by Radstone Technology
5 *
6 *
7 * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
8 * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
9 * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
10 * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
11 *
12 * You are hereby granted permission to use, copy, modify, and distribute
13 * this file, provided that this notice, plus the above copyright notice
14 * and disclaimer, appears in all copies. Radstone Technology will provide
15 * no support for this code.
16 *
17 *  COPYRIGHT (c) 1989-1997.
18 *  On-Line Applications Research Corporation (OAR).
19 *  Copyright assigned to U.S. Government, 1994.
20 *
21 *  The license and distribution terms for this file may be
22 *  found in the file LICENSE in this distribution or at
23 *  http://www.OARcorp.com/rtems/license.html.
24 *
25 *  $Id$
26 */
27
28#include <bsp.h>
29#include <rtems/libio.h>
30#include <stdlib.h>
31#include <assert.h>
32#include <termios.h>
33
34#include <libchip/serial.h>
35
36/*
37 * Load configuration table
38 */
39
40extern console_data  Console_Port_Data[];
41extern rtems_device_minor_number  Console_Port_Minor;
42 
43/* PAGE
44 *
45 *  DEBUG_puts
46 *
47 *  This should be safe in the event of an error.  It attempts to ensure
48 *  that no TX empty interrupts occur while it is doing polled IO.  Then
49 *  it restores the state of that external interrupt.
50 *
51 *  Input parameters:
52 *    string  - pointer to debug output string
53 *
54 *  Output parameters:  NONE
55 *
56 *  Return values:      NONE
57 */
58
59void DEBUG_puts(
60  char *string
61)
62{
63  char *s;
64  unsigned32  Irql;
65
66  rtems_interrupt_disable(Irql);
67
68  for ( s = string ; *s ; s++ ) {
69    Console_Port_Tbl[Console_Port_Minor].pDeviceFns->
70      deviceWritePolled(Console_Port_Minor, *s);
71  }
72
73  rtems_interrupt_enable(Irql);
74}
75
76/* PAGE
77 *
78 *  DEBUG_puth
79 *
80 *  This should be safe in the event of an error.  It attempts to ensure
81 *  that no TX empty interrupts occur while it is doing polled IO.  Then
82 *  it restores the state of that external interrupt.
83 *
84 *  Input parameters:
85 *    ulHexNum - value to display
86 *
87 *  Output parameters:  NONE
88 *
89 *  Return values:      NONE
90 */
91
92void DEBUG_puth(
93  unsigned32 ulHexNum
94)
95{
96  unsigned long  i,d;
97  unsigned32      Irql;
98  void          (*poll)(int minor, char cChar);
99 
100  poll = Console_Port_Tbl[Console_Port_Minor].pDeviceFns->deviceWritePolled;
101
102  rtems_interrupt_disable(Irql);
103
104    (*poll)(Console_Port_Minor, '0');
105    (*poll)(Console_Port_Minor, 'x');
106
107    for ( i=32 ; i ; ) {
108      i -= 4;
109      d  = (ulHexNum>>i)&0xf;
110      (*poll)(Console_Port_Minor, (d<=9) ? d+'0' : d+'a'-0xa);
111    }
112  rtems_interrupt_enable(Irql);
113}
114
Note: See TracBrowser for help on using the repository browser.