summaryrefslogtreecommitdiff
path: root/Core/CORE_DXE/FwVolWrite.c
blob: 3822f1ef48888454e3ccdb2dc3aa0a5199dc5a8d (plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*++

Copyright (c) 2004 - 2007, Intel Corporation                                                         
All rights reserved. This program and the accompanying materials                          
are licensed and made available under the terms and conditions of the BSD License         
which accompanies this distribution.  The full text of the license may be found at        
http://opensource.org/licenses/bsd-license.php                                            
                                                                                          
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             

Module Name:

  FwVolWrite.c

Abstract:

  Implements write firmware file

--*/

#include "FwVolDriver.h"

#if (PI_SPECIFICATION_VERSION < 0x00010000)

EFI_STATUS
EFIAPI
FvWriteFile (
  IN EFI_FIRMWARE_VOLUME_PROTOCOL   *This,
  IN UINT32                         NumberOfFiles,
  IN EFI_FV_WRITE_POLICY            WritePolicy,
  IN EFI_FV_WRITE_FILE_DATA         *FileData
  )
/*++

    Routine Description:
      Writes one or more files to the firmware volume.

    Arguments:
    This            - Indicates the calling context.
    NumberOfFiles   - Number of files.
    WritePolicy     - WritePolicy indicates the level of reliability for
                      the write in the event of a power failure or other
                      system failure during the write operation.
    FileData        - FileData is an pointer to an array of EFI_FV_WRITE_DATA.
                      Each element of FileData[] represents a file to be written.

    Returns:
      EFI_SUCCESS                   - Files successfully written to firmware volume
      EFI_OUT_OF_RESOURCES          - Not enough buffer to be allocated.
      EFI_DEVICE_ERROR              - Device error.
      EFI_WRITE_PROTECTED           - Write protected.
      EFI_NOT_FOUND                 - Not found.
      EFI_INVALID_PARAMETER         - Invalid parameter.
      EFI_UNSUPPORTED               - This function not supported.

--*/
{ 
  return EFI_UNSUPPORTED;
}

#else

EFI_STATUS
EFIAPI
FvWriteFile (
  IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL    *This,
  IN UINT32                                 NumberOfFiles,
  IN EFI_FV_WRITE_POLICY                    WritePolicy,
  IN EFI_FV_WRITE_FILE_DATA                 *FileData
  )
/*++

    Routine Description:
      Writes one or more files to the firmware volume.

    Arguments:
    This            - Indicates the calling context.
    NumberOfFiles   - Number of files.
    WritePolicy     - WritePolicy indicates the level of reliability for
                      the write in the event of a power failure or other
                      system failure during the write operation.
    FileData        - FileData is an pointer to an array of EFI_FV_WRITE_DATA.
                      Each element of FileData[] represents a file to be written.

    Returns:
      EFI_SUCCESS                   - Files successfully written to firmware volume
      EFI_OUT_OF_RESOURCES          - Not enough buffer to be allocated.
      EFI_DEVICE_ERROR              - Device error.
      EFI_WRITE_PROTECTED           - Write protected.
      EFI_NOT_FOUND                 - Not found.
      EFI_INVALID_PARAMETER         - Invalid parameter.
      EFI_UNSUPPORTED               - This function not supported.

--*/
{ 
  return EFI_UNSUPPORTED;
}


#endif