Skip to content

Commit 23f335b

Browse files
committed
Revert "Kernel: Fix kmalloc memory corruption"
This reverts commit b306f24.
1 parent e374eb3 commit 23f335b

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Kernel/Heap/kmalloc.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
#include <Kernel/Scheduler.h>
4141
#include <Kernel/SpinLock.h>
4242
#include <Kernel/StdLib.h>
43-
#include <Kernel/VM/MemoryManager.h>
4443

4544
#define SANITIZE_KMALLOC
4645

@@ -49,15 +48,12 @@ struct AllocationHeader {
4948
u8 data[0];
5049
};
5150

51+
#define BASE_PHYSICAL (0xc0000000 + (4 * MiB))
5252
#define CHUNK_SIZE 32
5353
#define POOL_SIZE (3 * MiB)
54-
#define ETERNAL_RANGE_SIZE (2 * MiB)
5554

56-
// We need to make sure to not stomp on global variables or other parts
57-
// of the kernel image!
58-
extern u32 end_of_kernel_bss;
59-
#define ETERNAL_BASE_PHYSICAL ((u8*)PAGE_ROUND_UP(&end_of_kernel_bss))
60-
#define BASE_PHYSICAL (ETERNAL_BASE_PHYSICAL + ETERNAL_RANGE_SIZE)
55+
#define ETERNAL_BASE_PHYSICAL (0xc0000000 + (2 * MiB))
56+
#define ETERNAL_RANGE_SIZE (2 * MiB)
6157

6258
static u8 alloc_map[POOL_SIZE / CHUNK_SIZE / 8];
6359

0 commit comments

Comments
 (0)