Subversion Repositories HelenOS

Rev

Rev 1760 | Rev 1767 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1760 Rev 1766
Line 929... Line 929...
929
 * @param pzone  Preferred zone
929
 * @param pzone  Preferred zone
930
 *
930
 *
931
 * @return Physical address of the allocated frame.
931
 * @return Physical address of the allocated frame.
932
 *
932
 *
933
 */
933
 */
934
void * frame_alloc_generic(__u8 order, int flags, int *status, int *pzone)
934
void * frame_alloc_generic(__u8 order, int flags, int *pzone)
935
{
935
{
936
    ipl_t ipl;
936
    ipl_t ipl;
937
    int freed;
937
    int freed;
938
    pfn_t v;
938
    pfn_t v;
939
    zone_t *zone;
939
    zone_t *zone;
Line 965... Line 965...
965
        /*
965
        /*
966
         * TODO: Sleep until frames are available again.
966
         * TODO: Sleep until frames are available again.
967
         */
967
         */
968
        interrupts_restore(ipl);
968
        interrupts_restore(ipl);
969
 
969
 
970
        if (flags & FRAME_ATOMIC) {
970
        if (flags & FRAME_ATOMIC)
971
            ASSERT(status != NULL);
-
 
972
            if (status)
-
 
973
                *status = FRAME_NO_MEMORY;
-
 
974
            return 0;
971
            return 0;
975
        }
-
 
976
       
972
       
977
        panic("Sleep not implemented.\n");
973
        panic("Sleep not implemented.\n");
978
        goto loop;
974
        goto loop;
979
    }
975
    }
980
   
976
   
Line 982... Line 978...
982
    v += zone->base;
978
    v += zone->base;
983
 
979
 
984
    spinlock_unlock(&zone->lock);
980
    spinlock_unlock(&zone->lock);
985
    interrupts_restore(ipl);
981
    interrupts_restore(ipl);
986
 
982
 
987
    if (status)
-
 
988
        *status = FRAME_OK;
-
 
989
 
-
 
990
    if (flags & FRAME_KA)
983
    if (flags & FRAME_KA)
991
        return (void *)PA2KA(PFN2ADDR(v));
984
        return (void *)PA2KA(PFN2ADDR(v));
992
    return (void *)PFN2ADDR(v);
985
    return (void *)PFN2ADDR(v);
993
}
986
}
994
 
987