/* Setup separate stacks for certain exception handlers. If the input Buffer and BufferSize are both NULL, use global variable if possible. */
EFI_STATUS EFIAPI InitializeSeparateExceptionStacks(IN VOID *Buffer, IN OUT UINTN *BufferSize)
/* Setup separate stacks for certain exception handlers. If the input Buffer and BufferSize are both NULL, use global variable if possible. */
EFI_STATUS EFIAPI InitializeSeparateExceptionStacks(IN VOID *Buffer, IN OUT UINTN *BufferSize)
{
  UINTN       LocalBufferSize;
  EFI_STATUS  Status;
  if ((Buffer == NULL) && (BufferSize == NULL)) {
    SetMem (mBuffer, sizeof (mBuffer), 0);
    LocalBufferSize = sizeof (mBuffer);
    Status          = ArchSetupExceptionStack (mBuffer, &LocalBufferSize);
    ASSERT_EFI_ERROR (Status);
    return Status;
  } else {
    return ArchSetupExceptionStack (Buffer, BufferSize);
  }
}