summaryrefslogtreecommitdiff
path: root/Kernel/StdLib.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-22 17:13:18 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-22 17:13:18 +0200
commit6693cfb26acf9d5b53d090be309956456f546239 (patch)
tree5cd3fbfa38bf14d20d0f7ed6bd5329e59d27b00c /Kernel/StdLib.cpp
parent1d02c7b6f171884c3ec971ff5e56a9d19fa29a24 (diff)
downloadserenity-6693cfb26acf9d5b53d090be309956456f546239.zip
Kernel: Don't use MMX memcpy() in the kernel.
I just discovered the hard way that clobbering FPU/MMX/SSE registers in the kernel makes things very confusing for userspace (and other kernel threads.) Let's banish all of those things from the kernel to keep things simple.
Diffstat (limited to 'Kernel/StdLib.cpp')
-rw-r--r--Kernel/StdLib.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Kernel/StdLib.cpp b/Kernel/StdLib.cpp
index 41aa2c65df..af9eacaab7 100644
--- a/Kernel/StdLib.cpp
+++ b/Kernel/StdLib.cpp
@@ -8,9 +8,10 @@ extern "C" {
void* memcpy(void* dest_ptr, const void* src_ptr, size_t n)
{
- if (n >= 1024) {
+#ifndef KERNEL
+ if (n >= 1024)
return mmx_memcpy(dest_ptr, src_ptr, n);
- }
+#endif
size_t dest = (size_t)dest_ptr;
size_t src = (size_t)src_ptr;