source: rtems/bsps/powerpc/motorola_powerpc/dev/console.inl @ b46f943c

5
Last change on this file since b46f943c was b46f943c, checked in by Sebastian Huber <sebastian.huber@…>, on 04/07/18 at 17:38:55

bsp/motorola_powerpc: Move polled_io.c

This file was used by this BSP only. Avoid RTEMS_RELLDFLAGS.

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/* inline routines for console i/o
2 *
3 * The purpose of this file is to provide generic inline functions,
4 * i.e. not using hardcoded base addresses. These are provided by
5 * the BSP header.
6 */
7
8#include <bsp.h>
9#include <stdint.h>
10
11#define INL_IN_DECL(name,base) \
12static inline unsigned char name(int off) \
13{ \
14        return in_8((uint8_t*)(((unsigned long)base) + off)); \
15}
16
17#define INL_OUT_DECL(name,base) \
18static inline void name(int off, unsigned int val) \
19{ \
20        out_8((uint8_t*)(((unsigned long)base) + off), val); \
21}
22
23#ifdef BSP_UART_IOBASE_COM1
24INL_IN_DECL(com1_inb,   BSP_UART_IOBASE_COM1)
25INL_OUT_DECL(com1_outb, BSP_UART_IOBASE_COM1)
26#endif
27#ifdef BSP_UART_IOBASE_COM2
28INL_IN_DECL(com2_inb,   BSP_UART_IOBASE_COM2)
29INL_OUT_DECL(com2_outb, BSP_UART_IOBASE_COM2)
30#endif
31
32#if defined(BSP_CONSOLE_PORT)
33#if   (BSP_CONSOLE_PORT == BSP_UART_COM1) && defined(BSP_UART_IOBASE_COM1)
34#define INL_CONSOLE_INB         com1_inb
35#define INL_CONSOLE_OUTB        com1_outb
36#elif (BSP_CONSOLE_PORT == BSP_UART_COM2) && defined(BSP_UART_IOBASE_COM2)
37#define INL_CONSOLE_INB         com2_inb
38#define INL_CONSOLE_OUTB        com2_outb
39#endif
40#endif
41
42#ifdef BSP_KBD_IOBASE
43INL_IN_DECL(kbd_inb,    BSP_KBD_IOBASE)
44INL_OUT_DECL(kbd_outb,  BSP_KBD_IOBASE)
45#endif
46
47#ifdef BSP_VGA_IOBASE
48INL_OUT_DECL(vga_outb,  BSP_VGA_IOBASE)
49#endif
Note: See TracBrowser for help on using the repository browser.