[if gte mso 9]>

Re: [edk2] UEFI 2 questions

Subject: Re: [edk2] UEFI 2 questions

From: "Zimmer, Vincent" <vincent.zimmer@intel.com>

To: "edk2-devel@lists.sourceforge.net" <edk2-devel@lists.sourceforge.net>

Date: 2012-08-18 05:59:40

For #1   Use AllocatePages() boot services with the type of AllocateAddress

 

[From UEFI Spec]

AllocatePages()

Summary

Allocates memory pages from the system.

Prototype

typedef

EFI_STATUS

AllocatePages(

IN EFI_ALLOCATE_TYPE Type,

IN EFI_MEMORY_TYPE MemoryType,

IN UINTN Pages,

IN OUT EFI_PHYSICAL_ADDRESS*Memory

);

 

Allocation requests of Type AllocateAddress allocate pages at the address pointed to by Memory on input.


For #2, that should work.  Namely the memory buffer (allocated by the UEFI driver via AllocatePages() while running on the BSP) can be accessed by the code running on the AP.

 

Vincent

 

From: Melwyn DSouza [mailto:mel17789@gmail.com]
Sent: Friday, August 17, 2012 2:50 PM
To: edk2-devel@lists.sourceforge.net
Subject: [edk2] UEFI 2 questions

 

Experts:

 

1. Is there a way to requested an allocation of memory where i can specify the start address?

AllocateReservedZeroPool (g_reqsz);

gives me the requested size. I also want to specify that it give me start address

 

like

VirtualAlloc((LPVOID) req_addr, g_reqsz, _MEM_LARGE_PAGES | MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);

 

I want to request a particular address for the allocated memory.

How to achieve this?

 

2. If i allocate using

AllocateReservedZeroPool 

in the RootApp at BSP and then 

Can i access this memory location from a AP thread, like moving data from the allocated memory to a CPU register in the AP thread function?

Allocation is done before the starting the AP. But i want to access this allocated memory in the AP thread function.

 

thanks,

Melwyn.