Home | History | Annotate | Download | only in SecPeiDebugAgent

Lines Matching defs:Mailbox

119   Get the pointer to location saved Mailbox pointer from IDT entry.

131 // *MailboxLocation is the pointer to Mailbox
138 Set the pointer of Mailbox into IDT entry before memory is ready.
140 @param[in] MailboxLocation Pointer to location saved Mailbox pointer.
152 Get the location of Mailbox pointer from the GUIDed HOB.
154 @return Pointer to the location saved Mailbox pointer.
172 Get Debug Agent Mailbox pointer.
174 @return Mailbox pointer.
185 DEBUG_AGENT_MAILBOX *Mailbox;
188 // Get mailbox from IDT entry firstly
191 Mailbox = (DEBUG_AGENT_MAILBOX *)(UINTN)(*MailboxLocationInIdt);
195 if (Mailbox->DebugFlag.Bits.CheckMailboxInHob != 1 ||
196 Mailbox->DebugFlag.Bits.InitArch != DEBUG_ARCH_SYMBOL) {
198 // If mailbox was setup in SEC or the current CPU arch is different from the init arch
199 // Debug Agent initialized, return the mailbox from IDT entry directly.
200 // Otherwise, we need to check the mailbox location saved in GUIDed HOB further.
202 return Mailbox;
207 // Compare mailbox in IDT enry with mailbox in HOB,
208 // need to fix mailbox location if HOB moved by PEI CORE
211 Mailbox = (DEBUG_AGENT_MAILBOX *)(UINTN)(*MailboxLocationInHob);
213 // Fix up Debug Port handler and save new mailbox in IDT entry
215 Mailbox = (DEBUG_AGENT_MAILBOX *)((UINTN)Mailbox + ((UINTN)(MailboxLocationInHob) - (UINTN)MailboxLocationInIdt));
216 DebugPortHandle = (UINT64)((UINTN)Mailbox->DebugPortHandle + ((UINTN)(MailboxLocationInHob) - (UINTN)MailboxLocationInIdt));
217 UpdateMailboxContent (Mailbox, DEBUG_MAILBOX_DEBUG_PORT_HANDLE_INDEX, DebugPortHandle);
218 *MailboxLocationInHob = (UINT64)(UINTN)Mailbox;
223 Mailbox->DebugFlag.Bits.CheckMailboxInHob = 0;
224 UpdateMailboxChecksum (Mailbox);
227 return Mailbox;
267 DEBUG_AGENT_MAILBOX *Mailbox;
279 // Allocate ACPI NVS memory for new Mailbox and Debug Port Handle buffer
289 // Copy Mailbox and Debug Port Handle buffer to new location in ACPI NVS memory, because original Mailbox
293 Mailbox = GetMailboxPointer ();
294 CopyMem (NewMailbox, Mailbox, sizeof (DEBUG_AGENT_MAILBOX));
295 CopyMem (NewMailbox + 1, (VOID *)(UINTN)Mailbox->DebugPortHandle, PcdGet16(PcdDebugPortHandleBufferSize));
297 // Update Mailbox Location pointer in GUIDed HOB and IDT entry with new one
304 // Update Debug Port Handle in new Mailbox
334 It will set up debug agent Mailbox in cache-as-ramfrom. It will be called before
337 HOB to copy debug agent Mailbox. It will be called after physical memory is ready.
366 DEBUG_AGENT_MAILBOX *Mailbox;
393 Mailbox = &MailboxInStack;
394 ZeroMem ((VOID *) Mailbox, sizeof (DEBUG_AGENT_MAILBOX));
411 UpdateMailboxContent (Mailbox, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency);
425 Mailbox = GetMailboxPointer ();
445 // Fix up Debug Port handle address and mailbox address
449 DebugPortHandle = (UINT64)(UINT32)(Mailbox->DebugPortHandle + DebugAgentContext->StackMigrateOffset);
450 UpdateMailboxContent (Mailbox, DEBUG_MAILBOX_DEBUG_PORT_HANDLE_INDEX, DebugPortHandle);
451 Mailbox = (DEBUG_AGENT_MAILBOX *) ((UINTN) Mailbox + DebugAgentContext->StackMigrateOffset);
452 MailboxLocation = (UINT64)(UINTN)Mailbox;
454 // Build mailbox location in HOB and fix-up its address
464 // DebugAgentContext is NULL. Then, Mailbox can directly be copied into memory.
465 // Allocate ACPI NVS memory for new Mailbox and Debug Port Handle buffer
478 // Copy Mailbox and Debug Port Handle buffer to new location in ACPI NVS memory, because original Mailbox
482 CopyMem (NewMailbox, Mailbox, sizeof (DEBUG_AGENT_MAILBOX));
483 CopyMem (NewMailbox + 1, (VOID *)(UINTN)Mailbox->DebugPortHandle, PcdGet16(PcdDebugPortHandleBufferSize));
487 // Build mailbox location in HOB
496 // Update IDT entry to save the location saved mailbox pointer
526 // Build mailbox in HOB and setup Mailbox Set In Pei flag
528 Mailbox = AllocateZeroPool (sizeof (DEBUG_AGENT_MAILBOX));
529 if (Mailbox == NULL) {
533 MailboxLocation = (UINT64)(UINTN)Mailbox;
543 UpdateMailboxContent (Mailbox, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency);
545 // Update IDT entry to save the location pointer saved mailbox pointer
587 Mailbox = (DEBUG_AGENT_MAILBOX *) (UINTN)(*MailboxLocationPointer);
589 // Mailbox should valid and setup before executing thunk code
591 VerifyMailboxChecksum (Mailbox);
593 DebugPortHandle = (UINT64) (UINTN)DebugPortInitialize ((VOID *)(UINTN)Mailbox->DebugPortHandle, NULL);
594 UpdateMailboxContent (Mailbox, DEBUG_MAILBOX_DEBUG_PORT_HANDLE_INDEX, DebugPortHandle);
600 // Update IDT entry to save location pointer saved the mailbox pointer
666 DEBUG_AGENT_MAILBOX *Mailbox;
673 Mailbox = (DEBUG_AGENT_MAILBOX *)(UINTN)(*MailboxLocation);
680 UpdateMailboxContent (Mailbox, DEBUG_MAILBOX_DEBUG_PORT_HANDLE_INDEX, NewDebugPortHandle);