1 /** @file 2 Microcode flash device access library NULL instance. 3 4 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 13 **/ 14 15 #include <PiDxe.h> 16 17 #include <Library/BaseMemoryLib.h> 18 #include <Library/MicrocodeFlashAccessLib.h> 19 20 /** 21 Perform microcode write opreation. 22 23 @param[in] FlashAddress The address of flash device to be accessed. 24 @param[in] Buffer The pointer to the data buffer. 25 @param[in] Length The length of data buffer in bytes. 26 27 @retval EFI_SUCCESS The operation returns successfully. 28 @retval EFI_WRITE_PROTECTED The flash device is read only. 29 @retval EFI_UNSUPPORTED The flash device access is unsupported. 30 @retval EFI_INVALID_PARAMETER The input parameter is not valid. 31 **/ 32 EFI_STATUS 33 EFIAPI MicrocodeFlashWrite(IN EFI_PHYSICAL_ADDRESS FlashAddress,IN VOID * Buffer,IN UINTN Length)34MicrocodeFlashWrite ( 35 IN EFI_PHYSICAL_ADDRESS FlashAddress, 36 IN VOID *Buffer, 37 IN UINTN Length 38 ) 39 { 40 CopyMem((VOID *)(UINTN)(FlashAddress), Buffer, Length); 41 return EFI_SUCCESS; 42 } 43