Rev 1787 | Rev 2015 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1787 | Rev 1868 | ||
---|---|---|---|
Line 34... | Line 34... | ||
34 | 34 | ||
35 | #include <as.h> |
35 | #include <as.h> |
36 | #include <libc.h> |
36 | #include <libc.h> |
37 | #include <unistd.h> |
37 | #include <unistd.h> |
38 | #include <align.h> |
38 | #include <align.h> |
- | 39 | #include <types.h> |
|
- | 40 | ||
- | 41 | /** |
|
- | 42 | * Either 4*256M on 32-bit architecures or 16*256M on 64-bit architectures. |
|
- | 43 | */ |
|
- | 44 | #define MAX_HEAP_SIZE (sizeof(uintptr_t)<<28) |
|
39 | 45 | ||
40 | /** Create address space area. |
46 | /** Create address space area. |
41 | * |
47 | * |
42 | * @param address Virtual address where to place new address space area. |
48 | * @param address Virtual address where to place new address space area. |
43 | * @param size Size of the area. |
49 | * @param size Size of the area. |
Line 139... | Line 145... | ||
139 | { |
145 | { |
140 | void *res; |
146 | void *res; |
141 | 147 | ||
142 | /* Set heapsize to some meaningful value */ |
148 | /* Set heapsize to some meaningful value */ |
143 | if (maxheapsize == -1) |
149 | if (maxheapsize == -1) |
144 | set_maxheapsize(ALIGN_UP(USER_ADDRESS_SPACE_SIZE_ARCH >> 1, PAGE_SIZE)); |
150 | set_maxheapsize(MAX_HEAP_SIZE); |
145 | 151 | ||
146 | if (!last_allocated) |
152 | if (!last_allocated) |
147 | last_allocated = (void *) ALIGN_UP((void *) &_heap + maxheapsize, PAGE_SIZE); |
153 | last_allocated = (void *) ALIGN_UP((void *) &_heap + maxheapsize, PAGE_SIZE); |
148 | 154 | ||
149 | sz = ALIGN_UP(sz, PAGE_SIZE); |
155 | sz = ALIGN_UP(sz, PAGE_SIZE); |