summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-03-09 09:13:20 +0100
committerMaria Matejka <mq@ucw.cz>2022-03-09 09:13:20 +0100
commit1c7df2c24029d6721745b99fd4137935db03e257 (patch)
treeb0b5e1ab704e1744d90c195a30ab51c74133ffc6 /lib
parent1740ff57e8ea05d7d9f15d1a6830ce42add3e4bd (diff)
Revert "Multipage allocation"
This reverts commit 6cd37713781a3092f8166b2178fae35cbfec1e28.
Diffstat (limited to 'lib')
-rw-r--r--lib/resource.c2
-rw-r--r--lib/slab.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/resource.c b/lib/resource.c
index e80b315b..0ad886d9 100644
--- a/lib/resource.c
+++ b/lib/resource.c
@@ -61,6 +61,7 @@ pool root_pool;
void *alloc_sys_page(void);
void free_sys_page(void *);
+void resource_sys_init(void);
static int indent;
@@ -282,6 +283,7 @@ rlookup(unsigned long a)
void
resource_init(void)
{
+ resource_sys_init();
root_pool.r.class = &pool_class;
root_pool.name = "Root";
init_list(&root_pool.inside);
diff --git a/lib/slab.c b/lib/slab.c
index 6348e29b..2fc88ee0 100644
--- a/lib/slab.c
+++ b/lib/slab.c
@@ -178,7 +178,7 @@ struct sl_alignment { /* Magic structure for testing of alignment */
int x[0];
};
-#define SL_GET_HEAD(x) ((struct sl_head *) PAGE_HEAD(x))
+#define SL_GET_HEAD(x) ((struct sl_head *) (((uintptr_t) (x)) & ~(page_size-1)))
/**
* sl_new - create a new Slab