]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/Misc.c
IntelFrameworkModulePkg: Clean up source files
[mirror_edk2.git] / IntelFrameworkModulePkg / Csm / BiosThunk / Snp16Dxe / Misc.c
index 243048c551cceea8bd927ef8a131f2fd7b117991..311918cbea8d24fd3592d1e9e6e9ebf054f6e861 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Helper Routines that use a PXE-enabled NIC option ROM.\r
\r
-Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR>\r
+\r
+Copyright (c) 1999 - 2018, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -39,7 +39,7 @@ UINT32 CachedVectorAddress[0x100];
  Cache Interrupt verctor address converted from IVT number.\r
 \r
  @param VectorNumber  IVT number\r
\r
+\r
  @retval EFI_SUCCESS Success to operation.\r
 **/\r
 EFI_STATUS\r
@@ -49,16 +49,16 @@ CacheVectorAddress (
 {\r
   UINT32  *Address;\r
 \r
-  Address                          = (UINT32 *)(UINTN) (IVT_BASE + VectorNumber * 4);\r
+  Address                          = (UINT32 *) ((UINTN) IVT_BASE + VectorNumber * 4);\r
   CachedVectorAddress[VectorNumber] = *Address;\r
   return EFI_SUCCESS;\r
 }\r
 \r
 /**\r
- Get interrupt vector address according to IVT number. \r
-  \r
+ Get interrupt vector address according to IVT number.\r
+\r
  @param VectorNumber    Given IVT number\r
\r
+\r
  @return cached interrupt vector address.\r
 **/\r
 EFI_STATUS\r
@@ -68,16 +68,16 @@ RestoreCachedVectorAddress (
 {\r
   UINT32  *Address;\r
 \r
-  Address  = (UINT32 *)(UINTN) (IVT_BASE + VectorNumber * 4);\r
+  Address  = (UINT32 *) ((UINTN) IVT_BASE + VectorNumber * 4);\r
   *Address = CachedVectorAddress[VectorNumber];\r
   return EFI_SUCCESS;\r
 }\r
 \r
 /**\r
- Print Undi loader table. \r
+ Print Undi loader table.\r
+\r
+ @param UndiLoaderStructure Point to Undi Loader table structure.\r
 \r
- @param UndiLoaderStructure Point to Undi Loader table structure. \r
\r
 **/\r
 VOID\r
 Print_Undi_Loader_Table (\r
@@ -108,12 +108,12 @@ Print_Undi_Loader_Table (
 /**\r
   Simple table dumper.  The ROMID table is necessary in order to effect\r
   the "Early UNDI" trick.  Herein, the UNDI layer can be loaded in the\r
-  pre-boot phase without having to download a Network Boot Program \r
+  pre-boot phase without having to download a Network Boot Program\r
   across the wire.  It is required in the implementation in that we\r
   are not using PXE.\r
 \r
   @param RomIDStructure Point to RomID structure.\r
\r
+\r
 **/\r
 VOID\r
 Print_ROMID_Table (\r
@@ -199,7 +199,7 @@ Print_ROMID_Table (
   Print PXE table.\r
 \r
   @param PxeTable Point to PXE table structure\r
-  \r
+\r
 **/\r
 VOID\r
 Print_PXE_Table (\r
@@ -351,7 +351,7 @@ Print_PXE_Table (
   Print PXENV table.\r
 \r
   @param PxenvTable Point to PXENV\r
-  \r
+\r
 **/\r
 VOID\r
 Print_PXENV_Table (\r
@@ -425,14 +425,14 @@ Print_PXENV_Table (
   If available, launch the BaseCode from a NIC option ROM.\r
   This should install the !PXE and PXENV+ structures in memory for\r
   subsequent use.\r
-  \r
+\r
 \r
   @param SimpleNetworkDevice    Simple network device instance\r
   @param RomAddress             The ROM base address for NIC rom.\r
-  \r
-  @retval EFI_NOT_FOUND         The check sum does not match \r
-  @retval EFI_NOT_FOUND         Rom ID offset is wrong \r
-  @retval EFI_NOT_FOUND         No Rom ID structure is found \r
+\r
+  @retval EFI_NOT_FOUND         The check sum does not match\r
+  @retval EFI_NOT_FOUND         Rom ID offset is wrong\r
+  @retval EFI_NOT_FOUND         No Rom ID structure is found\r
 **/\r
 EFI_STATUS\r
 LaunchBaseCode (\r
@@ -469,7 +469,7 @@ LaunchBaseCode (
 \r
   RomIdTableAddress = (UNDI_ROMID_T *) (RomAddress + OPTION_ROM_PTR->PxeRomIdOffset);\r
 \r
-  if ((UINTN) (OPTION_ROM_PTR->PxeRomIdOffset + RomIdTableAddress->StructLength) > RomLength) {\r
+  if (((UINT32)OPTION_ROM_PTR->PxeRomIdOffset + RomIdTableAddress->StructLength) > RomLength) {\r
     DEBUG ((DEBUG_ERROR, "ROM ID Offset Error\n\r"));\r
     return EFI_NOT_FOUND;\r
   }\r
@@ -754,10 +754,10 @@ LaunchBaseCode (
   Print_Undi_Loader_Table (UndiLoaderTable);\r
 \r
   DEBUG ((DEBUG_NET, "Display the PXENV+ and !PXE tables exported by NIC\n\r"));\r
-  Print_PXENV_Table ((VOID *)(UINTN)((UndiLoaderTable->PXENVptr.Segment << 4) | UndiLoaderTable->PXENVptr.Offset));\r
-  Print_PXE_Table ((VOID *)(UINTN)((UndiLoaderTable->PXEptr.Segment << 4) + UndiLoaderTable->PXEptr.Offset));\r
+  Print_PXENV_Table ((VOID *)(((UINTN)UndiLoaderTable->PXENVptr.Segment << 4) | UndiLoaderTable->PXENVptr.Offset));\r
+  Print_PXE_Table ((VOID *)(((UINTN)UndiLoaderTable->PXEptr.Segment << 4) + UndiLoaderTable->PXEptr.Offset));\r
 \r
-  Pxe = (PXE_T *)(UINTN)((UndiLoaderTable->PXEptr.Segment << 4) + UndiLoaderTable->PXEptr.Offset);\r
+  Pxe = (PXE_T *)(((UINTN)UndiLoaderTable->PXEptr.Segment << 4) + UndiLoaderTable->PXEptr.Offset);\r
   SimpleNetworkDevice->Nii.Id = (UINT64)(UINTN) Pxe;\r
 \r
   gBS->FreePool (Buffer);\r
@@ -819,14 +819,14 @@ LaunchBaseCode (
       push offset pxe_data_call_struct        ;is pushed onto stack.\r
       push Index                              ;UINT16 is pushed onto stack.\r
       call dword ptr (s_PXE ptr es:[di]).EntryPointSP\r
-      add sp, 6 ;Caller cleans up stack.  \r
+      add sp, 6 ;Caller cleans up stack.\r
 \r
   @param SimpleNetworkDevice    Device instance for simple network\r
   @param Table                 Point to parameter/retun value table for legacy far call\r
-  @param TableSize              The size of paramter/return value table\r
+  @param TableSize              The size of parameter/return value table\r
   @param CallIndex              The index of legacy call.\r
-  \r
-  @return EFI_STATUS \r
+\r
+  @return EFI_STATUS\r
 **/\r
 EFI_STATUS\r
 MakePxeCall (\r