Changeset 0d8a304 in mainline
- Timestamp:
- 2011-05-16T20:33:11Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3375bd4, 97d42d5
- Parents:
- 0496c17 (diff), 8d308b9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- kernel/generic
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/mm/frame.h
r0496c17 r0d8a304 164 164 extern void frame_free_noreserve(uintptr_t); 165 165 extern void frame_reference_add(pfn_t); 166 extern size_t frame_total_free_get(void); 166 167 167 168 extern size_t find_zone(pfn_t, size_t, size_t); -
kernel/generic/include/mm/reserve.h
r0496c17 r0d8a304 38 38 #include <typedefs.h> 39 39 40 extern void reserve_init(void); 40 41 extern bool reserve_try_alloc(size_t); 41 42 extern void reserve_force_alloc(size_t); -
kernel/generic/src/main/main.c
r0496c17 r0d8a304 71 71 #include <mm/as.h> 72 72 #include <mm/slab.h> 73 #include <mm/reserve.h> 73 74 #include <synch/waitq.h> 74 75 #include <synch/futex.h> … … 217 218 ddi_init(); 218 219 arch_post_mm_init(); 220 reserve_init(); 219 221 arch_pre_smp_init(); 220 222 smp_init(); -
kernel/generic/src/mm/frame.c
r0496c17 r0d8a304 182 182 * 183 183 */ 184 #ifdef CONFIG_DEBUG 185 NO_TRACE static size_t total_frames_free(void) 184 NO_TRACE static size_t frame_total_free_get_internal(void) 186 185 { 187 186 size_t total = 0; 188 187 size_t i; 188 189 189 for (i = 0; i < zones.count; i++) 190 190 total += zones.info[i].free_count; … … 192 192 return total; 193 193 } 194 #endif /* CONFIG_DEBUG */ 194 195 NO_TRACE size_t frame_total_free_get(void) 196 { 197 size_t total; 198 199 irq_spinlock_lock(&zones.lock, true); 200 total = frame_total_free_get_internal(); 201 irq_spinlock_unlock(&zones.lock, true); 202 203 return total; 204 } 205 195 206 196 207 /** Find a zone with a given frames. … … 840 851 buddy_system_free(zone->buddy_system, &zone->frames[i].buddy_link); 841 852 } 842 843 /* "Unreserve" new frames. */844 reserve_free(count);845 853 } else 846 854 zone->frames = NULL; … … 1051 1059 1052 1060 #ifdef CONFIG_DEBUG 1053 size_t avail = total_frames_free();1061 size_t avail = frame_total_free_get_internal(); 1054 1062 #endif 1055 1063 -
kernel/generic/src/mm/reserve.c
r0496c17 r0d8a304 45 45 IRQ_SPINLOCK_STATIC_INITIALIZE_NAME(reserve_lock, "reserve_lock"); 46 46 static ssize_t reserve = 0; 47 48 /** Initialize memory reservations tracking. 49 * 50 * This function must be called after frame zones are created and merged 51 * and before any address space area is created. 52 */ 53 void reserve_init(void) 54 { 55 reserve = frame_total_free_get(); 56 } 47 57 48 58 /** Try to reserve memory.
Note:
See TracChangeset
for help on using the changeset viewer.