[BACK]Return to kern_mem.c CVS log [TXT][DIR] Up to [local] / funnyos / kern

Diff for /funnyos/kern/kern_mem.c between version 1.6 and 1.7

version 1.6, 2007/10/26 11:59:12 version 1.7, 2007/10/26 14:15:20
Line 158 
Line 158 
                                         /* rewind pointer to the first byte */                                          /* rewind pointer to the first byte */
                                         firstpageptr = lastpageptr - ((npages - 1));                                          firstpageptr = lastpageptr - ((npages - 1));
   
                                         offbits = nmbmbits;  
                                         /* fill this (npages pages) region with zeroes */                                          /* fill this (npages pages) region with zeroes */
                                         while(firstpageptr <= lastpageptr) {                                          while(firstpageptr <= lastpageptr) {
   
                                                 /* TODO invalidate page in membmap */                                                  /* TODO invalidate page in membmap */
                                                 offbytes = ((uint32_t)firstpageptr - (uint32_t)allocbase) / (KMEM_PAGESIZE * 8);                                                  offbytes = ((uint32_t)firstpageptr - (uint32_t)allocbase) / (KMEM_PAGESIZE * 8);
 //                                              printf("offbytes=%d\n", offbytes);                                                  offbits = ((uint32_t)firstpageptr - (uint32_t)allocbase) / (KMEM_PAGESIZE);
   
                                                   if (offbits > 7)
                                                           offbits -= 8 * (offbits / 8);
   
 //                                              printf("membmap[%d] |= 1 << %d\n", offbytes, offbits);  //                                              printf("membmap[%d] |= 1 << %d\n", offbytes, offbits);
                                                 membmap[offbytes] |= 1 << offbits;                                                  membmap[offbytes] |= 1 << offbits;
   
Line 184 
Line 187 
                                         firstpageptr = lastpageptr - ((npages - 1));                                          firstpageptr = lastpageptr - ((npages - 1));
   
                                         /* got it */                                          /* got it */
                                         DPRINTF("allocated, addr=0x%x len=0x%x [0x%x-0x%x]\n", firstpageptr, npages * KMEM_PAGESIZE, firstpageptr, lastpageptr);                                          DPRINTF("allocated, addr=0x%x len=%d [0x%x-0x%x]\n", firstpageptr, npages * KMEM_PAGESIZE, firstpageptr, lastpageptr);
   
                                         /* decrement system free pages */                                          /* decrement system free pages */
                                         freepages -= npages;                                          freepages -= npages;

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

CVSweb