Changeset adecf496 in mainline
- Timestamp:
- 2005-09-23T22:54:45Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 48a02ef
- Parents:
- 4841104
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
include/mm/frame.h
r4841104 radecf496 53 53 count_t refcount; /**< when == 0, the frame is in free list */ 54 54 link_t link; /**< link to zone free list when refcount == 0 */ 55 } __attribute__ ((packed));55 }; 56 56 57 57 extern spinlock_t zone_head_lock; /**< this lock protects zone_head list */ -
include/mm/heap.h
r4841104 radecf496 33 33 #include <typedefs.h> 34 34 35 #define malloc(size) early_malloc(size) 36 #define free(ptr) early_free(ptr) 37 35 38 struct chunk { 36 39 int used; … … 41 44 }; 42 45 43 extern void heap_init(__address heap, size_t size);46 extern void early_heap_init(__address heap, size_t size); 44 47 45 extern void * malloc(size_t size);46 extern void free(void *ptr);48 extern void *early_malloc(size_t size); 49 extern void early_free(void *ptr); 47 50 48 51 #endif -
src/main/main.c
r4841104 radecf496 148 148 149 149 arch_pre_mm_init(); 150 heap_init(config.base + hardcoded_ktext_size + hardcoded_kdata_size, heap_size + heap_delta);150 early_heap_init(config.base + hardcoded_ktext_size + hardcoded_kdata_size, heap_size + heap_delta); 151 151 frame_init(); 152 152 page_init(); -
src/mm/frame.c
r4841104 radecf496 299 299 cnt = size / FRAME_SIZE; 300 300 301 z = (zone_t *) malloc(sizeof(zone_t));301 z = (zone_t *) early_malloc(sizeof(zone_t)); 302 302 if (z) { 303 303 link_initialize(&z->link); … … 312 312 z->busy_count = 0; 313 313 314 z->frames = (frame_t *) malloc(cnt * sizeof(frame_t));314 z->frames = (frame_t *) early_malloc(cnt * sizeof(frame_t)); 315 315 if (!z->frames) { 316 316 free(z); -
src/mm/heap.c
r4841104 radecf496 45 45 static spinlock_t heaplock; 46 46 47 void heap_init(__address heap, size_t size)47 void early_heap_init(__address heap, size_t size) 48 48 { 49 49 spinlock_initialize(&heaplock); … … 59 59 * Uses first-fit algorithm. 60 60 */ 61 void * malloc(size_t size)61 void *early_malloc(size_t size) 62 62 { 63 63 pri_t pri; … … 115 115 } 116 116 117 void free(void *ptr)117 void early_free(void *ptr) 118 118 { 119 119 pri_t pri;
Note:
See TracChangeset
for help on using the changeset viewer.