From 2030ae678ef9166c7d12ff7222005caca4e35092 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Thu, 16 Jun 2016 15:55:36 +0200 Subject: [PATCH] Supplement base/log.h with raw output function This patch introduces the Genode::raw function that prints output directly via a low-level kernel mechanism, if available. On base-linux, it replaces the former 'raw_write_str' function. On base-hw, it replaces the former kernel/log.h interface. Fixes #2012 --- .../include/base/internal/raw_write_string.h | 31 +++++ .../include/base/internal/raw_write_string.h | 31 +++++ repos/base-hw/include/kernel/log.h | 117 ------------------ repos/base-hw/src/core/include/platform.h | 1 - .../src/core/include/platform_thread.h | 2 +- .../src/core/io_mem_session_support.cc | 3 - repos/base-hw/src/core/platform.cc | 6 +- .../include/base/internal/raw_write_string.h | 28 +++++ repos/base-hw/src/lib/base/ipc.cc | 1 - .../include/base/internal/raw_write_string.h | 28 +++++ repos/base-linux/src/lib/base/debug.cc | 29 ----- repos/base-linux/src/lib/base/thread_env.cc | 4 +- .../base-linux/src/lib/lx_hybrid/lx_hybrid.cc | 5 +- .../src/lib/syscall/linux_syscalls.h | 4 +- .../include/base/internal/raw_write_string.h | 19 +++ .../include/base/internal/raw_write_string.h | 30 +++++ .../include/base/internal/raw_write_string.h | 29 +++++ .../include/base/internal/raw_write_string.h | 30 +++++ repos/base/include/base/log.h | 55 +++++--- repos/base/include/base/output.h | 13 ++ repos/base/lib/mk/base-common.inc | 1 + repos/base/src/lib/base/log.cc | 17 +++ repos/base/src/lib/base/raw_output.cc | 35 ++++++ repos/base/src/lib/ldso/symbol.map | 1 - repos/libports/src/lib/libc/issetugid.cc | 5 +- repos/libports/src/lib/libc/libc_debug.h | 35 ------ repos/libports/src/lib/libc/rlimit.cc | 8 +- 27 files changed, 351 insertions(+), 217 deletions(-) create mode 100644 repos/base-fiasco/src/include/base/internal/raw_write_string.h create mode 100644 repos/base-foc/src/include/base/internal/raw_write_string.h delete mode 100644 repos/base-hw/include/kernel/log.h create mode 100644 repos/base-hw/src/include/base/internal/raw_write_string.h create mode 100644 repos/base-linux/src/include/base/internal/raw_write_string.h create mode 100644 repos/base-nova/src/include/base/internal/raw_write_string.h create mode 100644 repos/base-okl4/src/include/base/internal/raw_write_string.h create mode 100644 repos/base-pistachio/src/include/base/internal/raw_write_string.h create mode 100644 repos/base-sel4/src/include/base/internal/raw_write_string.h create mode 100644 repos/base/src/lib/base/raw_output.cc delete mode 100644 repos/libports/src/lib/libc/libc_debug.h diff --git a/repos/base-fiasco/src/include/base/internal/raw_write_string.h b/repos/base-fiasco/src/include/base/internal/raw_write_string.h new file mode 100644 index 000000000..19b2f64d1 --- /dev/null +++ b/repos/base-fiasco/src/include/base/internal/raw_write_string.h @@ -0,0 +1,31 @@ +/* + * \brief Kernel-specific raw-output back end + * \author Norman Feske + * \date 2016-03-08 + */ + +/* + * Copyright (C) 2016 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU General Public License version 2. + */ + +#ifndef _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ +#define _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ + +/* Fiasco includes */ +namespace Fiasco { +#include +} + +namespace Genode { + + void raw_write_string(char const *str) + { + using namespace Fiasco; + outstring(const_cast(str)); + } +} + +#endif /* _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ */ diff --git a/repos/base-foc/src/include/base/internal/raw_write_string.h b/repos/base-foc/src/include/base/internal/raw_write_string.h new file mode 100644 index 000000000..19b2f64d1 --- /dev/null +++ b/repos/base-foc/src/include/base/internal/raw_write_string.h @@ -0,0 +1,31 @@ +/* + * \brief Kernel-specific raw-output back end + * \author Norman Feske + * \date 2016-03-08 + */ + +/* + * Copyright (C) 2016 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU General Public License version 2. + */ + +#ifndef _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ +#define _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ + +/* Fiasco includes */ +namespace Fiasco { +#include +} + +namespace Genode { + + void raw_write_string(char const *str) + { + using namespace Fiasco; + outstring(const_cast(str)); + } +} + +#endif /* _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ */ diff --git a/repos/base-hw/include/kernel/log.h b/repos/base-hw/include/kernel/log.h deleted file mode 100644 index dc383845a..000000000 --- a/repos/base-hw/include/kernel/log.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * \brief Print to the standard output of the kernel - * \author Martin stein - * \date 2012-04-05 - */ - -/* - * Copyright (C) 2012-2013 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU General Public License version 2. - */ - -#ifndef _INCLUDE__KERNEL__LOG_H_ -#define _INCLUDE__KERNEL__LOG_H_ - -/* Genode includes */ -#include - -namespace Kernel -{ - /** - * Prints incoming streams to the standard output of the kernel - */ - class Log - { - private: - - /** - * Print an unsigned 4 bit integer x as hexadecimal value - */ - void _print_4bit_hex(unsigned char x) const - { - /* decode to ASCII char */ - x &= 0x0f; - if (x > 9) x += 39; - x += 48; - - /* print ASCII char */ - print_char(x); - } - - public: - - /** - * Print a zero-terminated string s - */ - Log & operator << (char const * s) - { - while (*s) print_char(*s++); - if (*--s != '\n') { print_char(' '); } - return *this; - } - - /** - * Print an unsigned integer x as hexadecimal value - */ - Log & operator << (unsigned long const x) - { - enum { - BYTE_WIDTH = 8, - CW = sizeof(unsigned char)*BYTE_WIDTH, - IW = sizeof(unsigned int)*BYTE_WIDTH - }; - - /* - * Walk from most significant to least significant bit and - * process 2 hex digits per step. - */ - bool leading = true; - for (int i = IW - CW; i >= 0; i = i - CW) - { - /* fetch the 2 current digits */ - unsigned char c = (char)((x >> i) & 0xff); - - /* has the payload part of the value already begun? */ - if (leading) - { - /* ignore leading zeros ... */ - if (!c) - { - /* ... expect they are the only digits */ - if (i == 0) _print_4bit_hex(c); - continue; - } - /* transit from leading to payload part */ - leading = false; - if (c < 0x10) { - _print_4bit_hex(c); - continue; - } - } - /* print both digits */ - _print_4bit_hex(c >> 4); - _print_4bit_hex(c); - } - print_char(' '); - return *this; - } - - /** - * Print a pointer p as hexadecimal value - */ - Log & operator << (void * const p) { return *this << (unsigned long)p; } - }; - - /** - * Return singleton kernel-log - */ - inline Log & log() - { - static Log s; - return s; - } -} - -#endif /* _INCLUDE__KERNEL__LOG_H_ */ diff --git a/repos/base-hw/src/core/include/platform.h b/repos/base-hw/src/core/include/platform.h index 8225306b8..09b14c18b 100644 --- a/repos/base-hw/src/core/include/platform.h +++ b/repos/base-hw/src/core/include/platform.h @@ -21,7 +21,6 @@ #include /* base-hw includes */ -#include #include #include diff --git a/repos/base-hw/src/core/include/platform_thread.h b/repos/base-hw/src/core/include/platform_thread.h index 68dc4a826..8e891bf39 100644 --- a/repos/base-hw/src/core/include/platform_thread.h +++ b/repos/base-hw/src/core/include/platform_thread.h @@ -27,9 +27,9 @@ #include #include +/* kernel includes */ #include #include -#include namespace Genode { diff --git a/repos/base-hw/src/core/io_mem_session_support.cc b/repos/base-hw/src/core/io_mem_session_support.cc index d69a00c2e..b2c25ee1e 100644 --- a/repos/base-hw/src/core/io_mem_session_support.cc +++ b/repos/base-hw/src/core/io_mem_session_support.cc @@ -12,9 +12,6 @@ * under the terms of the GNU General Public License version 2. */ -/* Genode includes */ -#include - /* core includes */ #include diff --git a/repos/base-hw/src/core/platform.cc b/repos/base-hw/src/core/platform.cc index b1567f6c9..aae397164 100644 --- a/repos/base-hw/src/core/platform.cc +++ b/repos/base-hw/src/core/platform.cc @@ -15,7 +15,7 @@ /* Genode includes */ #include #include -#include +#include /* core includes */ #include @@ -200,8 +200,8 @@ Platform::Platform() void Core_parent::exit(int exit_value) { - Kernel::log() << __PRETTY_FUNCTION__ << "not implemented\n"; - while (1) ; + log(__PRETTY_FUNCTION__, "not implemented"); + while (1); } diff --git a/repos/base-hw/src/include/base/internal/raw_write_string.h b/repos/base-hw/src/include/base/internal/raw_write_string.h new file mode 100644 index 000000000..eb95bc999 --- /dev/null +++ b/repos/base-hw/src/include/base/internal/raw_write_string.h @@ -0,0 +1,28 @@ +/* + * \brief Kernel-specific raw-output back end + * \author Norman Feske + * \date 2016-03-08 + */ + +/* + * Copyright (C) 2016 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU General Public License version 2. + */ + +#ifndef _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ +#define _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ + +#include + +namespace Genode { + + void raw_write_string(char const *str) + { + while (char c = *str++) + Kernel::print_char(c); + } +} + +#endif /* _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ */ diff --git a/repos/base-hw/src/lib/base/ipc.cc b/repos/base-hw/src/lib/base/ipc.cc index 59b123956..84141532f 100644 --- a/repos/base-hw/src/lib/base/ipc.cc +++ b/repos/base-hw/src/lib/base/ipc.cc @@ -28,7 +28,6 @@ /* base-hw includes */ #include -#include namespace Hw { extern Genode::Untyped_capability _main_thread_cap; } diff --git a/repos/base-linux/src/include/base/internal/raw_write_string.h b/repos/base-linux/src/include/base/internal/raw_write_string.h new file mode 100644 index 000000000..6a95cfde9 --- /dev/null +++ b/repos/base-linux/src/include/base/internal/raw_write_string.h @@ -0,0 +1,28 @@ +/* + * \brief Kernel-specific raw-output back end + * \author Norman Feske + * \date 2016-03-08 + */ + +/* + * Copyright (C) 2016 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU General Public License version 2. + */ + +#ifndef _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ +#define _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ + +#include +#include + +namespace Genode { + + void raw_write_string(const char *str) + { + lx_syscall(SYS_write, (int)1, str, strlen(str)); + } +} + +#endif /* _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ */ diff --git a/repos/base-linux/src/lib/base/debug.cc b/repos/base-linux/src/lib/base/debug.cc index 8ee21165b..237e6ff7f 100644 --- a/repos/base-linux/src/lib/base/debug.cc +++ b/repos/base-linux/src/lib/base/debug.cc @@ -11,34 +11,7 @@ * under the terms of the GNU General Public License version 2. */ -/* - * With the enabled 'DEBUG' flag, status information can be printed directly - * via a Linux system call by using the 'raw_write_str' function. This output - * bypasses the Genode 'LOG' mechanism, which is useful for debugging low-level - * code such as a libC back-end. - */ -#define DEBUG 1 - - -#if DEBUG #include -#endif /* DEBUG */ - - -/** - * Write function targeting directly the Linux system call layer and bypassing - * any Genode code. - */ -extern "C" int raw_write_str(const char *str) -{ -#if DEBUG - unsigned len = 0; - for (; str[len] != 0; len++); - lx_syscall(SYS_write, (int)1, str, len); - return len; -#endif /* DEBUG */ -} - /** * Debug function waiting until the user presses return @@ -50,8 +23,6 @@ extern "C" int raw_write_str(const char *str) */ extern "C" void wait_for_continue(void) { -#if DEBUG char buf[16]; lx_syscall(SYS_read, (int)0, buf, sizeof(buf)); -#endif /* DEBUG */ } diff --git a/repos/base-linux/src/lib/base/thread_env.cc b/repos/base-linux/src/lib/base/thread_env.cc index e4ab81641..44cee672c 100644 --- a/repos/base-linux/src/lib/base/thread_env.cc +++ b/repos/base-linux/src/lib/base/thread_env.cc @@ -14,6 +14,7 @@ /* Genode includes */ #include #include +#include #include @@ -41,7 +42,8 @@ extern "C" int stdout_write(char const *); */ extern "C" __attribute__((weak)) int stdout_write(char const *s) { - return raw_write_str(s); + raw(s); + return strlen(s); } /** diff --git a/repos/base-linux/src/lib/lx_hybrid/lx_hybrid.cc b/repos/base-linux/src/lib/lx_hybrid/lx_hybrid.cc index b3082b070..a3ddd54a1 100644 --- a/repos/base-linux/src/lib/lx_hybrid/lx_hybrid.cc +++ b/repos/base-linux/src/lib/lx_hybrid/lx_hybrid.cc @@ -13,6 +13,7 @@ /* Genode includes */ #include +#include #include #include #include @@ -22,8 +23,6 @@ #include -extern "C" int raw_write_str(const char *str); - /** * Define stack area */ @@ -39,7 +38,7 @@ enum { verbose_atexit = false }; int genode___cxa_atexit(void (*func)(void*), void *arg, void *dso) { if (verbose_atexit) - raw_write_str("genode___cxa_atexit called, not implemented\n"); + Genode::raw("genode___cxa_atexit called, not implemented\n"); return 0; } diff --git a/repos/base-linux/src/lib/syscall/linux_syscalls.h b/repos/base-linux/src/lib/syscall/linux_syscalls.h index 1e6eed991..2c0fb6d5b 100644 --- a/repos/base-linux/src/lib/syscall/linux_syscalls.h +++ b/repos/base-linux/src/lib/syscall/linux_syscalls.h @@ -43,6 +43,7 @@ #include #include #include +#include /*********************************** @@ -50,14 +51,13 @@ ***********************************/ extern "C" void wait_for_continue(void); -extern "C" int raw_write_str(const char *str); #define PRAW(fmt, ...) \ do { \ char str[128]; \ Genode::snprintf(str, sizeof(str), \ ESC_ERR fmt ESC_END "\n", ##__VA_ARGS__); \ - raw_write_str(str); \ + Genode::raw(str); \ } while (0) diff --git a/repos/base-nova/src/include/base/internal/raw_write_string.h b/repos/base-nova/src/include/base/internal/raw_write_string.h new file mode 100644 index 000000000..37fb3440d --- /dev/null +++ b/repos/base-nova/src/include/base/internal/raw_write_string.h @@ -0,0 +1,19 @@ +/* + * \brief Kernel-specific raw-output back end + * \author Norman Feske + * \date 2016-03-08 + */ + +/* + * Copyright (C) 2016 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU General Public License version 2. + */ + +#ifndef _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ +#define _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ + +namespace Genode { void raw_write_string(char const *) { } } + +#endif /* _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ */ diff --git a/repos/base-okl4/src/include/base/internal/raw_write_string.h b/repos/base-okl4/src/include/base/internal/raw_write_string.h new file mode 100644 index 000000000..aab1f3ba0 --- /dev/null +++ b/repos/base-okl4/src/include/base/internal/raw_write_string.h @@ -0,0 +1,30 @@ +/* + * \brief Kernel-specific raw-output back end + * \author Norman Feske + * \date 2016-03-08 + */ + +/* + * Copyright (C) 2016 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU General Public License version 2. + */ + +#ifndef _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ +#define _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ + +namespace Okl4 { extern "C" { +#include +} } + +namespace Genode { + + void raw_write_string(char const *str) + { + while (char c = *str++) + Okl4::L4_KDB_PrintChar(c); + } +} + +#endif /* _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ */ diff --git a/repos/base-pistachio/src/include/base/internal/raw_write_string.h b/repos/base-pistachio/src/include/base/internal/raw_write_string.h new file mode 100644 index 000000000..d20c07190 --- /dev/null +++ b/repos/base-pistachio/src/include/base/internal/raw_write_string.h @@ -0,0 +1,29 @@ +/* + * \brief Kernel-specific raw-output back end + * \author Norman Feske + * \date 2016-03-08 + */ + +/* + * Copyright (C) 2016 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU General Public License version 2. + */ + +#ifndef _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ +#define _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ + +namespace Pistachio { +#include +} + +namespace Genode { + + void raw_write_string(char const *str) + { + Pistachio::L4_KDB_PrintString(const_cast(str)); + } +} + +#endif /* _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ */ diff --git a/repos/base-sel4/src/include/base/internal/raw_write_string.h b/repos/base-sel4/src/include/base/internal/raw_write_string.h new file mode 100644 index 000000000..b5d437d74 --- /dev/null +++ b/repos/base-sel4/src/include/base/internal/raw_write_string.h @@ -0,0 +1,30 @@ +/* + * \brief Kernel-specific raw-output back end + * \author Norman Feske + * \date 2016-03-08 + */ + +/* + * Copyright (C) 2016 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU General Public License version 2. + */ + +#ifndef _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ +#define _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ + +/* seL4 includes */ +#include +#include + +namespace Genode { + + void raw_write_string(char const *str) + { + while (char c = *str++) + seL4_DebugPutChar(c); + } +} + +#endif /* _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_ */ diff --git a/repos/base/include/base/log.h b/repos/base/include/base/log.h index eb96fb3b5..82ef4a7ab 100644 --- a/repos/base/include/base/log.h +++ b/repos/base/include/base/log.h @@ -17,7 +17,11 @@ #include #include -namespace Genode { class Log; } +namespace Genode { + + class Log; + class Raw; +} /** @@ -45,19 +49,6 @@ class Genode::Log void _release(); Output &_output; - /** - * Helper for the sequential output of a variable list of arguments - */ - template - void _output_args(Output &output, HEAD && head, TAIL &&... tail) - { - print(output, head); - _output_args(output, tail...); - } - - template - void _output_args(Output &output, LAST && last) { print(output, last); } - public: Log(Output &output) : _output(output) { } @@ -72,7 +63,7 @@ class Genode::Log * using a lock guard. */ _acquire(type); - _output_args(_output, args...); + Output::out_args(_output, args...); _release(); } @@ -83,6 +74,31 @@ class Genode::Log }; +/** + * Raw-output back end + * + * \noapi + */ +class Genode::Raw +{ + private: + + static void _acquire(); + static void _release(); + static Output &_output(); + + public: + + template + static void output(ARGS &&... args) + { + _acquire(); + Output::out_args(_output(), args...); + _release(); + } +}; + + namespace Genode { /** @@ -104,6 +120,15 @@ namespace Genode { */ template void error(ARGS &&... args) { Log::log().output(Log::ERROR, args...); } + + + /** + * Write 'args' directly via the kernel (i.e., kernel debugger) + * + * This function is intended for temporarly debugging purposes only. + */ + template + void raw(ARGS &&... args) { Raw::output(args...); } } #endif /* _INCLUDE__BASE__LOG_H_ */ diff --git a/repos/base/include/base/output.h b/repos/base/include/base/output.h index ea8cd7f01..0c9f55d95 100644 --- a/repos/base/include/base/output.h +++ b/repos/base/include/base/output.h @@ -39,6 +39,19 @@ struct Genode::Output * overridden by the backend for improving efficiency. */ virtual void out_string(char const *str, size_t n = ~0UL); + + /** + * Helper for the sequential output of a variable list of arguments + */ + template + static void out_args(Output &output, HEAD && head, TAIL &&... tail) + { + print(output, head); + out_args(output, tail...); + } + + template + static void out_args(Output &output, LAST && last) { print(output, last); } }; diff --git a/repos/base/lib/mk/base-common.inc b/repos/base/lib/mk/base-common.inc index d692e0dbe..465fa6833 100644 --- a/repos/base/lib/mk/base-common.inc +++ b/repos/base/lib/mk/base-common.inc @@ -18,6 +18,7 @@ SRC_CC += elf_binary.cc SRC_CC += ipc.cc SRC_CC += lock.cc SRC_CC += log.cc +SRC_CC += raw_output.cc SRC_CC += rpc_entrypoint.cc SRC_CC += signal.cc signal_common.cc SRC_CC += sleep.cc diff --git a/repos/base/src/lib/base/log.cc b/repos/base/src/lib/base/log.cc index 6a61882a9..06565eebf 100644 --- a/repos/base/src/lib/base/log.cc +++ b/repos/base/src/lib/base/log.cc @@ -42,3 +42,20 @@ void Log::_release() _lock.unlock(); } + +void Raw::_acquire() +{ + /* + * Mark raw output with distinct color + */ + _output().out_string("\033[32mKernel: "); +} + + +void Raw::_release() +{ + /* + * Reset color and add newline + */ + _output().out_string("\033[0m\n"); +} diff --git a/repos/base/src/lib/base/raw_output.cc b/repos/base/src/lib/base/raw_output.cc new file mode 100644 index 000000000..915186dc3 --- /dev/null +++ b/repos/base/src/lib/base/raw_output.cc @@ -0,0 +1,35 @@ +/* + * \brief Access to raw output back end + * \author Norman Feske + * \date 2016-06-16 + */ + +/* + * Copyright (C) 2016 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU General Public License version 2. + */ + +/* Genode includes */ +#include + +/* base-internal includes */ +#include +#include +#include + +using namespace Genode; + + +Output &Raw::_output() +{ + struct Write_fn { void operator () (char const *s) { raw_write_string(s); } }; + + typedef Buffered_output<256, Write_fn> Buffered_raw_output; + + static Buffered_raw_output *buffered_raw_output = + unmanaged_singleton(Write_fn()); + + return *buffered_raw_output; +} diff --git a/repos/base/src/lib/ldso/symbol.map b/repos/base/src/lib/ldso/symbol.map index 40443ab3e..fdad4d2f5 100644 --- a/repos/base/src/lib/ldso/symbol.map +++ b/repos/base/src/lib/ldso/symbol.map @@ -36,7 +36,6 @@ wait_for_continue; stdout_write; stdout_reconnect; - raw_write_str; /* Testing */ extern "C++" { diff --git a/repos/libports/src/lib/libc/issetugid.cc b/repos/libports/src/lib/libc/issetugid.cc index efe689e88..8de995092 100644 --- a/repos/libports/src/lib/libc/issetugid.cc +++ b/repos/libports/src/lib/libc/issetugid.cc @@ -11,10 +11,11 @@ * under the terms of the GNU General Public License version 2. */ -#include "libc_debug.h" +/* Genode includes */ +#include extern "C" int issetugid(void) { - raw_write_str("issetugid called, not yet implemented, returning 1\n"); + Genode::raw("issetugid called, not yet implemented, returning 1"); return 1; } diff --git a/repos/libports/src/lib/libc/libc_debug.h b/repos/libports/src/lib/libc/libc_debug.h deleted file mode 100644 index f10208c80..000000000 --- a/repos/libports/src/lib/libc/libc_debug.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * \brief Debugging hooks - * \author Norman Feske - * \date 2009-05-26 - */ - -/* - * Copyright (C) 2009-2013 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU General Public License version 2. - */ - -#ifndef _LIBC_DEBUG_H_ -#define _LIBC_DEBUG_H_ - -#define LIBC_DEBUG 0 - -#if (LIBC_DEBUG == 1) - -/* - * This function is implemented in base-linux (env lib) - */ -extern "C" int raw_write_str(const char *s); - -#else - -/* - * Discard external references to 'raw_write_str' - */ -static inline int raw_write_str(const char *s) { return 0; } - -#endif /* LIBC_DEBUG == 1 */ - -#endif /* _LIBC_DEBUG_H_ */ diff --git a/repos/libports/src/lib/libc/rlimit.cc b/repos/libports/src/lib/libc/rlimit.cc index f4b8eeb31..43fa5e7af 100644 --- a/repos/libports/src/lib/libc/rlimit.cc +++ b/repos/libports/src/lib/libc/rlimit.cc @@ -11,12 +11,14 @@ * under the terms of the GNU General Public License version 2. */ +/* Genode includes */ +#include + +/* libc includes */ #include #include #include -#include "libc_debug.h" - extern "C" int __attribute__((weak)) getrlimit(int resource, struct rlimit *rlim) { /* @@ -30,7 +32,7 @@ extern "C" int __attribute__((weak)) getrlimit(int resource, struct rlimit *rlim return 0; } - raw_write_str("getrlimit called, return 0\n"); + Genode::raw("getrlimit called, return 0"); return 0; }