1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:37:36 +00:00

Kernel: Absorb LibBareMetal back into the kernel

This was supposed to be the foundation for some kind of pre-kernel
environment, but nobody is working on it right now, so let's move
everything back into the kernel and remove all the confusion.
This commit is contained in:
Andreas Kling 2020-05-16 12:00:04 +02:00
parent c12cfdea87
commit 21d5f4ada1
75 changed files with 140 additions and 203 deletions

View file

@ -30,7 +30,7 @@
#include <AK/Types.h>
#include <AK/kstdio.h>
#if !defined(KERNEL) && !defined(BOOTSTRAPPER)
#if !defined(KERNEL)
# include <AK/ScopedValueRollback.h>
# include <AK/StringView.h>
# include <errno.h>
@ -42,7 +42,7 @@ namespace AK {
class LogStream {
public:
LogStream()
#if !defined(KERNEL) && !defined(BOOTSTRAPPER)
#if !defined(KERNEL)
: m_errno_restorer(errno)
#endif
{
@ -52,7 +52,7 @@ public:
virtual void write(const char*, int) const = 0;
private:
#if !defined(KERNEL) && !defined(BOOTSTRAPPER)
#if !defined(KERNEL)
ScopedValueRollback<int> m_errno_restorer;
#endif
};
@ -68,7 +68,7 @@ public:
}
};
#if !defined(KERNEL) && !defined(BOOTSTRAPPER)
#if !defined(KERNEL)
class StdLogStream final : public LogStream {
public:
StdLogStream(int fd)
@ -86,7 +86,7 @@ inline StdLogStream out() { return StdLogStream(STDOUT_FILENO); }
inline StdLogStream warn() { return StdLogStream(STDERR_FILENO); }
#endif
#if !defined(BOOTSTRAPPER) && defined(KERNEL)
#ifdef KERNEL
class KernelLogStream final : public LogStream {
public:
KernelLogStream() {}
@ -121,7 +121,7 @@ const LogStream& operator<<(const LogStream&, long long);
const LogStream& operator<<(const LogStream&, unsigned long);
const LogStream& operator<<(const LogStream&, unsigned long long);
#if !defined(KERNEL) && !defined(BOOTSTRAPPER)
#if !defined(KERNEL)
const LogStream& operator<<(const LogStream&, double);
const LogStream& operator<<(const LogStream&, float);
#endif
@ -141,9 +141,9 @@ inline const LogStream& operator<<(const LogStream& stream, bool value)
DebugLogStream dbg();
#if defined(KERNEL)
#ifdef KERNEL
KernelLogStream klog();
#elif !defined(BOOTSTRAPPER)
#else
DebugLogStream klog();
#endif
@ -153,7 +153,7 @@ using AK::dbg;
using AK::klog;
using AK::LogStream;
#if !defined(KERNEL) && !defined(BOOTSTRAPPER)
#if !defined(KERNEL)
using AK::out;
using AK::warn;
#endif