hc
2024-03-25 edb30157bad0c0001c32b854271ace01d3b9a16a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/** @file
 
Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
 
**/
 
#include <Library/BoardInitLib.h>
#include <Library/MultiBoardInitSupportLib.h>
#include <Library/PcdLib.h>
#include <Library/DebugLib.h>
#include <Library/UefiBootServicesTableLib.h>
 
/**
  Registers the given set of board functions for callback to perform board initialization tasks.
 
  When this function is called, the given structure of function pointers are stored for future invocation. When
  board initialization tasks are required, the corresponding functions in this structure will be called.
 
  @param[in]    BoardNotificationInit   A pointer to a structure of function pointers described in the type
                                        BOARD_NOTIFICATION_INIT_FUNC.
 
  @retval       EFI_SUCCESS             The board notification functions were successfully registered.
  @retval       EFI_INVALID_PARAMETER   The pointer given is NULL.
  @retval       EFI_OUT_OF_RESOURCES    Insufficient memory resources exist to register the callback functions.
 
**/
EFI_STATUS
EFIAPI
RegisterBoardNotificationInit (
  IN BOARD_NOTIFICATION_INIT_FUNC  *BoardNotificationInit
  )
{
  EFI_HANDLE  Handle;
  EFI_STATUS  Status;
 
  if (BoardNotificationInit == NULL) {
    return EFI_INVALID_PARAMETER;
  }
 
  Handle = NULL;
  Status = gBS->InstallProtocolInterface (
                  &Handle,
                  &gBoardNotificationInitGuid,
                  EFI_NATIVE_INTERFACE,
                  BoardNotificationInit
                  );
  ASSERT_EFI_ERROR (Status);
 
  return Status;
}