Shubha: Yes. If EFI_MEMORY_DESCRIPTOR.Type is EfiConventionalMemory, the range is free to be allocated.
Thanks Liming -----Original Message----- From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Shubha Ramani Sent: Tuesday, October 27, 2015 1:35 AM To: edk2-devel@lists.01.org Subject: Re: [edk2] Getting "Incompatible Memory Type" in ConvertPages for AllocatePages Perhaps this is the answer ? I see that PhysicalStart is one of the struct elements - this is returned by GetMemoryMap(). typedef struct { UINT32 Type; EFI_PHYSICAL_ADDRESS PhysicalStart; EFI_VIRTUAL_ADDRESS VirtualStart; UINT64 NumberOfPages; UINT64 Attribute; } EFI_MEMORY_DESCRIPTOR; EFI MEMORY DESCRIPTOR - PhoenixWiki | | | | | | | | | EFI MEMORY DESCRIPTOR - PhoenixWikiFrom PhoenixWiki Jump to: | navigation, search Prototype typedef struct { UINT32 Type; | EFI_PHYSICAL_ADDRESS PhysicalStart; EFI_VIRTUAL_ADDRESS VirtualStart; | | | View on wiki.phoenix.com | Preview by Yahoo | | | | Shubha D. ramanishubharam...@gmail.com shubharam...@yahoo.com On Monday, October 26, 2015 10:30 AM, Shubha Ramani <shubharam...@yahoo.com> wrote: So I'm trying to call AllocatePages on a known fixed address as follows: Status=gBS->AllocatePages(AllocateAddress, EfiLoaderData , pages,(EFI_PHYSICAL_ADDRESS*)&memory); I'm reading pages and the addresses from PCI registers. Here is the problem, when I allocate I get "Incompatible Memory Type" in ConvertPages for AllocatePages. I have tried changing the fixed address to something else and I don't get the error. How do I find an intersection of allowable address ranges ? What I mean is, I have to usecertain address ranges in my application - but I want to make sure they're actually use-able. Will GetMemoryMap()give me available address ranges which can legally be allocated ? If so then I can find an intersectionbetween the address range(s) I want to use and what GetMemoryMap() returns. Thanks, Shubha Shubha D. ramanishubharam...@gmail.com shubharam...@yahoo.com _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel