source: rtems/c/src/lib/libbsp/powerpc/ep1a/console/printk_support.c @ 76c0fb00

4.115
Last change on this file since 76c0fb00 was 76c0fb00, checked in by Jennifer Averett <Jennifer.Averett@…>, on 08/23/11 at 18:06:08

2011-08-23 Jennifer Averett <Jennifer.Averett@…>

  • Makefile.am, console/config.c: Resolved printk issues.
  • console/printk_support.c: New file.
  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  This file contains the ep1a printk support routines
3 *
4 *  COPYRIGHT (c) 2011.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  $Id$
12 */
13
14#include <bsp.h>
15#include <rtems/libio.h>
16#include <stdlib.h>
17#include <assert.h>
18#include <termios.h>
19
20#include "console.h"
21#include <rtems/bspIo.h>
22
23/* const char arg to be compatible with BSP_output_char decl. */
24void
25debug_putc_onlcr(const char c)
26{
27  volatile int i;
28
29  /*
30   * Note:  Hack to get printk to work.  Depends upon bit
31   *        and silverchip to initialize the port and just
32   *        forces a character to be polled out of com1
33   *        regardless of where the console is.
34   */
35
36  volatile unsigned char *ptr = (void *)0xff800000;
37
38  if ('\n'==c){
39     *ptr = '\r';
40     __asm__ volatile("sync");
41     for (i=0;i<0x0fff;i++);
42  }
43
44  *ptr = c;
45  __asm__ volatile("sync");
46  for (i=0;i<0x0fff;i++);
47}
48
49BSP_output_char_function_type     BSP_output_char = debug_putc_onlcr;
50BSP_polling_getchar_function_type BSP_poll_char = NULL;
51
Note: See TracBrowser for help on using the repository browser.