summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-05 05:10:18 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-05 05:14:20 +0200
commitbcc00857a4604c874b4513bc2acc1c67d8d22c73 (patch)
treec6044ee2d28538848f48b0adb75f71908b811ca8 /Kernel
parentfb6dc5350df99468c73ca5ea2cbe599f95cb26fc (diff)
downloadserenity-bcc00857a4604c874b4513bc2acc1c67d8d22c73.zip
AK: Revert Eternal<T> for now since it doesn't work as intended.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Net/LoopbackAdapter.cpp7
-rw-r--r--Kernel/Net/LoopbackAdapter.h5
-rw-r--r--Kernel/Net/NetworkTask.cpp8
-rw-r--r--Kernel/StdLib.cpp10
4 files changed, 12 insertions, 18 deletions
diff --git a/Kernel/Net/LoopbackAdapter.cpp b/Kernel/Net/LoopbackAdapter.cpp
index c21944c5cc..1593f3b3cf 100644
--- a/Kernel/Net/LoopbackAdapter.cpp
+++ b/Kernel/Net/LoopbackAdapter.cpp
@@ -1,10 +1,11 @@
#include <Kernel/Net/LoopbackAdapter.h>
-#include <AK/Eternal.h>
LoopbackAdapter& LoopbackAdapter::the()
{
- static Eternal<LoopbackAdapter> the;
- return the;
+ static LoopbackAdapter* the;
+ if (!the)
+ the = new LoopbackAdapter;
+ return *the;
}
LoopbackAdapter::LoopbackAdapter()
diff --git a/Kernel/Net/LoopbackAdapter.h b/Kernel/Net/LoopbackAdapter.h
index dad949bc59..e22c146330 100644
--- a/Kernel/Net/LoopbackAdapter.h
+++ b/Kernel/Net/LoopbackAdapter.h
@@ -6,11 +6,12 @@ class LoopbackAdapter final : public NetworkAdapter {
AK_MAKE_ETERNAL
public:
static LoopbackAdapter& the();
- LoopbackAdapter();
+
+ virtual ~LoopbackAdapter() override;
virtual void send_raw(const byte*, int) override;
virtual const char* class_name() const override { return "LoopbackAdapter"; }
private:
- virtual ~LoopbackAdapter() override;
+ LoopbackAdapter();
};
diff --git a/Kernel/Net/NetworkTask.cpp b/Kernel/Net/NetworkTask.cpp
index 4251a22f4a..fbd73671af 100644
--- a/Kernel/Net/NetworkTask.cpp
+++ b/Kernel/Net/NetworkTask.cpp
@@ -12,7 +12,7 @@
#include <Kernel/Process.h>
#include <Kernel/Net/EtherType.h>
#include <Kernel/Lock.h>
-#include <AK/Eternal.h>
+
//#define ETHERNET_DEBUG
#define IPV4_DEBUG
@@ -28,8 +28,10 @@ static void handle_tcp(const EthernetFrameHeader&, int frame_size);
Lockable<HashMap<IPv4Address, MACAddress>>& arp_table()
{
- static Eternal<Lockable<HashMap<IPv4Address, MACAddress>>> the;
- return the;
+ static Lockable<HashMap<IPv4Address, MACAddress>>* the;
+ if (!the)
+ the = new Lockable<HashMap<IPv4Address, MACAddress>>;
+ return *the;
}
void NetworkTask_main()
diff --git a/Kernel/StdLib.cpp b/Kernel/StdLib.cpp
index 4f25a84455..20c07f9341 100644
--- a/Kernel/StdLib.cpp
+++ b/Kernel/StdLib.cpp
@@ -145,14 +145,4 @@ int memcmp(const void* v1, const void* v2, size_t n)
ASSERT_NOT_REACHED();
}
-void __cxa_guard_acquire(void*)
-{
- // FIXME: Lock somehow?
-}
-
-void __cxa_guard_release(void*)
-{
- // FIXME: Unlock somehow?
-}
-
}