[if gte mso 9]>
Subject: Re: [edk2] UEFI 2 questions
From: "Zimmer, Vincent" <email@example.com>
To: "firstname.lastname@example.org" <email@example.com>
Date: 2012-08-18 05:59:40
For #1 Use AllocatePages() boot services with the type of AllocateAddress
[From UEFI Spec]
Allocates memory pages from the system.
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.
1. Is there a way to requested an allocation of memory where i can specify the start address?
gives me the requested size. I also want to specify that it give me start address
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
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.