Changeset 9a68b34d in mainline for generic/src/mm/frame.c


Ignore:
Timestamp:
2006-05-01T19:32:59Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7dd1787
Parents:
16dad032
Message:

PHT Refill handler

File:
1 edited

Legend:

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

    r16dad032 r9a68b34d  
    435435 *
    436436 * Assume zone is locked
    437  * Panics, if allocation is impossible.
     437 * Panics if allocation is impossible.
     438 *
     439 * @param zone  Zone to allocate from.
     440 * @param order Allocate exactly 2^order frames.
    438441 *
    439442 * @return Frame index in zone
    440  */
    441 static pfn_t zone_frame_alloc(zone_t *zone,__u8 order)
     443 *
     444 */
     445static pfn_t zone_frame_alloc(zone_t *zone, __u8 order)
    442446{
    443447        pfn_t v;
     
    892896/** Allocate power-of-two frames of physical memory.
    893897 *
    894  * @param flags Flags for host zone selection and address processing.
    895  * @param order Allocate exactly 2^order frames.
    896  * @param pzone Preferred zone
     898 * @param order  Allocate exactly 2^order frames.
     899 * @param flags  Flags for host zone selection and address processing.
     900 * @param status Allocation status (FRAME_OK on success), unused if NULL.
     901 * @param pzone  Preferred zone
    897902 *
    898903 * @return Allocated frame.
    899  */
    900 pfn_t frame_alloc_generic(__u8 order, int flags, int * status, int *pzone)
     904 *
     905 */
     906pfn_t frame_alloc_generic(__u8 order, int flags, int *status, int *pzone)
    901907{
    902908        ipl_t ipl;
     
    907913loop:
    908914        ipl = interrupts_disable();
     915       
    909916        /*
    910917         * First, find suitable frame zone.
    911918         */
    912         zone = find_free_zone_lock(order,pzone);
     919        zone = find_free_zone_lock(order, pzone);
     920       
    913921        /* If no memory, reclaim some slab memory,
    914922           if it does not help, reclaim all */
     
    916924                freed = slab_reclaim(0);
    917925                if (freed)
    918                         zone = find_free_zone_lock(order,pzone);
     926                        zone = find_free_zone_lock(order, pzone);
    919927                if (!zone) {
    920928                        freed = slab_reclaim(SLAB_RECLAIM_ALL);
    921929                        if (freed)
    922                                 zone = find_free_zone_lock(order,pzone);
     930                                zone = find_free_zone_lock(order, pzone);
    923931                }
    924932        }
     
    942950                goto loop;
    943951        }
    944         v = zone_frame_alloc(zone,order);
     952       
     953        v = zone_frame_alloc(zone, order);
    945954        v += zone->base;
    946955
Note: See TracChangeset for help on using the changeset viewer.