Changeset 2e9eae2 in mainline for generic/src/mm/frame.c


Ignore:
Timestamp:
2006-06-23T16:03:53Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
757551a3
Parents:
a832dd7
Message:

Changed interface of frame_alloc/free to use address of frame instead of the pfn.
This makes it impossible to use >4GB of memory on 32-bit machines, but who cares…

File:
1 edited

Legend:

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

    ra832dd7 r2e9eae2  
    929929 * @param pzone  Preferred zone
    930930 *
    931  * @return Allocated frame.
    932  *
    933  */
    934 pfn_t frame_alloc_generic(__u8 order, int flags, int *status, int *pzone)
     931 * @return Physical address of the allocated frame.
     932 *
     933 */
     934void * frame_alloc_generic(__u8 order, int flags, int *status, int *pzone)
    935935{
    936936        ipl_t ipl;
     
    972972                        if (status)
    973973                                *status = FRAME_NO_MEMORY;
    974                         return NULL;
     974                        return 0;
    975975                }
    976976               
     
    987987        if (status)
    988988                *status = FRAME_OK;
    989         return v;
     989
     990        if (flags & FRAME_KA)
     991                return (void *)PA2KA(PFN2ADDR(v));
     992        return (void *)PFN2ADDR(v);
    990993}
    991994
     
    996999 * If it drops to zero, move the frame structure to free list.
    9971000 *
    998  * @param pfn Frame number of the frame to be freed.
    999  */
    1000 void frame_free(pfn_t pfn)
     1001 * @param Frame Physical Address of of the frame to be freed.
     1002 */
     1003void frame_free(__address frame)
    10011004{
    10021005        ipl_t ipl;
    10031006        zone_t *zone;
     1007        pfn_t pfn = ADDR2PFN(frame);
    10041008
    10051009        ipl = interrupts_disable();
Note: See TracChangeset for help on using the changeset viewer.