Ignore:
File:
1 edited

Legend:

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

    r97bdb4a r74c5a1ca  
    7575/********************/
    7676
    77 NO_TRACE static inline size_t frame_index(zone_t *zone, frame_t *frame)
     77static inline size_t frame_index(zone_t *zone, frame_t *frame)
    7878{
    7979        return (size_t) (frame - zone->frames);
    8080}
    8181
    82 NO_TRACE static inline size_t frame_index_abs(zone_t *zone, frame_t *frame)
     82static 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 NO_TRACE static inline bool frame_index_valid(zone_t *zone, size_t index)
     87static inline bool frame_index_valid(zone_t *zone, size_t index)
    8888{
    8989        return (index < zone->count);
    9090}
    9191
    92 NO_TRACE static inline size_t make_frame_index(zone_t *zone, frame_t *frame)
     92static inline size_t make_frame_index(zone_t *zone, frame_t *frame)
    9393{
    9494        return (frame - zone->frames);
     
    100100 *
    101101 */
    102 NO_TRACE static void frame_initialize(frame_t *frame)
     102static void frame_initialize(frame_t *frame)
    103103{
    104104        frame->refcount = 1;
     
    121121 *
    122122 */
    123 NO_TRACE static size_t zones_insert_zone(pfn_t base, size_t count)
     123static 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("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));
     135                        printf("Zones overlap!\n");
    139136                        return (size_t) -1;
    140137                }
     
    165162 */
    166163#ifdef CONFIG_DEBUG
    167 NO_TRACE static size_t total_frames_free(void)
     164static size_t total_frames_free(void)
    168165{
    169166        size_t total = 0;
     
    188185 *
    189186 */
    190 NO_TRACE size_t find_zone(pfn_t frame, size_t count, size_t hint)
     187size_t find_zone(pfn_t frame, size_t count, size_t hint)
    191188{
    192189        if (hint >= zones.count)
     
    209206
    210207/** @return True if zone can allocate specified order */
    211 NO_TRACE static bool zone_can_alloc(zone_t *zone, uint8_t order)
     208static bool zone_can_alloc(zone_t *zone, uint8_t order)
    212209{
    213210        return (zone_flags_available(zone->flags)
     
    225222 *
    226223 */
    227 NO_TRACE static size_t find_free_zone(uint8_t order, zone_flags_t flags,
    228     size_t hint)
     224static size_t find_free_zone(uint8_t order, zone_flags_t flags, size_t hint)
    229225{
    230226        if (hint >= zones.count)
     
    266262 *
    267263 */
    268 NO_TRACE static link_t *zone_buddy_find_block(buddy_system_t *buddy,
    269     link_t *child, uint8_t order)
     264static link_t *zone_buddy_find_block(buddy_system_t *buddy, link_t *child,
     265    uint8_t order)
    270266{
    271267        frame_t *frame = list_get_instance(child, frame_t, buddy_link);
     
    289285 *
    290286 */
    291 NO_TRACE static link_t *zone_buddy_find_buddy(buddy_system_t *buddy,
    292     link_t *block)
     287static link_t *zone_buddy_find_buddy(buddy_system_t *buddy, link_t *block)
    293288{
    294289        frame_t *frame = list_get_instance(block, frame_t, buddy_link);
     
    326321 *
    327322 */
    328 NO_TRACE static link_t *zone_buddy_bisect(buddy_system_t *buddy, link_t *block)
     323static link_t *zone_buddy_bisect(buddy_system_t *buddy, link_t *block)
    329324{
    330325        frame_t *frame_l = list_get_instance(block, frame_t, buddy_link);
     
    344339 *
    345340 */
    346 NO_TRACE static link_t *zone_buddy_coalesce(buddy_system_t *buddy,
    347     link_t *block_1, link_t *block_2)
     341static link_t *zone_buddy_coalesce(buddy_system_t *buddy, link_t *block_1,
     342    link_t *block_2)
    348343{
    349344        frame_t *frame1 = list_get_instance(block_1, frame_t, buddy_link);
     
    360355 *
    361356 */
    362 NO_TRACE static void zone_buddy_set_order(buddy_system_t *buddy, link_t *block,
     357static void zone_buddy_set_order(buddy_system_t *buddy, link_t *block,
    363358    uint8_t order)
    364359{
     
    374369 *
    375370 */
    376 NO_TRACE static uint8_t zone_buddy_get_order(buddy_system_t *buddy,
    377     link_t *block)
     371static uint8_t zone_buddy_get_order(buddy_system_t *buddy, link_t *block)
    378372{
    379373        return list_get_instance(block, frame_t, buddy_link)->buddy_order;
     
    386380 *
    387381 */
    388 NO_TRACE static void zone_buddy_mark_busy(buddy_system_t *buddy, link_t *block)
     382static void zone_buddy_mark_busy(buddy_system_t *buddy, link_t * block)
    389383{
    390384        list_get_instance(block, frame_t, buddy_link)->refcount = 1;
     
    395389 * @param buddy Buddy system.
    396390 * @param block Buddy system block.
    397  *
    398  */
    399 NO_TRACE static void zone_buddy_mark_available(buddy_system_t *buddy,
    400     link_t *block)
     391 */
     392static void zone_buddy_mark_available(buddy_system_t *buddy, link_t *block)
    401393{
    402394        list_get_instance(block, frame_t, buddy_link)->refcount = 0;
     
    429421 *
    430422 */
    431 NO_TRACE static pfn_t zone_frame_alloc(zone_t *zone, uint8_t order)
     423static pfn_t zone_frame_alloc(zone_t *zone, uint8_t order)
    432424{
    433425        ASSERT(zone_flags_available(zone->flags));
     
    457449 *
    458450 */
    459 NO_TRACE static void zone_frame_free(zone_t *zone, size_t frame_idx)
     451static void zone_frame_free(zone_t *zone, size_t frame_idx)
    460452{
    461453        ASSERT(zone_flags_available(zone->flags));
     
    478470
    479471/** Return frame from zone. */
    480 NO_TRACE static frame_t *zone_get_frame(zone_t *zone, size_t frame_idx)
     472static frame_t *zone_get_frame(zone_t *zone, size_t frame_idx)
    481473{
    482474        ASSERT(frame_idx < zone->count);
     
    485477
    486478/** Mark frame in zone unavailable to allocation. */
    487 NO_TRACE static void zone_mark_unavailable(zone_t *zone, size_t frame_idx)
     479static void zone_mark_unavailable(zone_t *zone, size_t frame_idx)
    488480{
    489481        ASSERT(zone_flags_available(zone->flags));
     
    514506 *
    515507 */
    516 NO_TRACE static void zone_merge_internal(size_t z1, size_t z2, zone_t *old_z1,
    517     buddy_system_t *buddy)
     508static void zone_merge_internal(size_t z1, size_t z2, zone_t *old_z1, buddy_system_t *buddy)
    518509{
    519510        ASSERT(zone_flags_available(zones.info[z1].flags));
     
    611602 *
    612603 */
    613 NO_TRACE static void return_config_frames(size_t znum, pfn_t pfn, size_t count)
     604static void return_config_frames(size_t znum, pfn_t pfn, size_t count)
    614605{
    615606        ASSERT(zone_flags_available(zones.info[znum].flags));
     
    646637 *
    647638 */
    648 NO_TRACE static void zone_reduce_region(size_t znum, pfn_t frame_idx,
    649     size_t count)
     639static void zone_reduce_region(size_t znum, pfn_t frame_idx, size_t count)
    650640{
    651641        ASSERT(zone_flags_available(zones.info[znum].flags));
     
    787777 *
    788778 */
    789 NO_TRACE static void zone_construct(zone_t *zone, buddy_system_t *buddy,
    790     pfn_t start, size_t count, zone_flags_t flags)
     779static void zone_construct(zone_t *zone, buddy_system_t *buddy, pfn_t start,
     780    size_t count, zone_flags_t flags)
    791781{
    792782        zone->base = start;
     
    831821 *
    832822 */
    833 size_t zone_conf_size(size_t count)
     823uintptr_t zone_conf_size(size_t count)
    834824{
    835825        return (count * sizeof(frame_t) + buddy_conf_size(fnzb(count)));
     
    11181108 *
    11191109 */
    1120 NO_TRACE void frame_reference_add(pfn_t pfn)
     1110void frame_reference_add(pfn_t pfn)
    11211111{
    11221112        irq_spinlock_lock(&zones.lock, true);
     
    11371127 *
    11381128 */
    1139 NO_TRACE void frame_mark_unavailable(pfn_t start, size_t count)
     1129void frame_mark_unavailable(pfn_t start, size_t count)
    11401130{
    11411131        irq_spinlock_lock(&zones.lock, true);
Note: See TracChangeset for help on using the changeset viewer.