From cf811a4eb2358d66f403cd1397b29829e1827220 Mon Sep 17 00:00:00 2001 From: Amaan Cheval Date: Mon, 9 Jul 2018 16:42:57 +0530 Subject: x86_64/console: Add NS16550 polled console driver This addition allows us to successfully run the sample hello.exe test. Updates #2898. --- cpukit/score/cpu/x86_64/include/rtems/score/cpuimpl.h | 14 ++++++++++++++ cpukit/score/cpu/x86_64/include/rtems/score/x86_64.h | 3 +++ 2 files changed, 17 insertions(+) (limited to 'cpukit/score/cpu/x86_64') diff --git a/cpukit/score/cpu/x86_64/include/rtems/score/cpuimpl.h b/cpukit/score/cpu/x86_64/include/rtems/score/cpuimpl.h index bac092c320..67fe712a32 100644 --- a/cpukit/score/cpu/x86_64/include/rtems/score/cpuimpl.h +++ b/cpukit/score/cpu/x86_64/include/rtems/score/cpuimpl.h @@ -28,6 +28,20 @@ extern "C" { #endif +static inline uint8_t inport_byte(uint16_t port) +{ + uint8_t ret; + __asm__ volatile ( "inb %1, %0" + : "=a" (ret) + : "Nd" (port) ); + return ret; +} + +static inline void outport_byte(uint16_t port, uint8_t val) +{ + __asm__ volatile ( "outb %0, %1" : : "a" (val), "Nd" (port) ); +} + #ifdef __cplusplus } #endif diff --git a/cpukit/score/cpu/x86_64/include/rtems/score/x86_64.h b/cpukit/score/cpu/x86_64/include/rtems/score/x86_64.h index 237d95de98..853e45ab5d 100644 --- a/cpukit/score/cpu/x86_64/include/rtems/score/x86_64.h +++ b/cpukit/score/cpu/x86_64/include/rtems/score/x86_64.h @@ -34,6 +34,9 @@ extern "C" { #define CPU_NAME "x86-64" #define CPU_MODEL_NAME "XXX: x86-64 generic" +#define COM1_BASE_IO 0x3F8 +#define COM1_CLOCK_RATE (115200 * 16) + #ifdef __cplusplus } #endif -- cgit v1.2.3