Rev 534 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 534 | Rev 552 | ||
---|---|---|---|
Line 44... | Line 44... | ||
44 | static chunk_t *chunk0; |
44 | static chunk_t *chunk0; |
45 | static spinlock_t heaplock; |
45 | static spinlock_t heaplock; |
46 | 46 | ||
47 | void early_heap_init(__address heap, size_t size) |
47 | void early_heap_init(__address heap, size_t size) |
48 | { |
48 | { |
49 | spinlock_initialize(&heaplock); |
49 | spinlock_initialize(&heaplock, "heap_lock"); |
50 | memsetb(heap, size, 0); |
50 | memsetb(heap, size, 0); |
51 | chunk0 = (chunk_t *) heap; |
51 | chunk0 = (chunk_t *) heap; |
52 | chunk0->used = 0; |
52 | chunk0->used = 0; |
53 | chunk0->size = size - sizeof(chunk_t); |
53 | chunk0->size = size - sizeof(chunk_t); |
54 | chunk0->next = NULL; |
54 | chunk0->next = NULL; |