source: rtems/bsps/powerpc/motorola_powerpc/console/console.inl @ 03e1d837

5
Last change on this file since 03e1d837 was 03e1d837, checked in by Sebastian Huber <sebastian.huber@…>, on 04/24/18 at 05:06:36

bsps/powerpc: Move bootloader to bsps

This bootloader is only used by the motorola_powerpc BSP.

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 1.3 KB
RevLine 
[9966204]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>
[2d5c486]9#include <stdint.h>
[9966204]10
11#define INL_IN_DECL(name,base) \
12static inline unsigned char name(int off) \
13{ \
[2d5c486]14        return in_8((uint8_t*)(((unsigned long)base) + off)); \
[9966204]15}
16
17#define INL_OUT_DECL(name,base) \
18static inline void name(int off, unsigned int val) \
19{ \
[2d5c486]20        out_8((uint8_t*)(((unsigned long)base) + off), val); \
[9966204]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.