Ignore:
Timestamp:
May 23, 2010, 10:17:06 PM (15 years ago)
Author:
David Azarewicz
Message:

Added quirk for Gateway 2000 ICH2/AD1885

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk/lib32/memory.cpp

    r445 r485  
    106106    pCur = pBaseAddrHead;
    107107
    108     if(pCur->retaddr == addr) 
     108    if(pCur->retaddr == addr)
    109109    {
    110110        addr = pCur->base;
     
    160160    APIRET rc = 0;
    161161    ULONG addr = 0;
    162    
     162
    163163#ifdef KEE
    164164    SHORT sel;
     
    176176extern "C" int fStrategyInit;
    177177//******************************************************************************
    178 APIRET VMAlloc(ULONG size, ULONG flags, LINEAR *pAddr) 
     178APIRET VMAlloc(ULONG size, ULONG flags, LINEAR *pAddr)
    179179{
    180180    APIRET rc;
     
    211211//******************************************************************************
    212212//******************************************************************************
    213 APIRET VMFree(LINEAR addr) 
     213APIRET VMFree(LINEAR addr)
    214214{
    215215    APIRET rc;
     
    302302    size = order * PAGE_SIZE;
    303303
    304     if(gfp_mask & (GFP_DMA|GFP_DMAHIGHMEM)) 
     304    if(gfp_mask & (GFP_DMA|GFP_DMAHIGHMEM))
    305305    {//below 16 mb for legacy DMA?
    306306        if(gfp_mask & GFP_DMA)
     
    326326    }
    327327    else allocsize = size;
    328    
     328
    329329    if(VMAlloc(allocsize, flags, (LINEAR *)&addr)) {
    330330                DebugInt3();
    331331                return 0;
    332332        }
    333 ////    dprintf(("__get_free_pages %d returned %x", order*PAGE_SIZE, addr));   
    334     if(gfp_mask & (GFP_DMA|GFP_DMAHIGHMEM)) 
     333////    dprintf(("__get_free_pages %d returned %x", order*PAGE_SIZE, addr));
     334    if(gfp_mask & (GFP_DMA|GFP_DMAHIGHMEM))
    335335    {//must be aligned at 64kb boundary
    336336        ULONG physaddr = virt_to_phys((void *)addr);
     
    377377    //check if it really is the base of the allocation (see above)
    378378    addr = GetBaseAddress(addr, (ULONG NEAR *)__Stack32ToFlat(&size));
    379    
     379
    380380    if(VMFree((LINEAR)addr)) {
    381381        DebugInt3();
     
    410410    if(addr) {
    411411#ifdef DEBUG
    412         dprintf(("vmalloc %d -> %x (phys %x)", size, addr, virt_to_phys((void *)addr)));
     412        //dprintf(("vmalloc %d -> %x (phys %x)", size, addr, virt_to_phys((void *)addr)));
    413413#endif
    414414        //only done to save size of memory block
     
    416416        ulget_free_pagesMemUsed += size;
    417417#ifdef DEBUG
    418         dprintf(("vmalloc: total alloc size %d", ulget_free_pagesMemUsed));
     418        //dprintf(("vmalloc: total alloc size %d", ulget_free_pagesMemUsed));
    419419#endif
    420420    }
     
    429429
    430430    GetBaseAddress((ULONG)ptr, (ULONG NEAR *)__Stack32ToFlat(&size));
    431    
     431
    432432    if(VMFree((LINEAR)ptr)) {
    433433        DebugInt3();
     
    435435    else {
    436436#ifdef DEBUG
    437         dprintf(("vfree %x size %d", (ULONG)ptr, size));
     437        //dprintf(("vfree %x size %d", (ULONG)ptr, size));
    438438#endif
    439439        ulget_free_pagesMemUsed -= size;
    440440#ifdef DEBUG
    441         dprintf(("vfree: total alloc size %d", ulget_free_pagesMemUsed));
     441        //dprintf(("vfree: total alloc size %d", ulget_free_pagesMemUsed));
    442442#endif
    443443    }
     
    635635    }
    636636////  dprintf(("kfree %x", addr));
    637     if(IsHeapAddr(addr)) { 
     637    if(IsHeapAddr(addr)) {
    638638#ifdef DEBUGHEAP
    639         free((void *)addr, filename, lineno); 
    640 #else
    641             free((void *)addr); 
     639        free((void *)addr, filename, lineno);
     640#else
     641            free((void *)addr);
    642642#endif
    643643    }
Note: See TracChangeset for help on using the changeset viewer.