Changeset f275cb3 in mainline for generic/src/mm


Ignore:
Timestamp:
2006-01-08T16:35:41Z (20 years ago)
Author:
Sergey Bondari <bondari@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b2c92f33
Parents:
677a6d5
Message:

Frame alloc test #1

Location:
generic/src/mm
Files:
2 edited

Legend:

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

    r677a6d5 rf275cb3  
    8484 * @return Allocated frame.
    8585 */
    86 __address frame_alloc(int flags, __u8 order)
     86__address frame_alloc(int flags, __u8 order, int * status)
    8787{
    8888        ipl_t ipl;
     
    118118                        panic("Can't allocate frame.\n");
    119119               
     120               
     121               
    120122                /*
    121123                 * TODO: Sleep until frames are available again.
     
    124126                interrupts_restore(ipl);
    125127
     128                if (flags & FRAME_NON_BLOCKING) {
     129                        ASSERT(status != NULL);
     130                        *status = FRAME_NO_MEMORY;
     131                        return NULL;
     132                }
     133               
    126134                panic("Sleep not implemented.\n");
    127135                goto loop;
     
    151159        if (flags & FRAME_KA)
    152160                v = PA2KA(v);
     161       
     162        if (flags & FRAME_NON_BLOCKING) {
     163                ASSERT(status != NULL);
     164                *status = FRAME_OK;
     165        }
    153166       
    154167        return v;
  • generic/src/mm/vm.c

    r677a6d5 rf275cb3  
    7171               
    7272                        src_ptl0 = (pte_t *) PA2KA((__address) GET_PTL0_ADDRESS());
    73                         dst_ptl0 = (pte_t *) frame_alloc(FRAME_KA | FRAME_PANIC, ONE_FRAME);
     73                        dst_ptl0 = (pte_t *) frame_alloc(FRAME_KA | FRAME_PANIC, ONE_FRAME, NULL);
    7474
    7575//                      memsetb((__address) dst_ptl0, PAGE_SIZE, 0);
     
    117117               
    118118                for (i=0; i<size; i++)
    119                         a->mapping[i] = frame_alloc(0, ONE_FRAME);
     119                        a->mapping[i] = frame_alloc(0, ONE_FRAME, NULL);
    120120               
    121121                spinlock_initialize(&a->lock, "vm_area_lock");
Note: See TracChangeset for help on using the changeset viewer.