]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkUnixPkg/Sec/SecMain.c
Remove some unnecessary #if/#ifdef from some header files.
[mirror_edk2.git] / EdkUnixPkg / Sec / SecMain.c
index 32793f7c645e8644c7c03b10fb605a3305c507d9..04df255277a12a7765296f7d76ee1d00ef5b43c0 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation\r
+Copyright (c) 2006 - 2007 Intel Corporation.\r
 All rights reserved. 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
@@ -14,10 +14,10 @@ Module Name:
   SecMain.c\r
 \r
 Abstract:\r
-  WinNt emulator of SEC phase. It's really a Win32 application, but this is\r
-  Ok since all the other modules for NT32 are NOT Win32 applications.\r
+  WinNt emulator of SEC phase. It's really a Posix application, but this is\r
+  Ok since all the other modules for NT32 are NOT Posix applications.\r
 \r
-  This program processes Windows environment variables and figures out\r
+  This program processes host environment variables and figures out\r
   what the memory layout will be, how may FD's will be loaded and also\r
   what the boot mode is.\r
 \r
@@ -25,9 +25,9 @@ Abstract:
   is a list of PPI's produced by the SEC that are availble for usage in PEI.\r
 \r
   This code produces 128 K of temporary memory for the PEI stack by opening a\r
-  Windows file and mapping it directly to memory addresses.\r
+  host file and mapping it directly to memory addresses.\r
 \r
-  The system.cmd script is used to set windows environment variables that drive\r
+  The system.cmd script is used to set host environment variables that drive\r
   the configuration opitons of the SEC.\r
 \r
 --*/\r
@@ -103,7 +103,7 @@ EFI_PEI_PPI_DESCRIPTOR  gPrivateDispatchTable[] = {
 //\r
 // Default information about where the FD is located.\r
 //  This array gets filled in with information from EFI_FIRMWARE_VOLUMES\r
-//  EFI_FIRMWARE_VOLUMES is a Windows environment variable set by system.cmd.\r
+//  EFI_FIRMWARE_VOLUMES is a host environment variable set by system.cmd.\r
 //  The number of array elements is allocated base on parsing\r
 //  EFI_FIRMWARE_VOLUMES and the memory is never freed.\r
 //\r
@@ -147,7 +147,7 @@ main (
 /*++\r
 \r
 Routine Description:\r
-  Main entry point to SEC for WinNt. This is a Windows program\r
+  Main entry point to SEC for WinNt. This is a unix program\r
 \r
 Arguments:\r
   Argc - Number of command line arguments\r
@@ -173,10 +173,13 @@ Returns:
   CHAR16                *MemorySizeStr;\r
   CHAR16                *FirmwareVolumesStr;\r
 \r
+  setbuf(stdout, 0);\r
+  setbuf(stderr, 0);\r
+\r
   MemorySizeStr      = (CHAR16 *)PcdGetPtr (PcdUnixMemorySizeForSecMain);\r
   FirmwareVolumesStr = (CHAR16 *)PcdGetPtr (PcdUnixFirmwareVolume);\r
 \r
-  printf ("\nEDK SEC Main NT Emulation Environment from www.TianoCore.org\n");\r
+  printf ("\nEDK SEC Main UNIX Emulation Environment from www.TianoCore.org\n");\r
 \r
   //\r
   // Allocate space for gSystemMemory Array\r
@@ -313,10 +316,10 @@ MapMemory (
   INTN   prot,
   INTN   flags)
 {
-  STATIC UINTN base = 0x40000000;
-  CONST UINTN align = (1 << 24);
-  VOID *res;
-  BOOLEAN isAligned = 0;
+  STATIC UINTN base  = 0x40000000;
+  CONST UINTN  align = (1 << 24);
+  VOID         *res  = NULL;
+  BOOLEAN      isAligned = 0;
 
   //
   // Try to get an aligned block somewhere in the address space of this
@@ -485,7 +488,7 @@ Routine Description:
   This routine produces the ReportStatusCode PEI service. It's passed\r
   up to the PEI Core via a PPI. T\r
 \r
-  This code currently uses the NT clib printf. This does not work the same way\r
+  This code currently uses the UNIX clib printf. This does not work the same way\r
   as the EFI Print (), as %t, %g, %s as Unicode are not supported.\r
 \r
 Arguments:\r
@@ -647,7 +650,7 @@ Routine Description:
   This service is called from Index == 0 until it returns EFI_UNSUPPORTED.\r
   It allows discontiguous memory regions to be supported by the emulator.\r
   It uses gSystemMemory[] and gSystemMemoryCount that were created by\r
-  parsing the Windows environment variable EFI_MEMORY_SIZE.\r
+  parsing the host environment variable EFI_MEMORY_SIZE.\r
   The size comes from the varaible and the address comes from the call to\r
   WinNtOpenFile.\r
 \r
@@ -689,7 +692,7 @@ SecWinNtWinNtThunkAddress (
 /*++\r
 \r
 Routine Description:\r
-  Since the SEC is the only Windows program in stack it must export\r
+  Since the SEC is the only Unix program in stack it must export\r
   an interface to do Win API calls. That's what the WinNtThunk address\r
   is for. gWinNt is initailized in WinNtThunk.c.\r
 \r
@@ -744,7 +747,7 @@ Returns:
     return Status;\r
   }\r
   //\r
-  // Allocate space in NT (not emulator) memory. Extra space is for alignment\r
+  // Allocate space in UNIX (not emulator) memory. Extra space is for alignment\r
   //\r
   ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) malloc ((UINTN) (ImageContext.ImageSize + (ImageContext.SectionAlignment * 2)));\r
   if (ImageContext.ImageAddress == 0) {\r
@@ -789,7 +792,7 @@ SecWinNtFdAddress (
 \r
 Routine Description:\r
   Return the FD Size and base address. Since the FD is loaded from a\r
-  file into Windows memory only the SEC will know it's address.\r
+  file into host memory only the SEC will know it's address.\r
 \r
 Arguments:\r
   Index  - Which FD, starts at zero.\r