source: rtems/c/src/lib/libbsp/powerpc/ep1a/console/ns16550cfg.c @ 5134f172

4.115
Last change on this file since 5134f172 was 5134f172, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/11/11 at 12:44:30

2011-02-11 Ralf Corsépius <ralf.corsepius@…>

  • console/console.c, console/ns16550cfg.c, console/polled_io.c, include/bsp.h, include/tm27.h, startup/bspstart.c: Use "asm" instead of "asm" for improved c99-compliance.
  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  This include file contains all console driver definations for the nc16550
3 *
4 *  COPYRIGHT (c) 1989-2008.
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 <rtems.h>
15#include <bsp.h>
16#include "console.h"
17
18typedef struct uart_reg
19{
20  unsigned char reg;
21  unsigned char pad[7];
22} uartReg;
23
24uint8_t Read_ns16550_register(
25  uint32_t  ulCtrlPort,
26  uint8_t   ucRegNum
27)
28{
29volatile struct uart_reg *p = (volatile struct uart_reg *)ulCtrlPort;
30  uint8_t  ucData;
31  ucData = p[ucRegNum].reg;
32  __asm__ volatile("sync");
33  return ucData;
34}
35
36void  Write_ns16550_register(
37  uint32_t  ulCtrlPort,
38  uint8_t   ucRegNum,
39  uint8_t   ucData
40)
41{
42  volatile struct uart_reg *p = (volatile struct uart_reg *)ulCtrlPort;
43  volatile int i;
44  p[ucRegNum].reg = ucData;
45  __asm__ volatile("sync");
46  __asm__ volatile("isync");
47  __asm__ volatile("eieio");
48  for (i=0;i<0x08ff;i++)
49    __asm__ volatile("isync");
50}
Note: See TracBrowser for help on using the repository browser.