]> git.proxmox.com Git - mirror_edk2.git/commit - EmulatorPkg/Unix/Host/Host.h
InOsEmuPkg: Add an OS malloc/valloc/free based implementation of the MemoryAllocation...
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 24 Jun 2011 23:59:51 +0000 (23:59 +0000)
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 24 Jun 2011 23:59:51 +0000 (23:59 +0000)
commit1d7ac5a617fba582abfddb4ce240b81b2c24742f
treef00432f48f9827b3ca0342beaddd5a813aa6cd8f
parent0de7effb732dfd9f286e1ecaf9dcb35711ee1d78
InOsEmuPkg: Add an OS malloc/valloc/free based implementation of the MemoryAllocationLib. Requires extra Thunk APIs.

I've got this working. The tricky part was a driver/application can mix malloc forms. If the driver links against this library all the allocations come from the OS service, but if a protocol or EFI boot service return an allocated buffer it will still use the EFI allocation. The gasket code can detect this and do the right thing, as the emulator is passing up the memory map to EFI.

You can now use the OS based malloc debugging tools in an EFI driver or appliaction. On OS X this is libgmalloc, also called guard malloc.

Signed-off-by: andrewfish.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11886 6f19259b-4bc3-4df7-8a09-765794883524
InOsEmuPkg/Include/Protocol/EmuThunk.h
InOsEmuPkg/Library/GuardUefiMemoryAllocationLib/GuardUefiMemoryAllocationLib.inf [new file with mode: 0644]
InOsEmuPkg/Library/GuardUefiMemoryAllocationLib/MemoryAllocationLib.c [new file with mode: 0644]
InOsEmuPkg/Unix/Sec/EmuThunk.c
InOsEmuPkg/Unix/Sec/Gasket.h
InOsEmuPkg/Unix/Sec/Ia32/Gasket.S
InOsEmuPkg/Unix/Sec/SecMain.c
InOsEmuPkg/Unix/Sec/SecMain.h
InOsEmuPkg/Unix/Sec/X64/Gasket.S
InOsEmuPkg/Unix/UnixX64.dsc