diff --git a/repos/os/run/kdb_uart_drv.run b/repos/os/run/kdb_uart_drv.run deleted file mode 100644 index 3c9d6483d6..0000000000 --- a/repos/os/run/kdb_uart_drv.run +++ /dev/null @@ -1,85 +0,0 @@ -# -# \brief Test for the KDB UART driver -# \author Christian Prochaska -# \date 2013-01-21 -# - -if {![have_spec fiasco]} { - puts "Run script only supports Fiasco."; exit 0 } - -# -# Build -# - -build { - core init timer - drivers/uart - test/terminal_echo -} - -create_boot_directory - -# -# Generate config -# - -set config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config - -# -# Boot modules -# - -# generic modules -set boot_modules { - core ld.lib.so init timer - kdb_uart_drv - test-terminal_echo -} - -set fiasco_serial_esc_arg "" - -build_boot_image $boot_modules - -# -# Execute test -# - -# qemu config -append qemu_args " -nographic " - -run_genode_until forever diff --git a/repos/os/src/drivers/uart/kdb/spec/fiasco/target.mk b/repos/os/src/drivers/uart/kdb/spec/fiasco/target.mk deleted file mode 100644 index 4ae77d97fb..0000000000 --- a/repos/os/src/drivers/uart/kdb/spec/fiasco/target.mk +++ /dev/null @@ -1,5 +0,0 @@ -REQUIRES = fiasco - -LIBS += syscall-fiasco - -include $(REP_DIR)/src/drivers/uart/kdb/target.inc diff --git a/repos/os/src/drivers/uart/kdb/target.inc b/repos/os/src/drivers/uart/kdb/target.inc deleted file mode 100644 index 48a02bf439..0000000000 --- a/repos/os/src/drivers/uart/kdb/target.inc +++ /dev/null @@ -1,8 +0,0 @@ -TARGET = kdb_uart_drv -SRC_CC = main.cc -LIBS += base -INC_DIR += $(REP_DIR)/src/drivers/uart $(REP_DIR)/src/drivers/uart/kdb - -vpath main.cc $(REP_DIR)/src/drivers/uart - -CC_CXX_WARN_STRICT_CONVERSION = diff --git a/repos/os/src/drivers/uart/kdb/uart_driver.h b/repos/os/src/drivers/uart/kdb/uart_driver.h deleted file mode 100644 index f51a22ad21..0000000000 --- a/repos/os/src/drivers/uart/kdb/uart_driver.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * \brief Fiasco(.OC) KDB UART driver - * \author Christian Prochaska - * \date 2013-03-07 - */ - -/* - * Copyright (C) 2013-2017 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU Affero General Public License version 3. - */ - -#ifndef _KDB_UART_H_ -#define _KDB_UART_H_ - -/* Fiasco.OC includes */ -namespace Fiasco { -#include -} - -/* Genode includes */ -#include -#include - -using namespace Genode; - -namespace Uart { - class Driver; - struct Driver_factory; - struct Char_avail_functor; -}; - - -/** - * Functor, called by 'Driver' when data is ready for reading - */ -struct Uart::Char_avail_functor -{ - Genode::Signal_context_capability sigh; - - void operator ()() { - if (sigh.valid()) Genode::Signal_transmitter(sigh).submit(); - else Genode::error("no sigh"); } - -}; - - - -class Uart::Driver -{ - private: - - signed char _buffered_char; - Char_avail_functor &_char_avail; - Timer::Connection _timer; - Signal_handler _timer_handler; - - void _timeout() { if (char_avail()) _char_avail(); } - - public: - - Driver(Genode::Env &env, unsigned, unsigned, - Uart::Char_avail_functor &func) - : _buffered_char(-1), - _char_avail(func), - _timer(env), - _timer_handler(env.ep(), *this, &Driver::_timeout) - { - _timer.sigh(_timer_handler); - _timer.trigger_periodic(20*1000); - } - - - /*************************** - ** UART driver interface ** - ***************************/ - - void put_char(char c) { Fiasco::outchar(c); } - - bool char_avail() - { - if (_buffered_char == -1) - _buffered_char = Fiasco::l4kd_inchar(); - - return (_buffered_char != -1); - } - - char get_char() - { - char result; - - if (_buffered_char != -1) { - result = _buffered_char; - _buffered_char = -1; - } else - result = 0; - - return result; - } - - void baud_rate(int) { } -}; - - -/** - * Factory used by 'Uart::Root' at session creation/destruction time - */ -struct Uart::Driver_factory -{ - struct Not_available {}; - - enum { UARTS_NUM = 1 }; - - Genode::Env &env; - Genode::Heap &heap; - Driver *drivers[UARTS_NUM] { nullptr }; - - Driver_factory(Genode::Env &env, Genode::Heap &heap) - : env(env), heap(heap) {} - - - Uart::Driver &create(unsigned index, unsigned baudrate, - Uart::Char_avail_functor &callback); - - void destroy(Uart::Driver *) { /* TODO */ } - -}; - -#endif /* _KDB_UART_H_ */