Ignore:
Timestamp:
Apr 19, 2025, 8:08:37 PM (4 months ago)
Author:
David Azarewicz
Message:

Merge in changes from 6.6-LTS branch.
Fixed additional 25+ problems.

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/lib32/memory.c

    r679 r772  
    424424void *__vmalloc(unsigned long size, gfp_t gfp_mask)
    425425{
    426         return vmalloc(size);
     426    LINEAR addr;
     427    addr = (LINEAR) vmalloc(size);
     428
     429    if (gfp_mask & __GFP_ZERO)
     430        memset((LINEAR)addr, 0, size);
     431
     432    return addr;
    427433}
    428434//******************************************************************************
     
    610616
    611617//******************************************************************************
     618//******************************************************************************
    612619#ifdef DEBUGHEAP
    613620void *__kmalloc(int size, int flags, const char *filename, int lineno)
     
    626633    }
    627634    if(size >= 4096) {
    628         return vmalloc(size);
    629     }
     635        addr = (LINEAR)vmalloc(size);
     636    } else {
    630637#ifdef DEBUGHEAP
    631     addr = (LINEAR)malloc(size, filename, lineno);
     638        addr = (LINEAR)malloc(size, filename, lineno);
    632639#else
    633     addr = (LINEAR)malloc(size);
     640        addr = (LINEAR)malloc(size);
    634641#endif
     642    }
    635643    if(addr == NULL) {
    636644        DebugInt3();
    637645        return 0;
    638646    }
     647    if (flags & __GFP_ZERO)
     648        memset((LINEAR)addr, 0, size);
    639649        //dprintf(("kmalloc %d returned %x", size, addr));
    640650    return addr;
    641651}
    642652
     653//******************************************************************************
    643654//******************************************************************************
    644655#ifdef DEBUGHEAP
     
    668679
    669680//******************************************************************************
    670 void *kzalloc(size_t size, unsigned int flags)
    671 {
    672         void *ret;
    673         ret = _kmalloc(size, flags);
    674         if (ret)
    675                 memset(ret, 0, size);
    676         return ret;
    677 }
    678 //******************************************************************************
    679681//******************************************************************************
    680682void *kcalloc(size_t n, size_t size, unsigned int flags)
     
    773775        return buf;
    774776}
     777
    775778//******************************************************************************
    776779//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.