]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmulatorPkg/Unix/Host/BlockIo.c
EmulatorPkg/Unix: Fix various typos
[mirror_edk2.git] / EmulatorPkg / Unix / Host / BlockIo.c
index 657ce34e4589a40e89381326621b28f68b26b80b..18368060d59a688f56beccff277ecd555dd2ca6d 100644 (file)
@@ -1,17 +1,11 @@
 /**@file\r
 \r
 Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
-#include "SecMain.h"\r
+#include "Host.h"\r
 \r
 #define EMU_BLOCK_IO_PRIVATE_SIGNATURE SIGNATURE_32 ('E', 'M', 'b', 'k')\r
 typedef struct {\r
@@ -347,7 +341,7 @@ EmuBlockIoReadWriteCommon (
   @param[in]       MediaId    Id of the media, changes every time the media is\r
                               replaced.\r
   @param[in]       Lba        The starting Logical Block Address to read from.\r
-  @param[in, out]  Token           A pointer to the token associated with the transaction.\r
+  @param[in, out]  Token      A pointer to the token associated with the transaction.\r
   @param[in]       BufferSize Size of Buffer, must be a multiple of device block size.\r
   @param[out]      Buffer     A pointer to the destination buffer for the data. The\r
                               caller is responsible for either having implicit or\r
@@ -404,7 +398,7 @@ EmuBlockIoReadBlocks (
 Done:\r
   if (Token != NULL) {\r
     if (Token->Event != NULL) {\r
-      // Caller is responcible for signaling EFI Event\r
+      // Caller is responsible for signaling EFI Event\r
       Token->TransactionStatus = Status;\r
       return EFI_SUCCESS;\r
     }\r
@@ -435,7 +429,7 @@ Done:
                                 the Event is NULL.\r
   @retval EFI_WRITE_PROTECTED   The device can not be written to.\r
   @retval EFI_NO_MEDIA          There is no media in the device.\r
-  @retval EFI_MEDIA_CHNAGED     The MediaId does not matched the current device.\r
+  @retval EFI_MEDIA_CHANGED     The MediaId does not match the current device.\r
   @retval EFI_DEVICE_ERROR      The device reported an error while performing the write.\r
   @retval EFI_BAD_BUFFER_SIZE   The Buffer was not a multiple of the block size of the device.\r
   @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid,\r
@@ -483,7 +477,7 @@ EmuBlockIoWriteBlocks (
 Done:\r
   if (Token != NULL) {\r
     if (Token->Event != NULL) {\r
-      // Caller is responcible for signaling EFI Event\r
+      // Caller is responsible for signaling EFI Event\r
       Token->TransactionStatus = Status;\r
       return EFI_SUCCESS;\r
     }\r
@@ -506,7 +500,7 @@ Done:
   @retval EFI_SUCCESS          The flush request was queued if Event is not NULL.\r
                                All outstanding data was written correctly to the\r
                                device if the Event is NULL.\r
-  @retval EFI_DEVICE_ERROR     The device reported an error while writting back\r
+  @retval EFI_DEVICE_ERROR     The device reported an error while writing back\r
                                the data.\r
   @retval EFI_WRITE_PROTECTED  The device cannot be written to.\r
   @retval EFI_NO_MEDIA         There is no media in the device.\r
@@ -535,7 +529,7 @@ EmuBlockIoFlushBlocks (
 \r
   if (Token != NULL) {\r
     if (Token->Event != NULL) {\r
-      // Caller is responcible for signaling EFI Event\r
+      // Caller is responsible for signaling EFI Event\r
       Token->TransactionStatus = EFI_SUCCESS;\r
       return EFI_SUCCESS;\r
     }\r
@@ -550,7 +544,7 @@ EmuBlockIoFlushBlocks (
 \r
   @param[in]  This                 Indicates a pointer to the calling context.\r
   @param[in]  ExtendedVerification Indicates that the driver may perform a more\r
-                                   exhausive verfication operation of the device\r
+                                   exhaustive verification operation of the device\r
                                    during reset.\r
 \r
   @retval EFI_SUCCESS          The device was reset.\r
@@ -661,6 +655,8 @@ EmuBlockIoThunkOpen (
     }\r
   }\r
 \r
+  Private->Mode = Private->WriteProtected ? O_RDONLY : O_RDWR;\r
+\r
   This->Interface = &Private->EmuBlockIo;\r
   This->Private   = Private;\r
   return EFI_SUCCESS;\r