Changeset 22f7769 in mainline for src/mm/heap.c
- Timestamp:
- 2005-10-17T23:31:41Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4b2c872d
- Parents:
- 75eacab
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mm/heap.c
r75eacab r22f7769 61 61 void *early_malloc(size_t size) 62 62 { 63 pri_t pri;63 ipl_t ipl; 64 64 chunk_t *x, *y, *z; 65 65 … … 68 68 69 69 x = chunk0; 70 pri = cpu_priority_high();70 ipl = interrupts_disable(); 71 71 spinlock_lock(&heaplock); 72 72 while (x) { … … 85 85 if (x->size < size + sizeof(chunk_t) + 1) { 86 86 spinlock_unlock(&heaplock); 87 cpu_priority_restore(pri);87 interrupts_restore(ipl); 88 88 return &x->data[0]; 89 89 } … … 106 106 x->next = y; 107 107 spinlock_unlock(&heaplock); 108 cpu_priority_restore(pri);108 interrupts_restore(ipl); 109 109 110 110 return &x->data[0]; 111 111 } 112 112 spinlock_unlock(&heaplock); 113 cpu_priority_restore(pri);113 interrupts_restore(ipl); 114 114 return NULL; 115 115 } … … 117 117 void early_free(void *ptr) 118 118 { 119 pri_t pri;119 ipl_t ipl; 120 120 chunk_t *x, *y, *z; 121 121 … … 128 128 panic("freeing unused/damaged chunk"); 129 129 130 pri = cpu_priority_high();130 ipl = interrupts_disable(); 131 131 spinlock_lock(&heaplock); 132 132 x = y->prev; … … 151 151 y->used = 0; 152 152 spinlock_unlock(&heaplock); 153 cpu_priority_restore(pri);153 interrupts_restore(ipl); 154 154 }
Note:
See TracChangeset
for help on using the changeset viewer.