RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
bsps
powerpc
motorola_powerpc
console
console.inl
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) \
12
static inline unsigned char name(int off) \
13
{ \
14
return in_8((uint8_t*)(((unsigned long)base) + BSP_REG_OFF(off))); \
15
}
16
17
#define INL_OUT_DECL(name,base) \
18
static inline void name(int off, unsigned int val) \
19
{ \
20
out_8((uint8_t*)(((unsigned long)base) + BSP_REG_OFF(off)), val); \
21
}
22
23
#ifdef BSP_UART_IOBASE_COM1
24
INL_IN_DECL(com1_inb, BSP_UART_IOBASE_COM1)
25
INL_OUT_DECL(com1_outb, BSP_UART_IOBASE_COM1)
26
#endif
27
#ifdef BSP_UART_IOBASE_COM2
28
INL_IN_DECL(com2_inb, BSP_UART_IOBASE_COM2)
29
INL_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
43
INL_IN_DECL(kbd_inb, BSP_KBD_IOBASE)
44
INL_OUT_DECL(kbd_outb, BSP_KBD_IOBASE)
45
#endif
46
47
#ifdef BSP_VGA_IOBASE
48
INL_OUT_DECL(vga_outb, BSP_VGA_IOBASE)
49
#endif
Generated by
1.18.0