Back to home page

LXR

 
 

    


Warning, /bsps/powerpc/motorola_powerpc/console/console.inl is written in an unsupported language. File is not indexed.

0001 /* inline routines for console i/o
0002  *
0003  * The purpose of this file is to provide generic inline functions,
0004  * i.e. not using hardcoded base addresses. These are provided by
0005  * the BSP header.
0006  */
0007 
0008 #include <bsp.h>
0009 #include <stdint.h>
0010 
0011 #define INL_IN_DECL(name,base) \
0012 static inline unsigned char name(int off) \
0013 { \
0014         return in_8((uint8_t*)(((unsigned long)base) + off)); \
0015 }
0016 
0017 #define INL_OUT_DECL(name,base) \
0018 static inline void name(int off, unsigned int val) \
0019 { \
0020         out_8((uint8_t*)(((unsigned long)base) + off), val); \
0021 }
0022 
0023 #ifdef BSP_UART_IOBASE_COM1
0024 INL_IN_DECL(com1_inb,   BSP_UART_IOBASE_COM1)
0025 INL_OUT_DECL(com1_outb, BSP_UART_IOBASE_COM1)
0026 #endif
0027 #ifdef BSP_UART_IOBASE_COM2
0028 INL_IN_DECL(com2_inb,   BSP_UART_IOBASE_COM2)
0029 INL_OUT_DECL(com2_outb, BSP_UART_IOBASE_COM2)
0030 #endif
0031 
0032 #if defined(BSP_CONSOLE_PORT)
0033 #if   (BSP_CONSOLE_PORT == BSP_UART_COM1) && defined(BSP_UART_IOBASE_COM1)
0034 #define INL_CONSOLE_INB         com1_inb
0035 #define INL_CONSOLE_OUTB        com1_outb
0036 #elif (BSP_CONSOLE_PORT == BSP_UART_COM2) && defined(BSP_UART_IOBASE_COM2)
0037 #define INL_CONSOLE_INB         com2_inb
0038 #define INL_CONSOLE_OUTB        com2_outb
0039 #endif
0040 #endif
0041 
0042 #ifdef BSP_KBD_IOBASE
0043 INL_IN_DECL(kbd_inb,    BSP_KBD_IOBASE)
0044 INL_OUT_DECL(kbd_outb,  BSP_KBD_IOBASE)
0045 #endif
0046 
0047 #ifdef BSP_VGA_IOBASE
0048 INL_OUT_DECL(vga_outb,  BSP_VGA_IOBASE)
0049 #endif