Changeset 09b859c in mainline for kernel/generic/src/mm


Ignore:
Timestamp:
2010-07-07T18:37:44Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
77385fe
Parents:
e2ea4ab1 (diff), 22c3444 (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.
Message:

Merge from mainline.

Location:
kernel/generic/src/mm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/as.c

    re2ea4ab1 r09b859c  
    116116as_t *AS_KERNEL = NULL;
    117117
    118 static int as_constructor(void *obj, unsigned int flags)
     118NO_TRACE static int as_constructor(void *obj, unsigned int flags)
    119119{
    120120        as_t *as = (as_t *) obj;
     
    128128}
    129129
    130 static size_t as_destructor(void *obj)
     130NO_TRACE static size_t as_destructor(void *obj)
    131131{
    132132        as_t *as = (as_t *) obj;
     
    274274 *
    275275 */
    276 void as_hold(as_t *as)
     276NO_TRACE void as_hold(as_t *as)
    277277{
    278278        atomic_inc(&as->refcount);
     
    287287 *
    288288 */
    289 void as_release(as_t *as)
     289NO_TRACE void as_release(as_t *as)
    290290{
    291291        if (atomic_predec(&as->refcount) == 0)
     
    303303 *
    304304 */
    305 static bool check_area_conflicts(as_t *as, uintptr_t va, size_t size,
     305NO_TRACE static bool check_area_conflicts(as_t *as, uintptr_t va, size_t size,
    306306    as_area_t *avoid_area)
    307307{
     
    463463 *
    464464 */
    465 static as_area_t *find_area_and_lock(as_t *as, uintptr_t va)
     465NO_TRACE static as_area_t *find_area_and_lock(as_t *as, uintptr_t va)
    466466{
    467467        ASSERT(mutex_locked(&as->lock));
     
    717717 *
    718718 */
    719 static void sh_info_remove_reference(share_info_t *sh_info)
     719NO_TRACE static void sh_info_remove_reference(share_info_t *sh_info)
    720720{
    721721        bool dealloc = false;
     
    987987 *
    988988 */
    989 bool as_area_check_access(as_area_t *area, pf_access_t access)
     989NO_TRACE bool as_area_check_access(as_area_t *area, pf_access_t access)
    990990{
    991991        int flagmap[] = {
     
    10101010 *
    10111011 */
    1012 static unsigned int area_flags_to_page_flags(unsigned int aflags)
     1012NO_TRACE static unsigned int area_flags_to_page_flags(unsigned int aflags)
    10131013{
    10141014        unsigned int flags = PAGE_USER | PAGE_PRESENT;
     
    13851385}
    13861386
    1387 
    1388 
    13891387/** Compute flags for virtual address translation subsytem.
    13901388 *
     
    13941392 *
    13951393 */
    1396 unsigned int as_area_get_flags(as_area_t *area)
     1394NO_TRACE unsigned int as_area_get_flags(as_area_t *area)
    13971395{
    13981396        ASSERT(mutex_locked(&area->lock));
     
    14121410 *
    14131411 */
    1414 pte_t *page_table_create(unsigned int flags)
     1412NO_TRACE pte_t *page_table_create(unsigned int flags)
    14151413{
    14161414        ASSERT(as_operations);
     
    14271425 *
    14281426 */
    1429 void page_table_destroy(pte_t *page_table)
     1427NO_TRACE void page_table_destroy(pte_t *page_table)
    14301428{
    14311429        ASSERT(as_operations);
     
    14481446 *
    14491447 */
    1450 void page_table_lock(as_t *as, bool lock)
     1448NO_TRACE void page_table_lock(as_t *as, bool lock)
    14511449{
    14521450        ASSERT(as_operations);
     
    14621460 *
    14631461 */
    1464 void page_table_unlock(as_t *as, bool unlock)
     1462NO_TRACE void page_table_unlock(as_t *as, bool unlock)
    14651463{
    14661464        ASSERT(as_operations);
     
    14771475 *         are locked, otherwise false.
    14781476 */
    1479 bool page_table_locked(as_t *as)
     1477NO_TRACE bool page_table_locked(as_t *as)
    14801478{
    14811479        ASSERT(as_operations);
  • kernel/generic/src/mm/frame.c

    re2ea4ab1 r09b859c  
    7575/********************/
    7676
    77 static inline size_t frame_index(zone_t *zone, frame_t *frame)
     77NO_TRACE static inline size_t frame_index(zone_t *zone, frame_t *frame)
    7878{
    7979        return (size_t) (frame - zone->frames);
    8080}
    8181
    82 static inline size_t frame_index_abs(zone_t *zone, frame_t *frame)
     82NO_TRACE static inline size_t frame_index_abs(zone_t *zone, frame_t *frame)
    8383{
    8484        return (size_t) (frame - zone->frames) + zone->base;
    8585}
    8686
    87 static inline bool frame_index_valid(zone_t *zone, size_t index)
     87NO_TRACE static inline bool frame_index_valid(zone_t *zone, size_t index)
    8888{
    8989        return (index < zone->count);
    9090}
    9191
    92 static inline size_t make_frame_index(zone_t *zone, frame_t *frame)
     92NO_TRACE static inline size_t make_frame_index(zone_t *zone, frame_t *frame)
    9393{
    9494        return (frame - zone->frames);
     
    100100 *
    101101 */
    102 static void frame_initialize(frame_t *frame)
     102NO_TRACE static void frame_initialize(frame_t *frame)
    103103{
    104104        frame->refcount = 1;
     
    121121 *
    122122 */
    123 static size_t zones_insert_zone(pfn_t base, size_t count)
     123NO_TRACE static size_t zones_insert_zone(pfn_t base, size_t count)
    124124{
    125125        if (zones.count + 1 == ZONES_MAX) {
     
    133133                if (overlaps(base, count,
    134134                    zones.info[i].base, zones.info[i].count)) {
    135                         printf("Zones overlap!\n");
     135                        printf("Zone (%p, %p) overlaps with zone (%p, %p)!\n",
     136                            PFN2ADDR(base), PFN2ADDR(base + count),
     137                            PFN2ADDR(zones.info[i].base),
     138                            PFN2ADDR(zones.info[i].base + zones.info[i].count));
    136139                        return (size_t) -1;
    137140                }
     
    162165 */
    163166#ifdef CONFIG_DEBUG
    164 static size_t total_frames_free(void)
     167NO_TRACE static size_t total_frames_free(void)
    165168{
    166169        size_t total = 0;
     
    185188 *
    186189 */
    187 size_t find_zone(pfn_t frame, size_t count, size_t hint)
     190NO_TRACE size_t find_zone(pfn_t frame, size_t count, size_t hint)
    188191{
    189192        if (hint >= zones.count)
     
    206209
    207210/** @return True if zone can allocate specified order */
    208 static bool zone_can_alloc(zone_t *zone, uint8_t order)
     211NO_TRACE static bool zone_can_alloc(zone_t *zone, uint8_t order)
    209212{
    210213        return (zone_flags_available(zone->flags)
     
    222225 *
    223226 */
    224 static size_t find_free_zone(uint8_t order, zone_flags_t flags, size_t hint)
     227NO_TRACE static size_t find_free_zone(uint8_t order, zone_flags_t flags,
     228    size_t hint)
    225229{
    226230        if (hint >= zones.count)
     
    262266 *
    263267 */
    264 static link_t *zone_buddy_find_block(buddy_system_t *buddy, link_t *child,
    265     uint8_t order)
     268NO_TRACE static link_t *zone_buddy_find_block(buddy_system_t *buddy,
     269    link_t *child, uint8_t order)
    266270{
    267271        frame_t *frame = list_get_instance(child, frame_t, buddy_link);
     
    285289 *
    286290 */
    287 static link_t *zone_buddy_find_buddy(buddy_system_t *buddy, link_t *block)
     291NO_TRACE static link_t *zone_buddy_find_buddy(buddy_system_t *buddy,
     292    link_t *block)
    288293{
    289294        frame_t *frame = list_get_instance(block, frame_t, buddy_link);
     
    321326 *
    322327 */
    323 static link_t *zone_buddy_bisect(buddy_system_t *buddy, link_t *block)
     328NO_TRACE static link_t *zone_buddy_bisect(buddy_system_t *buddy, link_t *block)
    324329{
    325330        frame_t *frame_l = list_get_instance(block, frame_t, buddy_link);
     
    339344 *
    340345 */
    341 static link_t *zone_buddy_coalesce(buddy_system_t *buddy, link_t *block_1,
    342     link_t *block_2)
     346NO_TRACE static link_t *zone_buddy_coalesce(buddy_system_t *buddy,
     347    link_t *block_1, link_t *block_2)
    343348{
    344349        frame_t *frame1 = list_get_instance(block_1, frame_t, buddy_link);
     
    355360 *
    356361 */
    357 static void zone_buddy_set_order(buddy_system_t *buddy, link_t *block,
     362NO_TRACE static void zone_buddy_set_order(buddy_system_t *buddy, link_t *block,
    358363    uint8_t order)
    359364{
     
    369374 *
    370375 */
    371 static uint8_t zone_buddy_get_order(buddy_system_t *buddy, link_t *block)
     376NO_TRACE static uint8_t zone_buddy_get_order(buddy_system_t *buddy,
     377    link_t *block)
    372378{
    373379        return list_get_instance(block, frame_t, buddy_link)->buddy_order;
     
    380386 *
    381387 */
    382 static void zone_buddy_mark_busy(buddy_system_t *buddy, link_t * block)
     388NO_TRACE static void zone_buddy_mark_busy(buddy_system_t *buddy, link_t *block)
    383389{
    384390        list_get_instance(block, frame_t, buddy_link)->refcount = 1;
     
    389395 * @param buddy Buddy system.
    390396 * @param block Buddy system block.
    391  */
    392 static void zone_buddy_mark_available(buddy_system_t *buddy, link_t *block)
     397 *
     398 */
     399NO_TRACE static void zone_buddy_mark_available(buddy_system_t *buddy,
     400    link_t *block)
    393401{
    394402        list_get_instance(block, frame_t, buddy_link)->refcount = 0;
     
    421429 *
    422430 */
    423 static pfn_t zone_frame_alloc(zone_t *zone, uint8_t order)
     431NO_TRACE static pfn_t zone_frame_alloc(zone_t *zone, uint8_t order)
    424432{
    425433        ASSERT(zone_flags_available(zone->flags));
     
    449457 *
    450458 */
    451 static void zone_frame_free(zone_t *zone, size_t frame_idx)
     459NO_TRACE static void zone_frame_free(zone_t *zone, size_t frame_idx)
    452460{
    453461        ASSERT(zone_flags_available(zone->flags));
     
    470478
    471479/** Return frame from zone. */
    472 static frame_t *zone_get_frame(zone_t *zone, size_t frame_idx)
     480NO_TRACE static frame_t *zone_get_frame(zone_t *zone, size_t frame_idx)
    473481{
    474482        ASSERT(frame_idx < zone->count);
     
    477485
    478486/** Mark frame in zone unavailable to allocation. */
    479 static void zone_mark_unavailable(zone_t *zone, size_t frame_idx)
     487NO_TRACE static void zone_mark_unavailable(zone_t *zone, size_t frame_idx)
    480488{
    481489        ASSERT(zone_flags_available(zone->flags));
     
    506514 *
    507515 */
    508 static void zone_merge_internal(size_t z1, size_t z2, zone_t *old_z1, buddy_system_t *buddy)
     516NO_TRACE static void zone_merge_internal(size_t z1, size_t z2, zone_t *old_z1,
     517    buddy_system_t *buddy)
    509518{
    510519        ASSERT(zone_flags_available(zones.info[z1].flags));
     
    602611 *
    603612 */
    604 static void return_config_frames(size_t znum, pfn_t pfn, size_t count)
     613NO_TRACE static void return_config_frames(size_t znum, pfn_t pfn, size_t count)
    605614{
    606615        ASSERT(zone_flags_available(zones.info[znum].flags));
     
    637646 *
    638647 */
    639 static void zone_reduce_region(size_t znum, pfn_t frame_idx, size_t count)
     648NO_TRACE static void zone_reduce_region(size_t znum, pfn_t frame_idx,
     649    size_t count)
    640650{
    641651        ASSERT(zone_flags_available(zones.info[znum].flags));
     
    777787 *
    778788 */
    779 static void zone_construct(zone_t *zone, buddy_system_t *buddy, pfn_t start,
    780     size_t count, zone_flags_t flags)
     789NO_TRACE static void zone_construct(zone_t *zone, buddy_system_t *buddy,
     790    pfn_t start, size_t count, zone_flags_t flags)
    781791{
    782792        zone->base = start;
     
    821831 *
    822832 */
    823 uintptr_t zone_conf_size(size_t count)
     833size_t zone_conf_size(size_t count)
    824834{
    825835        return (count * sizeof(frame_t) + buddy_conf_size(fnzb(count)));
     
    11081118 *
    11091119 */
    1110 void frame_reference_add(pfn_t pfn)
     1120NO_TRACE void frame_reference_add(pfn_t pfn)
    11111121{
    11121122        irq_spinlock_lock(&zones.lock, true);
     
    11271137 *
    11281138 */
    1129 void frame_mark_unavailable(pfn_t start, size_t count)
     1139NO_TRACE void frame_mark_unavailable(pfn_t start, size_t count)
    11301140{
    11311141        irq_spinlock_lock(&zones.lock, true);
  • kernel/generic/src/mm/page.c

    re2ea4ab1 r09b859c  
    115115 *
    116116 */
    117 void page_mapping_insert(as_t *as, uintptr_t page, uintptr_t frame,
     117NO_TRACE void page_mapping_insert(as_t *as, uintptr_t page, uintptr_t frame,
    118118    unsigned int flags)
    119119{
     
    139139 *
    140140 */
    141 void page_mapping_remove(as_t *as, uintptr_t page)
     141NO_TRACE void page_mapping_remove(as_t *as, uintptr_t page)
    142142{
    143143        ASSERT(page_table_locked(as));
     
    163163 *
    164164 */
    165 pte_t *page_mapping_find(as_t *as, uintptr_t page)
     165NO_TRACE pte_t *page_mapping_find(as_t *as, uintptr_t page)
    166166{
    167167        ASSERT(page_table_locked(as));
  • kernel/generic/src/mm/slab.c

    re2ea4ab1 r09b859c  
    177177 *
    178178 */
    179 static slab_t *slab_space_alloc(slab_cache_t *cache, unsigned int flags)
     179NO_TRACE static slab_t *slab_space_alloc(slab_cache_t *cache,
     180    unsigned int flags)
    180181{
    181182       
     
    224225 *
    225226 */
    226 static size_t slab_space_free(slab_cache_t *cache, slab_t *slab)
     227NO_TRACE static size_t slab_space_free(slab_cache_t *cache, slab_t *slab)
    227228{
    228229        frame_free(KA2PA(slab->start));
     
    236237
    237238/** Map object to slab structure */
    238 static slab_t *obj2slab(void *obj)
     239NO_TRACE static slab_t *obj2slab(void *obj)
    239240{
    240241        return (slab_t *) frame_get_parent(ADDR2PFN(KA2PA(obj)), 0);
     
    252253 *
    253254 */
    254 static size_t slab_obj_destroy(slab_cache_t *cache, void *obj, slab_t *slab)
     255NO_TRACE static size_t slab_obj_destroy(slab_cache_t *cache, void *obj,
     256    slab_t *slab)
    255257{
    256258        if (!slab)
     
    293295 *
    294296 */
    295 static void *slab_obj_create(slab_cache_t *cache, int flags)
     297NO_TRACE static void *slab_obj_create(slab_cache_t *cache, unsigned int flags)
    296298{
    297299        spinlock_lock(&cache->slablock);
     
    349351 *
    350352 */
    351 static slab_magazine_t *get_mag_from_cache(slab_cache_t *cache, bool first)
     353NO_TRACE static slab_magazine_t *get_mag_from_cache(slab_cache_t *cache,
     354    bool first)
    352355{
    353356        slab_magazine_t *mag = NULL;
     
    373376 *
    374377 */
    375 static void put_mag_to_cache(slab_cache_t *cache, slab_magazine_t *mag)
     378NO_TRACE static void put_mag_to_cache(slab_cache_t *cache,
     379    slab_magazine_t *mag)
    376380{
    377381        spinlock_lock(&cache->maglock);
     
    388392 *
    389393 */
    390 static size_t magazine_destroy(slab_cache_t *cache, slab_magazine_t *mag)
     394NO_TRACE static size_t magazine_destroy(slab_cache_t *cache,
     395    slab_magazine_t *mag)
    391396{
    392397        size_t i;
     
    406411 *
    407412 */
    408 static slab_magazine_t *get_full_current_mag(slab_cache_t *cache)
     413NO_TRACE static slab_magazine_t *get_full_current_mag(slab_cache_t *cache)
    409414{
    410415        slab_magazine_t *cmag = cache->mag_cache[CPU->id].current;
    411416        slab_magazine_t *lastmag = cache->mag_cache[CPU->id].last;
    412 
     417       
    413418        ASSERT(spinlock_locked(&cache->mag_cache[CPU->id].lock));
    414419       
     
    443448 *
    444449 */
    445 static void *magazine_obj_get(slab_cache_t *cache)
     450NO_TRACE static void *magazine_obj_get(slab_cache_t *cache)
    446451{
    447452        if (!CPU)
     
    473478 *
    474479 */
    475 static slab_magazine_t *make_empty_current_mag(slab_cache_t *cache)
     480NO_TRACE static slab_magazine_t *make_empty_current_mag(slab_cache_t *cache)
    476481{
    477482        slab_magazine_t *cmag = cache->mag_cache[CPU->id].current;
     
    479484       
    480485        ASSERT(spinlock_locked(&cache->mag_cache[CPU->id].lock));
    481 
     486       
    482487        if (cmag) {
    483488                if (cmag->busy < cmag->size)
     
    523528 *
    524529 */
    525 static int magazine_obj_put(slab_cache_t *cache, void *obj)
     530NO_TRACE static int magazine_obj_put(slab_cache_t *cache, void *obj)
    526531{
    527532        if (!CPU)
     
    552557 *
    553558 */
    554 static size_t comp_objects(slab_cache_t *cache)
     559NO_TRACE static size_t comp_objects(slab_cache_t *cache)
    555560{
    556561        if (cache->flags & SLAB_CACHE_SLINSIDE)
     
    564569 *
    565570 */
    566 static size_t badness(slab_cache_t *cache)
     571NO_TRACE static size_t badness(slab_cache_t *cache)
    567572{
    568573        size_t objects = comp_objects(cache);
     
    578583 *
    579584 */
    580 static bool make_magcache(slab_cache_t *cache)
     585NO_TRACE static bool make_magcache(slab_cache_t *cache)
    581586{
    582587        ASSERT(_slab_initialized >= 2);
     
    600605 *
    601606 */
    602 static void _slab_cache_create(slab_cache_t *cache, const char *name,
     607NO_TRACE static void _slab_cache_create(slab_cache_t *cache, const char *name,
    603608    size_t size, size_t align, int (*constructor)(void *obj,
    604609    unsigned int kmflag), size_t (*destructor)(void *obj), unsigned int flags)
     
    676681 *
    677682 */
    678 static size_t _slab_reclaim(slab_cache_t *cache, unsigned int flags)
     683NO_TRACE static size_t _slab_reclaim(slab_cache_t *cache, unsigned int flags)
    679684{
    680685        if (cache->flags & SLAB_CACHE_NOMAGAZINE)
     
    781786 *
    782787 */
    783 static void _slab_free(slab_cache_t *cache, void *obj, slab_t *slab)
     788NO_TRACE static void _slab_free(slab_cache_t *cache, void *obj, slab_t *slab)
    784789{
    785790        ipl_t ipl = interrupts_disable();
Note: See TracChangeset for help on using the changeset viewer.