summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/Csm/LegacyBiosDxe/LegacySio.c
diff options
context:
space:
mode:
Diffstat (limited to 'OvmfPkg/Csm/LegacyBiosDxe/LegacySio.c')
-rw-r--r--OvmfPkg/Csm/LegacyBiosDxe/LegacySio.c308
1 files changed, 160 insertions, 148 deletions
diff --git a/OvmfPkg/Csm/LegacyBiosDxe/LegacySio.c b/OvmfPkg/Csm/LegacyBiosDxe/LegacySio.c
index 6b9bb5ed8b..0cb48fa8ab 100644
--- a/OvmfPkg/Csm/LegacyBiosDxe/LegacySio.c
+++ b/OvmfPkg/Csm/LegacyBiosDxe/LegacySio.c
@@ -21,32 +21,32 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
EFI_STATUS
LegacyBiosBuildSioDataFromSio (
- IN DEVICE_PRODUCER_DATA_HEADER *SioPtr
+ IN DEVICE_PRODUCER_DATA_HEADER *SioPtr
)
{
- EFI_STATUS Status;
- DEVICE_PRODUCER_SERIAL *SioSerial;
- DEVICE_PRODUCER_PARALLEL *SioParallel;
- DEVICE_PRODUCER_FLOPPY *SioFloppy;
- UINTN HandleCount;
- EFI_HANDLE *HandleBuffer;
- UINTN Index;
- UINTN ChildIndex;
- EFI_SIO_PROTOCOL *Sio;
- ACPI_RESOURCE_HEADER_PTR Resources;
- EFI_ACPI_IO_PORT_DESCRIPTOR *IoResource;
- EFI_ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR *FixedIoResource;
- EFI_ACPI_DMA_DESCRIPTOR *DmaResource;
- EFI_ACPI_IRQ_NOFLAG_DESCRIPTOR *IrqResource;
- UINT16 Address;
- UINT8 Dma;
- UINT8 Irq;
- UINTN EntryCount;
- EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;
- EFI_BLOCK_IO_PROTOCOL *BlockIo;
- EFI_SERIAL_IO_PROTOCOL *SerialIo;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- ACPI_HID_DEVICE_PATH *Acpi;
+ EFI_STATUS Status;
+ DEVICE_PRODUCER_SERIAL *SioSerial;
+ DEVICE_PRODUCER_PARALLEL *SioParallel;
+ DEVICE_PRODUCER_FLOPPY *SioFloppy;
+ UINTN HandleCount;
+ EFI_HANDLE *HandleBuffer;
+ UINTN Index;
+ UINTN ChildIndex;
+ EFI_SIO_PROTOCOL *Sio;
+ ACPI_RESOURCE_HEADER_PTR Resources;
+ EFI_ACPI_IO_PORT_DESCRIPTOR *IoResource;
+ EFI_ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR *FixedIoResource;
+ EFI_ACPI_DMA_DESCRIPTOR *DmaResource;
+ EFI_ACPI_IRQ_NOFLAG_DESCRIPTOR *IrqResource;
+ UINT16 Address;
+ UINT8 Dma;
+ UINT8 Irq;
+ UINTN EntryCount;
+ EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;
+ EFI_BLOCK_IO_PROTOCOL *BlockIo;
+ EFI_SERIAL_IO_PROTOCOL *SerialIo;
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;
+ ACPI_HID_DEVICE_PATH *Acpi;
//
// Get the list of ISA controllers in the system
@@ -61,11 +61,12 @@ LegacyBiosBuildSioDataFromSio (
if (EFI_ERROR (Status)) {
return EFI_NOT_FOUND;
}
+
//
// Collect legacy information from each of the ISA controllers in the system
//
for (Index = 0; Index < HandleCount; Index++) {
- Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiSioProtocolGuid, (VOID **) &Sio);
+ Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiSioProtocolGuid, (VOID **)&Sio);
if (EFI_ERROR (Status)) {
continue;
}
@@ -73,46 +74,46 @@ LegacyBiosBuildSioDataFromSio (
Address = MAX_UINT16;
Dma = MAX_UINT8;
Irq = MAX_UINT8;
- Status = Sio->GetResources (Sio, &Resources);
+ Status = Sio->GetResources (Sio, &Resources);
if (!EFI_ERROR (Status)) {
//
// Get the base address information from ACPI resource descriptor.
//
while (Resources.SmallHeader->Byte != ACPI_END_TAG_DESCRIPTOR) {
switch (Resources.SmallHeader->Byte) {
- case ACPI_IO_PORT_DESCRIPTOR:
- IoResource = (EFI_ACPI_IO_PORT_DESCRIPTOR *) Resources.SmallHeader;
- Address = IoResource->BaseAddressMin;
- break;
-
- case ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR:
- FixedIoResource = (EFI_ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR *) Resources.SmallHeader;
- Address = FixedIoResource->BaseAddress;
- break;
-
- case ACPI_DMA_DESCRIPTOR:
- DmaResource = (EFI_ACPI_DMA_DESCRIPTOR *) Resources.SmallHeader;
- Dma = (UINT8) LowBitSet32 (DmaResource->ChannelMask);
- break;
-
- case ACPI_IRQ_DESCRIPTOR:
- case ACPI_IRQ_NOFLAG_DESCRIPTOR:
- IrqResource = (EFI_ACPI_IRQ_NOFLAG_DESCRIPTOR *) Resources.SmallHeader;
- Irq = (UINT8) LowBitSet32 (IrqResource->Mask);
- break;
-
- default:
- break;
+ case ACPI_IO_PORT_DESCRIPTOR:
+ IoResource = (EFI_ACPI_IO_PORT_DESCRIPTOR *)Resources.SmallHeader;
+ Address = IoResource->BaseAddressMin;
+ break;
+
+ case ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR:
+ FixedIoResource = (EFI_ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR *)Resources.SmallHeader;
+ Address = FixedIoResource->BaseAddress;
+ break;
+
+ case ACPI_DMA_DESCRIPTOR:
+ DmaResource = (EFI_ACPI_DMA_DESCRIPTOR *)Resources.SmallHeader;
+ Dma = (UINT8)LowBitSet32 (DmaResource->ChannelMask);
+ break;
+
+ case ACPI_IRQ_DESCRIPTOR:
+ case ACPI_IRQ_NOFLAG_DESCRIPTOR:
+ IrqResource = (EFI_ACPI_IRQ_NOFLAG_DESCRIPTOR *)Resources.SmallHeader;
+ Irq = (UINT8)LowBitSet32 (IrqResource->Mask);
+ break;
+
+ default:
+ break;
}
if (Resources.SmallHeader->Bits.Type == 0) {
- Resources.SmallHeader = (ACPI_SMALL_RESOURCE_HEADER *) ((UINT8 *) Resources.SmallHeader
- + Resources.SmallHeader->Bits.Length
- + sizeof (*Resources.SmallHeader));
+ Resources.SmallHeader = (ACPI_SMALL_RESOURCE_HEADER *)((UINT8 *)Resources.SmallHeader
+ + Resources.SmallHeader->Bits.Length
+ + sizeof (*Resources.SmallHeader));
} else {
- Resources.LargeHeader = (ACPI_LARGE_RESOURCE_HEADER *) ((UINT8 *) Resources.LargeHeader
- + Resources.LargeHeader->Length
- + sizeof (*Resources.LargeHeader));
+ Resources.LargeHeader = (ACPI_LARGE_RESOURCE_HEADER *)((UINT8 *)Resources.LargeHeader
+ + Resources.LargeHeader->Length
+ + sizeof (*Resources.LargeHeader));
}
}
}
@@ -126,13 +127,14 @@ LegacyBiosBuildSioDataFromSio (
Acpi = NULL;
while (!IsDevicePathEnd (DevicePath)) {
- Acpi = (ACPI_HID_DEVICE_PATH *) DevicePath;
+ Acpi = (ACPI_HID_DEVICE_PATH *)DevicePath;
DevicePath = NextDevicePathNode (DevicePath);
}
if ((Acpi == NULL) || (DevicePathType (Acpi) != ACPI_DEVICE_PATH) ||
((DevicePathSubType (Acpi) != ACPI_DP) && (DevicePathSubType (Acpi) != ACPI_EXTENDED_DP))
- ) {
+ )
+ {
continue;
}
@@ -141,9 +143,8 @@ LegacyBiosBuildSioDataFromSio (
//
// Ignore DMA resource since it is always returned NULL
//
- if (Acpi->HID == EISA_PNP_ID (0x500) || Acpi->HID == EISA_PNP_ID (0x501)) {
-
- if (Acpi->UID < 4 && Address != MAX_UINT16 && Irq != MAX_UINT8) {
+ if ((Acpi->HID == EISA_PNP_ID (0x500)) || (Acpi->HID == EISA_PNP_ID (0x501))) {
+ if ((Acpi->UID < 4) && (Address != MAX_UINT16) && (Irq != MAX_UINT8)) {
//
// Get the handle of the child device that has opened the Super I/O Protocol
//
@@ -156,14 +157,15 @@ LegacyBiosBuildSioDataFromSio (
if (EFI_ERROR (Status)) {
continue;
}
+
for (ChildIndex = 0; ChildIndex < EntryCount; ChildIndex++) {
if ((OpenInfoBuffer[ChildIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
- Status = gBS->HandleProtocol (OpenInfoBuffer[ChildIndex].ControllerHandle, &gEfiSerialIoProtocolGuid, (VOID **) &SerialIo);
+ Status = gBS->HandleProtocol (OpenInfoBuffer[ChildIndex].ControllerHandle, &gEfiSerialIoProtocolGuid, (VOID **)&SerialIo);
if (!EFI_ERROR (Status)) {
- SioSerial = &SioPtr->Serial[Acpi->UID];
- SioSerial->Address = Address;
- SioSerial->Irq = Irq;
- SioSerial->Mode = DEVICE_SERIAL_MODE_NORMAL | DEVICE_SERIAL_MODE_DUPLEX_HALF;
+ SioSerial = &SioPtr->Serial[Acpi->UID];
+ SioSerial->Address = Address;
+ SioSerial->Irq = Irq;
+ SioSerial->Mode = DEVICE_SERIAL_MODE_NORMAL | DEVICE_SERIAL_MODE_DUPLEX_HALF;
break;
}
}
@@ -172,36 +174,39 @@ LegacyBiosBuildSioDataFromSio (
FreePool (OpenInfoBuffer);
}
}
+
//
// See if this is an ISA parallel port
//
// Ignore DMA resource since it is always returned NULL, port
// only used in output mode.
//
- if (Acpi->HID == EISA_PNP_ID (0x400) || Acpi->HID == EISA_PNP_ID (0x401)) {
- if (Acpi->UID < 3 && Address != MAX_UINT16 && Irq != MAX_UINT8 && Dma != MAX_UINT8) {
- SioParallel = &SioPtr->Parallel[Acpi->UID];
- SioParallel->Address = Address;
- SioParallel->Irq = Irq;
- SioParallel->Dma = Dma;
- SioParallel->Mode = DEVICE_PARALLEL_MODE_MODE_OUTPUT_ONLY;
+ if ((Acpi->HID == EISA_PNP_ID (0x400)) || (Acpi->HID == EISA_PNP_ID (0x401))) {
+ if ((Acpi->UID < 3) && (Address != MAX_UINT16) && (Irq != MAX_UINT8) && (Dma != MAX_UINT8)) {
+ SioParallel = &SioPtr->Parallel[Acpi->UID];
+ SioParallel->Address = Address;
+ SioParallel->Irq = Irq;
+ SioParallel->Dma = Dma;
+ SioParallel->Mode = DEVICE_PARALLEL_MODE_MODE_OUTPUT_ONLY;
}
}
+
//
// See if this is an ISA floppy controller
//
if (Acpi->HID == EISA_PNP_ID (0x604)) {
- if (Address != MAX_UINT16 && Irq != MAX_UINT8 && Dma != MAX_UINT8) {
- Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiBlockIoProtocolGuid, (VOID **) &BlockIo);
+ if ((Address != MAX_UINT16) && (Irq != MAX_UINT8) && (Dma != MAX_UINT8)) {
+ Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiBlockIoProtocolGuid, (VOID **)&BlockIo);
if (!EFI_ERROR (Status)) {
- SioFloppy = &SioPtr->Floppy;
- SioFloppy->Address = Address;
- SioFloppy->Irq = Irq;
- SioFloppy->Dma = Dma;
+ SioFloppy = &SioPtr->Floppy;
+ SioFloppy->Address = Address;
+ SioFloppy->Irq = Irq;
+ SioFloppy->Dma = Dma;
SioFloppy->NumberOfFloppy++;
}
}
}
+
//
// See if this is a mouse
// Always set mouse found so USB hot plug will work
@@ -225,7 +230,6 @@ LegacyBiosBuildSioDataFromSio (
FreePool (HandleBuffer);
return EFI_SUCCESS;
-
}
/**
@@ -239,27 +243,27 @@ LegacyBiosBuildSioDataFromSio (
**/
EFI_STATUS
LegacyBiosBuildSioDataFromIsaIo (
- IN DEVICE_PRODUCER_DATA_HEADER *SioPtr
+ IN DEVICE_PRODUCER_DATA_HEADER *SioPtr
)
{
- EFI_STATUS Status;
- DEVICE_PRODUCER_SERIAL *SioSerial;
- DEVICE_PRODUCER_PARALLEL *SioParallel;
- DEVICE_PRODUCER_FLOPPY *SioFloppy;
- UINTN HandleCount;
- EFI_HANDLE *HandleBuffer;
- UINTN Index;
- UINTN ResourceIndex;
- UINTN ChildIndex;
- EFI_ISA_IO_PROTOCOL *IsaIo;
- EFI_ISA_ACPI_RESOURCE_LIST *ResourceList;
- EFI_ISA_ACPI_RESOURCE *IoResource;
- EFI_ISA_ACPI_RESOURCE *DmaResource;
- EFI_ISA_ACPI_RESOURCE *InterruptResource;
- UINTN EntryCount;
- EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;
- EFI_BLOCK_IO_PROTOCOL *BlockIo;
- EFI_SERIAL_IO_PROTOCOL *SerialIo;
+ EFI_STATUS Status;
+ DEVICE_PRODUCER_SERIAL *SioSerial;
+ DEVICE_PRODUCER_PARALLEL *SioParallel;
+ DEVICE_PRODUCER_FLOPPY *SioFloppy;
+ UINTN HandleCount;
+ EFI_HANDLE *HandleBuffer;
+ UINTN Index;
+ UINTN ResourceIndex;
+ UINTN ChildIndex;
+ EFI_ISA_IO_PROTOCOL *IsaIo;
+ EFI_ISA_ACPI_RESOURCE_LIST *ResourceList;
+ EFI_ISA_ACPI_RESOURCE *IoResource;
+ EFI_ISA_ACPI_RESOURCE *DmaResource;
+ EFI_ISA_ACPI_RESOURCE *InterruptResource;
+ UINTN EntryCount;
+ EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;
+ EFI_BLOCK_IO_PROTOCOL *BlockIo;
+ EFI_SERIAL_IO_PROTOCOL *SerialIo;
//
// Get the list of ISA controllers in the system
@@ -274,12 +278,12 @@ LegacyBiosBuildSioDataFromIsaIo (
if (EFI_ERROR (Status)) {
return EFI_NOT_FOUND;
}
+
//
// Collect legacy information from each of the ISA controllers in the system
//
for (Index = 0; Index < HandleCount; Index++) {
-
- Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiIsaIoProtocolGuid, (VOID **) &IsaIo);
+ Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiIsaIoProtocolGuid, (VOID **)&IsaIo);
if (EFI_ERROR (Status)) {
continue;
}
@@ -289,6 +293,7 @@ LegacyBiosBuildSioDataFromIsaIo (
if (ResourceList == NULL) {
continue;
}
+
//
// Collect the resource types neededto fill in the SIO data structure
//
@@ -298,38 +303,40 @@ LegacyBiosBuildSioDataFromIsaIo (
for (ResourceIndex = 0;
ResourceList->ResourceItem[ResourceIndex].Type != EfiIsaAcpiResourceEndOfList;
ResourceIndex++
- ) {
+ )
+ {
switch (ResourceList->ResourceItem[ResourceIndex].Type) {
- case EfiIsaAcpiResourceIo:
- IoResource = &ResourceList->ResourceItem[ResourceIndex];
- break;
+ case EfiIsaAcpiResourceIo:
+ IoResource = &ResourceList->ResourceItem[ResourceIndex];
+ break;
- case EfiIsaAcpiResourceMemory:
- break;
+ case EfiIsaAcpiResourceMemory:
+ break;
- case EfiIsaAcpiResourceDma:
- DmaResource = &ResourceList->ResourceItem[ResourceIndex];
- break;
+ case EfiIsaAcpiResourceDma:
+ DmaResource = &ResourceList->ResourceItem[ResourceIndex];
+ break;
- case EfiIsaAcpiResourceInterrupt:
- InterruptResource = &ResourceList->ResourceItem[ResourceIndex];
- break;
+ case EfiIsaAcpiResourceInterrupt:
+ InterruptResource = &ResourceList->ResourceItem[ResourceIndex];
+ break;
- default:
- break;
+ default:
+ break;
}
}
+
//
// See if this is an ISA serial port
//
// Ignore DMA resource since it is always returned NULL
//
- if (ResourceList->Device.HID == EISA_PNP_ID (0x500) || ResourceList->Device.HID == EISA_PNP_ID (0x501)) {
-
- if (ResourceList->Device.UID <= 3 &&
- IoResource != NULL &&
- InterruptResource != NULL
- ) {
+ if ((ResourceList->Device.HID == EISA_PNP_ID (0x500)) || (ResourceList->Device.HID == EISA_PNP_ID (0x501))) {
+ if ((ResourceList->Device.UID <= 3) &&
+ (IoResource != NULL) &&
+ (InterruptResource != NULL)
+ )
+ {
//
// Get the handle of the child device that has opened the ISA I/O Protocol
//
@@ -342,17 +349,18 @@ LegacyBiosBuildSioDataFromIsaIo (
if (EFI_ERROR (Status)) {
continue;
}
+
//
// We want resource for legacy even if no 32-bit driver installed
//
for (ChildIndex = 0; ChildIndex < EntryCount; ChildIndex++) {
if ((OpenInfoBuffer[ChildIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
- Status = gBS->HandleProtocol (OpenInfoBuffer[ChildIndex].ControllerHandle, &gEfiSerialIoProtocolGuid, (VOID **) &SerialIo);
+ Status = gBS->HandleProtocol (OpenInfoBuffer[ChildIndex].ControllerHandle, &gEfiSerialIoProtocolGuid, (VOID **)&SerialIo);
if (!EFI_ERROR (Status)) {
- SioSerial = &SioPtr->Serial[ResourceList->Device.UID];
- SioSerial->Address = (UINT16) IoResource->StartRange;
- SioSerial->Irq = (UINT8) InterruptResource->StartRange;
- SioSerial->Mode = DEVICE_SERIAL_MODE_NORMAL | DEVICE_SERIAL_MODE_DUPLEX_HALF;
+ SioSerial = &SioPtr->Serial[ResourceList->Device.UID];
+ SioSerial->Address = (UINT16)IoResource->StartRange;
+ SioSerial->Irq = (UINT8)InterruptResource->StartRange;
+ SioSerial->Mode = DEVICE_SERIAL_MODE_NORMAL | DEVICE_SERIAL_MODE_DUPLEX_HALF;
break;
}
}
@@ -361,40 +369,44 @@ LegacyBiosBuildSioDataFromIsaIo (
FreePool (OpenInfoBuffer);
}
}
+
//
// See if this is an ISA parallel port
//
// Ignore DMA resource since it is always returned NULL, port
// only used in output mode.
//
- if (ResourceList->Device.HID == EISA_PNP_ID (0x400) || ResourceList->Device.HID == EISA_PNP_ID (0x401)) {
- if (ResourceList->Device.UID <= 2 &&
- IoResource != NULL &&
- InterruptResource != NULL &&
- DmaResource != NULL
- ) {
- SioParallel = &SioPtr->Parallel[ResourceList->Device.UID];
- SioParallel->Address = (UINT16) IoResource->StartRange;
- SioParallel->Irq = (UINT8) InterruptResource->StartRange;
- SioParallel->Dma = (UINT8) DmaResource->StartRange;
- SioParallel->Mode = DEVICE_PARALLEL_MODE_MODE_OUTPUT_ONLY;
+ if ((ResourceList->Device.HID == EISA_PNP_ID (0x400)) || (ResourceList->Device.HID == EISA_PNP_ID (0x401))) {
+ if ((ResourceList->Device.UID <= 2) &&
+ (IoResource != NULL) &&
+ (InterruptResource != NULL) &&
+ (DmaResource != NULL)
+ )
+ {
+ SioParallel = &SioPtr->Parallel[ResourceList->Device.UID];
+ SioParallel->Address = (UINT16)IoResource->StartRange;
+ SioParallel->Irq = (UINT8)InterruptResource->StartRange;
+ SioParallel->Dma = (UINT8)DmaResource->StartRange;
+ SioParallel->Mode = DEVICE_PARALLEL_MODE_MODE_OUTPUT_ONLY;
}
}
+
//
// See if this is an ISA floppy controller
//
if (ResourceList->Device.HID == EISA_PNP_ID (0x604)) {
- if (IoResource != NULL && InterruptResource != NULL && DmaResource != NULL) {
- Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiBlockIoProtocolGuid, (VOID **) &BlockIo);
+ if ((IoResource != NULL) && (InterruptResource != NULL) && (DmaResource != NULL)) {
+ Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiBlockIoProtocolGuid, (VOID **)&BlockIo);
if (!EFI_ERROR (Status)) {
- SioFloppy = &SioPtr->Floppy;
- SioFloppy->Address = (UINT16) IoResource->StartRange;
- SioFloppy->Irq = (UINT8) InterruptResource->StartRange;
- SioFloppy->Dma = (UINT8) DmaResource->StartRange;
+ SioFloppy = &SioPtr->Floppy;
+ SioFloppy->Address = (UINT16)IoResource->StartRange;
+ SioFloppy->Irq = (UINT8)InterruptResource->StartRange;
+ SioFloppy->Dma = (UINT8)DmaResource->StartRange;
SioFloppy->NumberOfFloppy++;
}
}
}
+
//
// See if this is a mouse
// Always set mouse found so USB hot plug will work
@@ -430,14 +442,14 @@ LegacyBiosBuildSioDataFromIsaIo (
**/
EFI_STATUS
LegacyBiosBuildSioData (
- IN LEGACY_BIOS_INSTANCE *Private
+ IN LEGACY_BIOS_INSTANCE *Private
)
{
- EFI_STATUS Status;
- DEVICE_PRODUCER_DATA_HEADER *SioPtr;
- EFI_HANDLE IsaBusController;
- UINTN HandleCount;
- EFI_HANDLE *HandleBuffer;
+ EFI_STATUS Status;
+ DEVICE_PRODUCER_DATA_HEADER *SioPtr;
+ EFI_HANDLE IsaBusController;
+ UINTN HandleCount;
+ EFI_HANDLE *HandleBuffer;
//
// Get the pointer to the SIO data structure