]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkUnixPkg/Dxe/UnixThunk/Bus/UnixBusDriver/UnixBusDriver.c
Add emulated serialIo device driver for EdkUnixPkg
[mirror_edk2.git] / EdkUnixPkg / Dxe / UnixThunk / Bus / UnixBusDriver / UnixBusDriver.c
index 038c71a074ba5fbbbf4bf0333808b5be69ccee57..b8611f66d2b0f7790e5ac38e3e435cca89af853f 100644 (file)
@@ -15,9 +15,9 @@ Module Name:
 \r
 Abstract:\r
 \r
-This following section documents the envirnoment variables for the Win NT \r
+This following section documents the envirnoment variables for the Win UNIX \r
 build.  These variables are used to define the (virtual) hardware \r
-configuration of the NT environment\r
+configuration of the UNIX environment\r
 \r
 A ! can be used to seperate multiple instances in a variable. Each \r
 instance represents a seperate hardware device. \r
@@ -35,7 +35,7 @@ EFI_UNIX_UGA            - Builds UGA Windows of Width and Height
  <block count> - Decimal number of blocks a device supports.\r
  <block size>  - Decimal number of bytes per block.\r
 \r
NT envirnonment variable contents. '<' and '>' are not part of the variable, \r
UNIX envirnonment variable contents. '<' and '>' are not part of the variable, \r
  they are just used to make this help more readable. There should be no \r
  spaces between the ';'. Extra spaces will break the variable. A '!' is  \r
  used to seperate multiple devices in a variable.\r
@@ -55,7 +55,7 @@ EFI_UNIX_UGA            - Builds UGA Windows of Width and Height
    A 1.44MB emulated floppy with a block size of 1024 would look like:\r
    EFI_UNIX_VIRTUAL_DISKS=RW;1440;1024\r
 \r
- Physical Disks: These devices use NT to open a real device in your system\r
+ Physical Disks: These devices use UNIX to open a real device in your system\r
 \r
    Thus a 120 MB floppy would look like:\r
    EFI_UNIX_PHYSICAL_DISKS=B:RW;245760;512\r
@@ -97,7 +97,7 @@ EFI_UNIX_UGA            - Builds UGA Windows of Width and Height
 // Define GUID for the Unix Bus Driver\r
 //\r
 static EFI_GUID gUnixBusDriverGuid = {\r
-  0x419f582, 0x625, 0x4531, 0x8a, 0x33, 0x85, 0xa9, 0x96, 0x5c, 0x95, 0xbc\r
+  0x419f582, 0x625, 0x4531, {0x8a, 0x33, 0x85, 0xa9, 0x96, 0x5c, 0x95, 0xbc}\r
 };\r
 \r
 //\r
@@ -107,7 +107,7 @@ EFI_DRIVER_BINDING_PROTOCOL           gUnixBusDriverBinding = {
   UnixBusDriverBindingSupported,\r
   UnixBusDriverBindingStart,\r
   UnixBusDriverBindingStop,\r
-  0x10,\r
+  0xa,\r
   NULL,\r
   NULL\r
 };\r
@@ -115,13 +115,14 @@ EFI_DRIVER_BINDING_PROTOCOL           gUnixBusDriverBinding = {
 #define UNIX_PCD_ARRAY_SIZE (sizeof(mPcdEnvironment)/sizeof(UNIX_PCD_ENTRY))\r
 \r
 //\r
-// Table to map NT Environment variable to the GUID that should be in\r
+// Table to map UNIX Environment variable to the GUID that should be in\r
 // device path.\r
 //\r
 static UNIX_PCD_ENTRY  mPcdEnvironment[] = {\r
   {PcdToken(PcdUnixConsole),       &gEfiUnixConsoleGuid},\r
   {PcdToken(PcdUnixUga),           &gEfiUnixUgaGuid},\r
   {PcdToken(PcdUnixFileSystem),    &gEfiUnixFileSystemGuid},\r
+  {PcdToken(PcdUnixSerialPort),    &gEfiUnixSerialPortGuid},\r
   {PcdToken(PcdUnixVirtualDisk),   &gEfiUnixVirtualDisksGuid},\r
   {PcdToken(PcdUnixPhysicalDisk),  &gEfiUnixPhysicalDisksGuid},\r
   {PcdToken(PcdUnixCpuModel),      &gEfiUnixCPUModelGuid},\r
@@ -293,10 +294,10 @@ Returns:
 {\r
   EFI_STATUS                      Status;\r
   EFI_STATUS                      InstallStatus;\r
-  EFI_UNIX_THUNK_PROTOCOL       *UnixThunk;\r
+  EFI_UNIX_THUNK_PROTOCOL         *UnixThunk;\r
   EFI_DEVICE_PATH_PROTOCOL        *ParentDevicePath;\r
-  UNIX_BUS_DEVICE               *UnixBusDevice;\r
-  UNIX_IO_DEVICE                *UnixDevice;\r
+  UNIX_BUS_DEVICE                 *UnixBusDevice;\r
+  UNIX_IO_DEVICE                  *UnixDevice;\r
   UINTN                           Index;\r
   CHAR16                          *StartString;\r
   CHAR16                          *SubString;\r
@@ -428,7 +429,6 @@ Returns:
       }\r
 \r
       if (CreateDevice) {\r
-\r
         //\r
         // Allocate instance structure, and fill in parent information.\r
         //\r
@@ -441,7 +441,7 @@ Returns:
         UnixDevice->ControllerHandle   = ControllerHandle;\r
         UnixDevice->ParentDevicePath   = ParentDevicePath;\r
 \r
-        UnixDevice->UnixIo.UnixThunk = UnixThunk;\r
+        UnixDevice->UnixIo.UnixThunk   = UnixThunk;\r
 \r
         //\r
         // Plus 2 to account for the NULL at the end of the Unicode string\r
@@ -454,7 +454,7 @@ Returns:
 \r
         UnixDevice->ControllerNameTable = NULL;\r
 \r
-       //  FIXME: check size
+       //  FIXME: check size\r
         StrCpy(ComponentName, UnixDevice->UnixIo.EnvString);\r
 \r
         UnixDevice->DevicePath = UnixBusCreateDevicePath (\r