source: rtems/c/src/lib/libbsp/powerpc/ep1a/console/printk_support.c @ 7a4c4f4

4.11
Last change on this file since 7a4c4f4 was 7a4c4f4, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 13, 2014 at 3:28:44 PM

powerpc/ep1a: Fix warnings

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