1. Fixed tools_def.template to meet ICC build for IA32

2. Modified some source files to meet ICC build for IA32 and IPF.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3271 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff 2007-07-17 01:48:09 +00:00
parent 0c1f1ad1e9
commit c52fa98ca9
40 changed files with 230 additions and 244 deletions

View File

@ -700,10 +700,10 @@ RELEASE_VS2005PRO_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4086 /OPT:REF
*_ICC_IA32_APP_FLAGS = /nologo /E /TC *_ICC_IA32_APP_FLAGS = /nologo /E /TC
*_ICC_IA32_PP_FLAGS = /nologo /E /TC /FI$(DEST_DIR_DEBUG)/AutoGen.h *_ICC_IA32_PP_FLAGS = /nologo /E /TC /FI$(DEST_DIR_DEBUG)/AutoGen.h
DEBUG_ICC_IA32_CC_FLAGS = /nologo /W4 /WX /Gy /c /D UNICODE /D EFI32 /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings /FI$(DEST_DIR_DEBUG)/AutoGen.h /EHs-c- /GF /Gs8192 /Fp$(DEST_DIR_OUTPUT)/AutoGen.h.gch /Yu$(DEST_DIR_DEBUG)/AutoGen.h /Zi /Gm DEBUG_ICC_IA32_CC_FLAGS = /nologo /W4 /WX /Gy /c /D UNICODE /D EFI32 /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings /FI$(DEST_DIR_DEBUG)/AutoGen.h /EHs-c- /GF /Gs8192 /Zi /Gm
RELEASE_ICC_IA32_CC_FLAGS = /nologo /W4 /WX /Gy /c /D UNICODE /D EFI32 /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings /FI$(DEST_DIR_DEBUG)/AutoGen.h /EHs-c- /GF /Gs8192 /Fp$(DEST_DIR_OUTPUT)/AutoGen.h.gch /Yu$(DEST_DIR_DEBUG)/AutoGen.h RELEASE_ICC_IA32_CC_FLAGS = /nologo /W4 /WX /Gy /c /D UNICODE /D EFI32 /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings /FI$(DEST_DIR_DEBUG)/AutoGen.h /EHs-c- /GF /Gs8192
DEBUG_ICC_IA32_PCH_FLAGS = /nologo /W4 /WX /Gy /c /D UNICODE /D EFI32 /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings /FI$(DEST_DIR_DEBUG)/AutoGen.h /EHs-c- /GF /Gs8192 /Fp$(DEST_DIR_OUTPUT)/AutoGen.h.gch /Yc /TC /Zi /Gm DEBUG_ICC_IA32_PCH_FLAGS = /nologo /W4 /WX /Gy /c /D UNICODE /D EFI32 /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings /FI$(DEST_DIR_DEBUG)/AutoGen.h /EHs-c- /GF /Gs8192 /Yc /TC /Zi /Gm
RELEASE_ICC_IA32_PCH_FLAGS = /nologo /W4 /WX /Gy /c /D UNICODE /D EFI32 /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings /FI$(DEST_DIR_DEBUG)/AutoGen.h /EHs-c- /GF /Gs8192 /Fp$(DEST_DIR_OUTPUT)/AutoGen.h.gch /Yc /TC RELEASE_ICC_IA32_PCH_FLAGS = /nologo /W4 /WX /Gy /c /D UNICODE /D EFI32 /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings /FI$(DEST_DIR_DEBUG)/AutoGen.h /EHs-c- /GF /Gs8192 /Yc /TC
DEBUG_ICC_IA32_ASM_FLAGS = /nologo /W3 /WX /c /coff /Cx /Zd /W0 /Zi DEBUG_ICC_IA32_ASM_FLAGS = /nologo /W3 /WX /c /coff /Cx /Zd /W0 /Zi
RELEASE_ICC_IA32_ASM_FLAGS = /nologo /W3 /WX /c /coff /Cx /Zd /W0 RELEASE_ICC_IA32_ASM_FLAGS = /nologo /W3 /WX /c /coff /Cx /Zd /W0
*_ICC_IA32_SLINK_FLAGS = /nologo /LTCG *_ICC_IA32_SLINK_FLAGS = /nologo /LTCG

View File

@ -351,7 +351,7 @@ EhcGetRootHubPortStatus (
for (Index = 0; Index < MapSize; Index++) { for (Index = 0; Index < MapSize; Index++) {
if (EHC_BIT_IS_SET (State, mUsbPortStateMap[Index].HwState)) { if (EHC_BIT_IS_SET (State, mUsbPortStateMap[Index].HwState)) {
PortStatus->PortStatus |= mUsbPortStateMap[Index].UefiState; PortStatus->PortStatus = (UINT16) (PortStatus->PortStatus | mUsbPortStateMap[Index].UefiState);
} }
} }
@ -359,7 +359,7 @@ EhcGetRootHubPortStatus (
for (Index = 0; Index < MapSize; Index++) { for (Index = 0; Index < MapSize; Index++) {
if (EHC_BIT_IS_SET (State, mUsbPortChangeMap[Index].HwState)) { if (EHC_BIT_IS_SET (State, mUsbPortChangeMap[Index].HwState)) {
PortStatus->PortChangeStatus |= mUsbPortChangeMap[Index].UefiState; PortStatus->PortChangeStatus = (UINT16) (PortStatus->PortChangeStatus | mUsbPortChangeMap[Index].UefiState);
} }
} }
@ -707,7 +707,7 @@ EhcControlTransfer (
// endpoint is bidirectional. EhcCreateUrb expects this // endpoint is bidirectional. EhcCreateUrb expects this
// combination of Ep addr and its direction. // combination of Ep addr and its direction.
// //
Endpoint = 0 | ((TransferDirection == EfiUsbDataIn) ? 0x80 : 0); Endpoint = (UINT8) (0 | ((TransferDirection == EfiUsbDataIn) ? 0x80 : 0));
Urb = EhcCreateUrb ( Urb = EhcCreateUrb (
Ehc, Ehc,
DeviceAddress, DeviceAddress,
@ -1340,7 +1340,7 @@ EhcDriverBindingSupported (
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Controller, Controller,
&gEfiPciIoProtocolGuid, &gEfiPciIoProtocolGuid,
&PciIo, (VOID **) &PciIo,
This->DriverBindingHandle, This->DriverBindingHandle,
Controller, Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER EFI_OPEN_PROTOCOL_BY_DRIVER
@ -1491,7 +1491,7 @@ EhcDriverBindingStart (
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Controller, Controller,
&gEfiPciIoProtocolGuid, &gEfiPciIoProtocolGuid,
&PciIo, (VOID **) &PciIo,
This->DriverBindingHandle, This->DriverBindingHandle,
Controller, Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER EFI_OPEN_PROTOCOL_BY_DRIVER
@ -1636,7 +1636,7 @@ EhcDriverBindingStop (
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Controller, Controller,
&gEfiUsb2HcProtocolGuid, &gEfiUsb2HcProtocolGuid,
&Usb2Hc, (VOID **) &Usb2Hc,
This->DriverBindingHandle, This->DriverBindingHandle,
Controller, Controller,
EFI_OPEN_PROTOCOL_GET_PROTOCOL EFI_OPEN_PROTOCOL_GET_PROTOCOL

View File

@ -66,7 +66,7 @@ enum {
EHC_SYNC_POLL_TIME = 20 * EHC_STALL_1_MICROSECOND, EHC_SYNC_POLL_TIME = 20 * EHC_STALL_1_MICROSECOND,
EHC_ASYNC_POLL_TIME = 50 * 10000UL, // The unit of time is 100us EHC_ASYNC_POLL_TIME = 50 * 10000UL, // The unit of time is 100us
EHC_TPL = TPL_NOTIFY, EHC_TPL = TPL_NOTIFY
}; };
// //
@ -95,7 +95,7 @@ enum {
#define EHC_FROM_THIS(a) CR(a, USB2_HC_DEV, Usb2Hc, USB2_HC_DEV_SIGNATURE) #define EHC_FROM_THIS(a) CR(a, USB2_HC_DEV, Usb2Hc, USB2_HC_DEV_SIGNATURE)
typedef struct _USB2_HC_DEV { struct _USB2_HC_DEV {
UINTN Signature; UINTN Signature;
EFI_USB2_HC_PROTOCOL Usb2Hc; EFI_USB2_HC_PROTOCOL Usb2Hc;
@ -143,7 +143,7 @@ typedef struct _USB2_HC_DEV {
// Misc // Misc
// //
EFI_UNICODE_STRING_TABLE *ControllerNameTable; EFI_UNICODE_STRING_TABLE *ControllerNameTable;
} USB2_HC_DEV; };
extern EFI_DRIVER_BINDING_PROTOCOL gEhciDriverBinding; extern EFI_DRIVER_BINDING_PROTOCOL gEhciDriverBinding;

View File

@ -30,7 +30,7 @@ enum {
EHC_DEBUG_QH = (UINTN)(1 << 8), EHC_DEBUG_QH = (UINTN)(1 << 8),
EHC_DEBUG_QTD = (UINTN)(1 << 9), EHC_DEBUG_QTD = (UINTN)(1 << 9),
EHC_DEBUG_BUF = (UINTN)(1 << 10), EHC_DEBUG_BUF = (UINTN)(1 << 10)
}; };

View File

@ -93,7 +93,7 @@ enum {
// //
EHC_PCI_CLASSC = 0x09, EHC_PCI_CLASSC = 0x09,
EHC_PCI_CLASSC_PI = 0x20, EHC_PCI_CLASSC_PI = 0x20,
EHC_BAR_INDEX = 0, /* how many bytes away from USB_BASE to 0x10 */ EHC_BAR_INDEX = 0 /* how many bytes away from USB_BASE to 0x10 */
}; };
#define EHC_LINK_TERMINATED(Link) (((Link) & 0x01) != 0) #define EHC_LINK_TERMINATED(Link) (((Link) & 0x01) != 0)

View File

@ -486,7 +486,7 @@ EhcCreateQtds (
// Switch the Toggle bit if odd number of packets are included in the QTD. // Switch the Toggle bit if odd number of packets are included in the QTD.
// //
if (((Qtd->DataLen + Ep->MaxPacket - 1) / Ep->MaxPacket) % 2) { if (((Qtd->DataLen + Ep->MaxPacket - 1) / Ep->MaxPacket) % 2) {
Toggle = 1 - Toggle; Toggle = (UINT8) (1 - Toggle);
} }
Len += Qtd->DataLen; Len += Qtd->DataLen;
@ -588,7 +588,7 @@ EhcCreateUrb (
Ep = &Urb->Ep; Ep = &Urb->Ep;
Ep->DevAddr = DevAddr; Ep->DevAddr = DevAddr;
Ep->EpAddr = EpAddr & 0x0F; Ep->EpAddr = (UINT8) (EpAddr & 0x0F);
Ep->Direction = ((EpAddr & 0x80) ? EfiUsbDataIn : EfiUsbDataOut); Ep->Direction = ((EpAddr & 0x80) ? EfiUsbDataIn : EfiUsbDataOut);
Ep->DevSpeed = DevSpeed; Ep->DevSpeed = DevSpeed;
Ep->MaxPacket = MaxPacket; Ep->MaxPacket = MaxPacket;

View File

@ -83,7 +83,7 @@ enum {
QH_MICROFRAME_6 = 0x40, QH_MICROFRAME_6 = 0x40,
QH_MICROFRAME_7 = 0x80, QH_MICROFRAME_7 = 0x80,
USB_ERR_SHORT_PACKET = 0x200, USB_ERR_SHORT_PACKET = 0x200
}; };
// //
@ -180,13 +180,13 @@ typedef struct _USB_ENDPOINT {
// Software QTD strcture, this is used to manage all the // Software QTD strcture, this is used to manage all the
// QTD generated from a URB. Don't add fields before QtdHw. // QTD generated from a URB. Don't add fields before QtdHw.
// //
typedef struct _EHC_QTD { struct _EHC_QTD {
QTD_HW QtdHw; QTD_HW QtdHw;
UINT32 Signature; UINT32 Signature;
LIST_ENTRY QtdList; // The list of QTDs to one end point LIST_ENTRY QtdList; // The list of QTDs to one end point
UINT8 *Data; // Buffer of the original data UINT8 *Data; // Buffer of the original data
UINTN DataLen; // Original amount of data in this QTD UINTN DataLen; // Original amount of data in this QTD
} EHC_QTD; };
// //
// Software QH structure. All three different transaction types // Software QH structure. All three different transaction types
@ -203,19 +203,19 @@ typedef struct _EHC_QTD {
// transfer is supported. A dummy QH is linked to EHCI AsyncListAddr // transfer is supported. A dummy QH is linked to EHCI AsyncListAddr
// as the reclamation header. New transfer is inserted after this QH. // as the reclamation header. New transfer is inserted after this QH.
// //
typedef struct _EHC_QH { struct _EHC_QH {
QH_HW QhHw; QH_HW QhHw;
UINT32 Signature; UINT32 Signature;
EHC_QH *NextQh; // The queue head pointed to by horizontal link EHC_QH *NextQh; // The queue head pointed to by horizontal link
LIST_ENTRY Qtds; // The list of QTDs to this queue head LIST_ENTRY Qtds; // The list of QTDs to this queue head
UINTN Interval; UINTN Interval;
} EHC_QH; };
// //
// URB (Usb Request Block) contains information for all kinds of // URB (Usb Request Block) contains information for all kinds of
// usb requests. // usb requests.
// //
typedef struct _URB { struct _URB {
UINT32 Signature; UINT32 Signature;
LIST_ENTRY UrbList; LIST_ENTRY UrbList;
@ -244,7 +244,7 @@ typedef struct _URB {
UINT32 Result; UINT32 Result;
UINTN Completed; // completed data length UINTN Completed; // completed data length
UINT8 DataToggle; UINT8 DataToggle;
} URB; };

View File

@ -520,7 +520,7 @@ UsbHcFreeMem (
for (Count = 0; Count < (AllocSize / USBHC_MEM_UNIT); Count++) { for (Count = 0; Count < (AllocSize / USBHC_MEM_UNIT); Count++) {
ASSERT (USB_HC_BIT_IS_SET (Block->Bits[Byte], Bit)); ASSERT (USB_HC_BIT_IS_SET (Block->Bits[Byte], Bit));
Block->Bits[Byte] ^= (UINT8) USB_HC_BIT (Bit); Block->Bits[Byte] = (UINT8) (Block->Bits[Byte] ^ USB_HC_BIT (Bit));
NEXT_BIT (Byte, Bit); NEXT_BIT (Byte, Bit);
} }

View File

@ -37,7 +37,7 @@ Revision History
typedef struct _USBHC_MEM_BLOCK USBHC_MEM_BLOCK; typedef struct _USBHC_MEM_BLOCK USBHC_MEM_BLOCK;
typedef struct _USBHC_MEM_BLOCK { struct _USBHC_MEM_BLOCK {
UINT8 *Bits; // Bit array to record which unit is allocated UINT8 *Bits; // Bit array to record which unit is allocated
UINTN BitsLen; UINTN BitsLen;
UINT8 *Buf; UINT8 *Buf;
@ -45,7 +45,7 @@ typedef struct _USBHC_MEM_BLOCK {
UINTN BufLen; // Memory size in bytes UINTN BufLen; // Memory size in bytes
VOID *Mapping; VOID *Mapping;
USBHC_MEM_BLOCK *Next; USBHC_MEM_BLOCK *Next;
} USBHC_MEM_BLOCK; };
// //
// USBHC_MEM_POOL is used to manage the memory used by USB // USBHC_MEM_POOL is used to manage the memory used by USB
@ -63,7 +63,7 @@ enum {
USBHC_MEM_UNIT = 64, // Memory allocation unit, must be 2^n, n>4 USBHC_MEM_UNIT = 64, // Memory allocation unit, must be 2^n, n>4
USBHC_MEM_UNIT_MASK = USBHC_MEM_UNIT - 1, USBHC_MEM_UNIT_MASK = USBHC_MEM_UNIT - 1,
USBHC_MEM_DEFAULT_PAGES = 16, USBHC_MEM_DEFAULT_PAGES = 16
}; };
#define USBHC_MEM_ROUND(Len) (((Len) + USBHC_MEM_UNIT_MASK) & (~USBHC_MEM_UNIT_MASK)) #define USBHC_MEM_ROUND(Len) (((Len) + USBHC_MEM_UNIT_MASK) & (~USBHC_MEM_UNIT_MASK))

View File

@ -1538,7 +1538,7 @@ Uhci2ControlTransfer (
BOOLEAN IsSlow; BOOLEAN IsSlow;
Uhc = UHC_FROM_USB2_HC_PROTO (This); Uhc = UHC_FROM_USB2_HC_PROTO (This);
IsSlow = (EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE; IsSlow = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);
return UhciControlTransfer ( return UhciControlTransfer (
&Uhc->UsbHc, &Uhc->UsbHc,
@ -1668,7 +1668,7 @@ Uhci2AsyncInterruptTransfer (
BOOLEAN IsSlow; BOOLEAN IsSlow;
Uhc = UHC_FROM_USB2_HC_PROTO (This); Uhc = UHC_FROM_USB2_HC_PROTO (This);
IsSlow = (EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE; IsSlow = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);
return UhciAsyncInterruptTransfer ( return UhciAsyncInterruptTransfer (
&Uhc->UsbHc, &Uhc->UsbHc,
@ -1736,7 +1736,7 @@ Uhci2SyncInterruptTransfer (
} }
Uhc = UHC_FROM_USB2_HC_PROTO (This); Uhc = UHC_FROM_USB2_HC_PROTO (This);
IsSlow = (EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE; IsSlow = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);
return UhciSyncInterruptTransfer ( return UhciSyncInterruptTransfer (
&Uhc->UsbHc, &Uhc->UsbHc,
@ -1897,7 +1897,7 @@ UhciDriverBindingSupported (
OpenStatus = gBS->OpenProtocol ( OpenStatus = gBS->OpenProtocol (
Controller, Controller,
&gEfiPciIoProtocolGuid, &gEfiPciIoProtocolGuid,
&PciIo, (VOID **) &PciIo,
This->DriverBindingHandle, This->DriverBindingHandle,
Controller, Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER EFI_OPEN_PROTOCOL_BY_DRIVER
@ -2148,7 +2148,7 @@ UhciDriverBindingStart (
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Controller, Controller,
&gEfiPciIoProtocolGuid, &gEfiPciIoProtocolGuid,
&PciIo, (VOID **) &PciIo,
This->DriverBindingHandle, This->DriverBindingHandle,
Controller, Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER EFI_OPEN_PROTOCOL_BY_DRIVER
@ -2277,7 +2277,7 @@ UhciDriverBindingStop (
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Controller, Controller,
&gEfiUsbHcProtocolGuid, &gEfiUsbHcProtocolGuid,
&UsbHc, (VOID **) &UsbHc,
This->DriverBindingHandle, This->DriverBindingHandle,
Controller, Controller,
EFI_OPEN_PROTOCOL_GET_PROTOCOL EFI_OPEN_PROTOCOL_GET_PROTOCOL
@ -2294,7 +2294,7 @@ UhciDriverBindingStop (
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Controller, Controller,
&gEfiUsb2HcProtocolGuid, &gEfiUsb2HcProtocolGuid,
&Usb2Hc, (VOID **) &Usb2Hc,
This->DriverBindingHandle, This->DriverBindingHandle,
Controller, Controller,
EFI_OPEN_PROTOCOL_GET_PROTOCOL EFI_OPEN_PROTOCOL_GET_PROTOCOL

View File

@ -75,7 +75,7 @@ enum {
// //
UHCI_TPL = TPL_NOTIFY, UHCI_TPL = TPL_NOTIFY,
USB_HC_DEV_SIGNATURE = EFI_SIGNATURE_32 ('u', 'h', 'c', 'i'), USB_HC_DEV_SIGNATURE = EFI_SIGNATURE_32 ('u', 'h', 'c', 'i')
}; };
#pragma pack(1) #pragma pack(1)
@ -100,7 +100,7 @@ typedef struct {
// or bulk transfer can reclaim the unused bandwidth. Some USB // or bulk transfer can reclaim the unused bandwidth. Some USB
// device requires this bandwidth reclamation capability. // device requires this bandwidth reclamation capability.
// //
typedef struct _USB_HC_DEV { struct _USB_HC_DEV {
UINT32 Signature; UINT32 Signature;
EFI_USB_HC_PROTOCOL UsbHc; EFI_USB_HC_PROTOCOL UsbHc;
EFI_USB2_HC_PROTOCOL Usb2Hc; EFI_USB2_HC_PROTOCOL Usb2Hc;
@ -132,7 +132,7 @@ typedef struct _USB_HC_DEV {
USBHC_MEM_POOL *MemPool; USBHC_MEM_POOL *MemPool;
EFI_UNICODE_STRING_TABLE *CtrlNameTable; EFI_UNICODE_STRING_TABLE *CtrlNameTable;
VOID *FrameMapping; VOID *FrameMapping;
} USB_HC_DEV; };
extern EFI_DRIVER_BINDING_PROTOCOL gUhciDriverBinding; extern EFI_DRIVER_BINDING_PROTOCOL gUhciDriverBinding;
extern EFI_COMPONENT_NAME_PROTOCOL gUhciComponentName; extern EFI_COMPONENT_NAME_PROTOCOL gUhciComponentName;

View File

@ -88,19 +88,19 @@ typedef struct {
typedef struct _UHCI_TD_SW UHCI_TD_SW; typedef struct _UHCI_TD_SW UHCI_TD_SW;
typedef struct _UHCI_QH_SW UHCI_QH_SW; typedef struct _UHCI_QH_SW UHCI_QH_SW;
typedef struct _UHCI_QH_SW { struct _UHCI_QH_SW {
UHCI_QH_HW QhHw; UHCI_QH_HW QhHw;
UHCI_QH_SW *NextQh; UHCI_QH_SW *NextQh;
UHCI_TD_SW *TDs; UHCI_TD_SW *TDs;
UINTN Interval; UINTN Interval;
} UHCI_QH_SW; };
typedef struct _UHCI_TD_SW { struct _UHCI_TD_SW {
UHCI_TD_HW TdHw; UHCI_TD_HW TdHw;
UHCI_TD_SW *NextTd; UHCI_TD_SW *NextTd;
UINT8 *Data; UINT8 *Data;
UINT16 DataLen; UINT16 DataLen;
} UHCI_TD_SW; };
/** /**

View File

@ -116,7 +116,7 @@ UhciSetRegBit (
UINT16 Data; UINT16 Data;
Data = UhciReadReg (PciIo, Offset); Data = UhciReadReg (PciIo, Offset);
Data |= Bit; Data = (UINT16) (Data |Bit);
UhciWriteReg (PciIo, Offset, Data); UhciWriteReg (PciIo, Offset, Data);
} }
@ -141,7 +141,7 @@ UhciClearRegBit (
UINT16 Data; UINT16 Data;
Data = UhciReadReg (PciIo, Offset); Data = UhciReadReg (PciIo, Offset);
Data &= ~Bit; Data = (UINT16) (Data & ~Bit);
UhciWriteReg (PciIo, Offset, Data); UhciWriteReg (PciIo, Offset, Data);
} }

View File

@ -98,7 +98,7 @@ enum {
USBTD_BABBLE = BIT(4), // Babble condition USBTD_BABBLE = BIT(4), // Babble condition
USBTD_NAK = BIT(3), // NAK is received USBTD_NAK = BIT(3), // NAK is received
USBTD_CRC = BIT(2), // CRC/Time out error USBTD_CRC = BIT(2), // CRC/Time out error
USBTD_BITSTUFF = BIT(1), // Bit stuff error USBTD_BITSTUFF = BIT(1) // Bit stuff error
}; };

View File

@ -498,7 +498,7 @@ UhciCheckTdStatus (
// next to the last known-good TD's data toggle if // next to the last known-good TD's data toggle if
// any TD is executed OK // any TD is executed OK
// //
QhResult->NextToggle = 1 - (UINT8)TdHw->DataToggle; QhResult->NextToggle = (UINT8) (1 - (UINT8)TdHw->DataToggle);
// //
// This TD is finished OK or met short packet read. Update the // This TD is finished OK or met short packet read. Update the

View File

@ -38,7 +38,7 @@ enum {
USB_ERR_FAIL_MASK = EFI_USB_ERR_STALL | EFI_USB_ERR_BUFFER | USB_ERR_FAIL_MASK = EFI_USB_ERR_STALL | EFI_USB_ERR_BUFFER |
EFI_USB_ERR_BABBLE | EFI_USB_ERR_CRC | EFI_USB_ERR_BABBLE | EFI_USB_ERR_CRC |
EFI_USB_ERR_TIMEOUT | EFI_USB_ERR_BITSTUFF | EFI_USB_ERR_TIMEOUT | EFI_USB_ERR_BITSTUFF |
EFI_USB_ERR_SYSTEM, EFI_USB_ERR_SYSTEM
}; };
@ -59,7 +59,7 @@ typedef struct _UHCI_ASYNC_REQUEST UHCI_ASYNC_REQUEST;
// //
// Structure used to manager the asynchronous interrupt transfers. // Structure used to manager the asynchronous interrupt transfers.
// //
typedef struct _UHCI_ASYNC_REQUEST{ struct _UHCI_ASYNC_REQUEST{
UINTN Signature; UINTN Signature;
LIST_ENTRY Link; LIST_ENTRY Link;
UHCI_ASYNC_REQUEST *Recycle; UHCI_ASYNC_REQUEST *Recycle;
@ -86,7 +86,7 @@ typedef struct _UHCI_ASYNC_REQUEST{
// //
EFI_ASYNC_USB_TRANSFER_CALLBACK Callback; EFI_ASYNC_USB_TRANSFER_CALLBACK Callback;
VOID *Context; VOID *Context;
} UHCI_ASYNC_REQUEST; };
#define UHCI_ASYNC_INT_FROM_LINK(a) \ #define UHCI_ASYNC_INT_FROM_LINK(a) \
CR (a, UHCI_ASYNC_REQUEST, Link, UHCI_ASYNC_INT_SIGNATURE) CR (a, UHCI_ASYNC_REQUEST, Link, UHCI_ASYNC_INT_SIGNATURE)

View File

@ -519,7 +519,7 @@ UsbHcFreeMem (
for (Count = 0; Count < (AllocSize / USBHC_MEM_UNIT); Count++) { for (Count = 0; Count < (AllocSize / USBHC_MEM_UNIT); Count++) {
ASSERT (USB_HC_BIT_IS_SET (Block->Bits[Byte], Bit)); ASSERT (USB_HC_BIT_IS_SET (Block->Bits[Byte], Bit));
Block->Bits[Byte] ^= (UINT8) USB_HC_BIT (Bit); Block->Bits[Byte] = (UINT8) (Block->Bits[Byte] ^ USB_HC_BIT (Bit));
NEXT_BIT (Byte, Bit); NEXT_BIT (Byte, Bit);
} }

View File

@ -36,7 +36,7 @@ Revision History
typedef struct _USBHC_MEM_BLOCK USBHC_MEM_BLOCK; typedef struct _USBHC_MEM_BLOCK USBHC_MEM_BLOCK;
typedef struct _USBHC_MEM_BLOCK { struct _USBHC_MEM_BLOCK {
UINT8 *Bits; // Bit array to record which unit is allocated UINT8 *Bits; // Bit array to record which unit is allocated
UINTN BitsLen; UINTN BitsLen;
UINT8 *Buf; UINT8 *Buf;
@ -44,7 +44,7 @@ typedef struct _USBHC_MEM_BLOCK {
UINTN BufLen; // Memory size in bytes UINTN BufLen; // Memory size in bytes
VOID *Mapping; VOID *Mapping;
USBHC_MEM_BLOCK *Next; USBHC_MEM_BLOCK *Next;
} USBHC_MEM_BLOCK; };
// //
// USBHC_MEM_POOL is used to manage the memory used by USB // USBHC_MEM_POOL is used to manage the memory used by USB
@ -62,7 +62,7 @@ enum {
USBHC_MEM_UNIT = 64, // Memory allocation unit, must be 2^n, n>4 USBHC_MEM_UNIT = 64, // Memory allocation unit, must be 2^n, n>4
USBHC_MEM_UNIT_MASK = USBHC_MEM_UNIT - 1, USBHC_MEM_UNIT_MASK = USBHC_MEM_UNIT - 1,
USBHC_MEM_DEFAULT_PAGES = 16, USBHC_MEM_DEFAULT_PAGES = 16
}; };
#define USBHC_MEM_ROUND(Len) (((Len) + USBHC_MEM_UNIT_MASK) & (~USBHC_MEM_UNIT_MASK)) #define USBHC_MEM_ROUND(Len) (((Len) + USBHC_MEM_UNIT_MASK) & (~USBHC_MEM_UNIT_MASK))

View File

@ -553,7 +553,7 @@ SCSIBusDriverBindingStop (
gBS->OpenProtocol ( gBS->OpenProtocol (
Controller, Controller,
&gEfiExtScsiPassThruProtocolGuid, &gEfiExtScsiPassThruProtocolGuid,
&(EFI_EXT_SCSI_PASS_THRU_PROTOCOL*)ScsiPassThru, (VOID **) &(EFI_EXT_SCSI_PASS_THRU_PROTOCOL*)ScsiPassThru,
This->DriverBindingHandle, This->DriverBindingHandle,
ChildHandleBuffer[Index], ChildHandleBuffer[Index],
EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
@ -562,7 +562,7 @@ SCSIBusDriverBindingStop (
gBS->OpenProtocol ( gBS->OpenProtocol (
Controller, Controller,
&gEfiScsiPassThruProtocolGuid, &gEfiScsiPassThruProtocolGuid,
&(EFI_SCSI_PASS_THRU_PROTOCOL*)ScsiPassThru, (VOID **) &(EFI_SCSI_PASS_THRU_PROTOCOL*)ScsiPassThru,
This->DriverBindingHandle, This->DriverBindingHandle,
ChildHandleBuffer[Index], ChildHandleBuffer[Index],
EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER

View File

@ -26,7 +26,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define _USB_DESCRIPTOR_H_ #define _USB_DESCRIPTOR_H_
enum { enum {
USB_MAX_INTERFACE_SETTING = 8, USB_MAX_INTERFACE_SETTING = 8
}; };
// //

View File

@ -888,7 +888,7 @@ UsbEnumeratePort (
// If overcurrent condition is cleared, enable the port again // If overcurrent condition is cleared, enable the port again
// //
if (!USB_BIT_IS_SET (PortState.PortStatus, USB_PORT_STAT_OVERCURRENT)) { if (!USB_BIT_IS_SET (PortState.PortStatus, USB_PORT_STAT_OVERCURRENT)) {
HubApi->SetPortFeature (HubIf, Port, USB_HUB_PORT_POWER); HubApi->SetPortFeature (HubIf, Port, (EFI_USB_PORT_FEATURE) USB_HUB_PORT_POWER);
} }
} else if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_CONNECTION)) { } else if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_CONNECTION)) {

View File

@ -100,7 +100,7 @@ EFI_STATUS
IN USB_INTERFACE *UsbIf IN USB_INTERFACE *UsbIf
); );
typedef struct _USB_HUB_API{ struct _USB_HUB_API{
USB_HUB_INIT Init; USB_HUB_INIT Init;
USB_HUB_GET_PORT_STATUS GetPortStatus; USB_HUB_GET_PORT_STATUS GetPortStatus;
USB_HUB_CLEAR_PORT_CHANGE ClearPortChange; USB_HUB_CLEAR_PORT_CHANGE ClearPortChange;
@ -108,7 +108,7 @@ typedef struct _USB_HUB_API{
USB_HUB_CLEAR_PORT_FEATURE ClearPortFeature; USB_HUB_CLEAR_PORT_FEATURE ClearPortFeature;
USB_HUB_RESET_PORT ResetPort; USB_HUB_RESET_PORT ResetPort;
USB_HUB_RELEASE Release; USB_HUB_RELEASE Release;
} USB_HUB_API; };
USB_ENDPOINT_DESC* USB_ENDPOINT_DESC*
UsbGetEndpointDesc ( UsbGetEndpointDesc (

View File

@ -98,7 +98,7 @@ UsbHubCtrlClearPortFeature (
USB_HUB_TARGET_PORT, USB_HUB_TARGET_PORT,
USB_HUB_REQ_CLEAR_FEATURE, USB_HUB_REQ_CLEAR_FEATURE,
Feature, Feature,
Port + 1, (UINT16) (Port + 1),
NULL, NULL,
0 0
); );
@ -140,8 +140,8 @@ UsbHubCtrlClearTTBuffer (
// //
// Check USB2.0 spec page 424 for wValue's encoding // Check USB2.0 spec page 424 for wValue's encoding
// //
Value = (EpNum & 0x0F) | (DevAddr << 4) | Value = (UINT16) ((EpNum & 0x0F) | (DevAddr << 4) |
((EpType & 0x03) << 11) | ((EpNum & 0x80) << 15); ((EpType & 0x03) << 11) | ((EpNum & 0x80) << 15));
Status = UsbCtrlRequest ( Status = UsbCtrlRequest (
HubDev, HubDev,
@ -150,7 +150,7 @@ UsbHubCtrlClearTTBuffer (
USB_HUB_TARGET_PORT, USB_HUB_TARGET_PORT,
USB_HUB_REQ_CLEAR_TT, USB_HUB_REQ_CLEAR_TT,
Value, Value,
Port + 1, (UINT16) (Port + 1),
NULL, NULL,
0 0
); );
@ -265,7 +265,7 @@ UsbHubCtrlGetPortStatus (
USB_HUB_TARGET_PORT, USB_HUB_TARGET_PORT,
USB_HUB_REQ_GET_STATUS, USB_HUB_REQ_GET_STATUS,
0, 0,
Port + 1, (UINT16) (Port + 1),
State, State,
4 4
); );
@ -300,7 +300,7 @@ UsbHubCtrlResetTT (
USB_HUB_TARGET_HUB, USB_HUB_TARGET_HUB,
USB_HUB_REQ_RESET_TT, USB_HUB_REQ_RESET_TT,
0, 0,
Port + 1, (UINT16) (Port + 1),
NULL, NULL,
0 0
); );
@ -376,7 +376,7 @@ UsbHubCtrlSetPortFeature (
USB_HUB_TARGET_PORT, USB_HUB_TARGET_PORT,
USB_HUB_REQ_SET_FEATURE, USB_HUB_REQ_SET_FEATURE,
Feature, Feature,
Port + 1, (UINT16) (Port + 1),
NULL, NULL,
0 0
); );
@ -744,7 +744,7 @@ UsbHubInit (
// for both gang/individual powered hubs. // for both gang/individual powered hubs.
// //
for (Index = 0; Index < HubDesc.NumPorts; Index++) { for (Index = 0; Index < HubDesc.NumPorts; Index++) {
UsbHubCtrlSetPortFeature (HubIf->Device, Index, USB_HUB_PORT_POWER); UsbHubCtrlSetPortFeature (HubIf->Device, Index, (EFI_USB_PORT_FEATURE) USB_HUB_PORT_POWER);
} }
gBS->Stall (HubDesc.PwrOn2PwrGood * 2 * USB_STALL_1_MS); gBS->Stall (HubDesc.PwrOn2PwrGood * 2 * USB_STALL_1_MS);
@ -852,7 +852,7 @@ UsbHubSetPortFeature (
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = UsbHubCtrlSetPortFeature (HubIf->Device, Port, Feature); Status = UsbHubCtrlSetPortFeature (HubIf->Device, Port, (UINT8) Feature);
return Status; return Status;
} }
@ -879,7 +879,7 @@ UsbHubClearPortFeature (
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = UsbHubCtrlClearPortFeature (HubIf->Device, Port, Feature); Status = UsbHubCtrlClearPortFeature (HubIf->Device, Port, (UINT8) Feature);
return Status; return Status;
} }
@ -907,7 +907,7 @@ UsbHubResetPort (
UINTN Index; UINTN Index;
EFI_STATUS Status; EFI_STATUS Status;
Status = UsbHubSetPortFeature (HubIf, Port, USB_HUB_PORT_RESET); Status = UsbHubSetPortFeature (HubIf, Port, (EFI_USB_PORT_FEATURE) USB_HUB_PORT_RESET);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
return Status; return Status;
@ -1121,7 +1121,7 @@ UsbRootHubClearPortChange (
Map = &mRootHubFeatureMap[Index]; Map = &mRootHubFeatureMap[Index];
if (USB_BIT_IS_SET (PortState.PortChangeStatus, Map->ChangedBit)) { if (USB_BIT_IS_SET (PortState.PortChangeStatus, Map->ChangedBit)) {
UsbHcClearRootHubPortFeature (HubIf->Device->Bus, Port, Map->Feature); UsbHcClearRootHubPortFeature (HubIf->Device->Bus, Port, (EFI_USB_PORT_FEATURE) Map->Feature);
} }
} }
} }

View File

@ -25,6 +25,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#ifndef _USB_HUB_H_ #ifndef _USB_HUB_H_
#define _USB_HUB_H_ #define _USB_HUB_H_
#include <IndustryStandard/Usb.h>
#define USB_ENDPOINT_ADDR(EpAddr) ((EpAddr) & 0x7F) #define USB_ENDPOINT_ADDR(EpAddr) ((EpAddr) & 0x7F)
#define USB_ENDPOINT_TYPE(Desc) ((Desc)->Attributes & USB_ENDPOINT_TYPE_MASK) #define USB_ENDPOINT_TYPE(Desc) ((Desc)->Attributes & USB_ENDPOINT_TYPE_MASK)
@ -89,7 +91,7 @@ enum {
USB_HUB_SUBCLASS_CODE = 0x00, USB_HUB_SUBCLASS_CODE = 0x00,
USB_HUB_LOOP = 50, USB_HUB_LOOP = 50
}; };
#pragma pack(1) #pragma pack(1)
@ -110,7 +112,7 @@ typedef struct {
typedef struct { typedef struct {
UINT16 ChangedBit; UINT16 ChangedBit;
EFI_USB_PORT_FEATURE Feature; UINT8 Feature;
} USB_CHANGE_FEATURE_MAP; } USB_CHANGE_FEATURE_MAP;

View File

@ -518,7 +518,7 @@ UsbHcSyncInterruptTransfer (
UsbResult UsbResult
); );
} else { } else {
IsSlowDevice = (EFI_USB_SPEED_LOW == DevSpeed) ? TRUE : FALSE; IsSlowDevice = (BOOLEAN) ((EFI_USB_SPEED_LOW == DevSpeed) ? TRUE : FALSE);
Status = UsbBus->UsbHc->SyncInterruptTransfer ( Status = UsbBus->UsbHc->SyncInterruptTransfer (
UsbBus->UsbHc, UsbBus->UsbHc,
DevAddr, DevAddr,
@ -634,7 +634,7 @@ UsbOpenHostProtoByChild (
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Bus->HostHandle, Bus->HostHandle,
&gEfiUsb2HcProtocolGuid, &gEfiUsb2HcProtocolGuid,
&Usb2Hc, (VOID **) &Usb2Hc,
mUsbBusDriverBinding.DriverBindingHandle, mUsbBusDriverBinding.DriverBindingHandle,
Child, Child,
EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
@ -644,7 +644,7 @@ UsbOpenHostProtoByChild (
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Bus->HostHandle, Bus->HostHandle,
&gEfiUsbHcProtocolGuid, &gEfiUsbHcProtocolGuid,
&UsbHc, (VOID **) &UsbHc,
mUsbBusDriverBinding.DriverBindingHandle, mUsbBusDriverBinding.DriverBindingHandle,
Child, Child,
EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER

View File

@ -83,7 +83,7 @@ enum {
USB_BUS_TPL = TPL_NOTIFY, USB_BUS_TPL = TPL_NOTIFY,
USB_INTERFACE_SIGNATURE = EFI_SIGNATURE_32 ('U', 'S', 'B', 'I'), USB_INTERFACE_SIGNATURE = EFI_SIGNATURE_32 ('U', 'S', 'B', 'I'),
USB_BUS_SIGNATURE = EFI_SIGNATURE_32 ('U', 'S', 'B', 'B'), USB_BUS_SIGNATURE = EFI_SIGNATURE_32 ('U', 'S', 'B', 'B')
}; };
#define USB_BIT(a) ((UINTN)(1 << (a))) #define USB_BIT(a) ((UINTN)(1 << (a)))
@ -110,7 +110,7 @@ typedef struct _EFI_USB_BUS_PROTOCOL {
// Stands for the real USB device. Each device may // Stands for the real USB device. Each device may
// has several seperately working interfaces. // has several seperately working interfaces.
// //
typedef struct _USB_DEVICE { struct _USB_DEVICE {
USB_BUS *Bus; USB_BUS *Bus;
// //
@ -140,12 +140,12 @@ typedef struct _USB_DEVICE {
UINT8 ParentAddr; UINT8 ParentAddr;
USB_INTERFACE *ParentIf; USB_INTERFACE *ParentIf;
UINT8 ParentPort; // Start at 0 UINT8 ParentPort; // Start at 0
} USB_DEVICE; };
// //
// Stands for different functions of USB device // Stands for different functions of USB device
// //
typedef struct _USB_INTERFACE { struct _USB_INTERFACE {
UINTN Signature; UINTN Signature;
USB_DEVICE *Device; USB_DEVICE *Device;
USB_INTERFACE_DESC *IfDesc; USB_INTERFACE_DESC *IfDesc;
@ -179,12 +179,12 @@ typedef struct _USB_INTERFACE {
// connected to EHCI. // connected to EHCI.
// //
UINT8 MaxSpeed; UINT8 MaxSpeed;
} USB_INTERFACE; };
// //
// Stands for the current USB Bus // Stands for the current USB Bus
// //
typedef struct _USB_BUS { struct _USB_BUS {
UINTN Signature; UINTN Signature;
EFI_USB_BUS_PROTOCOL BusId; EFI_USB_BUS_PROTOCOL BusId;
@ -201,7 +201,7 @@ typedef struct _USB_BUS {
// for root hub. Device with address i is at Devices[i]. // for root hub. Device with address i is at Devices[i].
// //
USB_DEVICE *Devices[USB_MAX_DEVICES]; USB_DEVICE *Devices[USB_MAX_DEVICES];
} USB_BUS; };
extern EFI_USB_IO_PROTOCOL mUsbIoProtocol; extern EFI_USB_IO_PROTOCOL mUsbIoProtocol;
extern EFI_DRIVER_BINDING_PROTOCOL mUsbBusDriverBinding; extern EFI_DRIVER_BINDING_PROTOCOL mUsbBusDriverBinding;

View File

@ -174,7 +174,7 @@ USBKeyboardDriverBindingSupported (
OpenStatus = gBS->OpenProtocol ( OpenStatus = gBS->OpenProtocol (
Controller, Controller,
&gEfiUsbIoProtocolGuid, &gEfiUsbIoProtocolGuid,
&UsbIo, (VOID **) &UsbIo,
This->DriverBindingHandle, This->DriverBindingHandle,
Controller, Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER EFI_OPEN_PROTOCOL_BY_DRIVER
@ -244,7 +244,7 @@ USBKeyboardDriverBindingStart (
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Controller, Controller,
&gEfiUsbIoProtocolGuid, &gEfiUsbIoProtocolGuid,
&UsbIo, (VOID **) &UsbIo,
This->DriverBindingHandle, This->DriverBindingHandle,
Controller, Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER EFI_OPEN_PROTOCOL_BY_DRIVER
@ -500,12 +500,11 @@ USBKeyboardDriverBindingStop (
EFI_STATUS Status; EFI_STATUS Status;
EFI_SIMPLE_TEXT_INPUT_PROTOCOL *SimpleInput; EFI_SIMPLE_TEXT_INPUT_PROTOCOL *SimpleInput;
USB_KB_DEV *UsbKeyboardDevice; USB_KB_DEV *UsbKeyboardDevice;
EFI_USB_IO_PROTOCOL *UsbIo;
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Controller, Controller,
&gEfiSimpleTextInProtocolGuid, &gEfiSimpleTextInProtocolGuid,
&SimpleInput, (VOID **) &SimpleInput,
This->DriverBindingHandle, This->DriverBindingHandle,
Controller, Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER EFI_OPEN_PROTOCOL_BY_DRIVER
@ -526,7 +525,6 @@ USBKeyboardDriverBindingStop (
Controller Controller
); );
UsbIo = UsbKeyboardDevice->UsbIo;
// //
// Uninstall the Asyn Interrupt Transfer from this device // Uninstall the Asyn Interrupt Transfer from this device
// will disable the key data input from this device // will disable the key data input from this device
@ -605,12 +603,9 @@ USBKeyboardReset (
{ {
EFI_STATUS Status; EFI_STATUS Status;
USB_KB_DEV *UsbKeyboardDevice; USB_KB_DEV *UsbKeyboardDevice;
EFI_USB_IO_PROTOCOL *UsbIo;
UsbKeyboardDevice = USB_KB_DEV_FROM_THIS (This); UsbKeyboardDevice = USB_KB_DEV_FROM_THIS (This);
UsbIo = UsbKeyboardDevice->UsbIo;
KbdReportStatusCode ( KbdReportStatusCode (
UsbKeyboardDevice->DevicePath, UsbKeyboardDevice->DevicePath,
EFI_PROGRESS_CODE, EFI_PROGRESS_CODE,

View File

@ -206,9 +206,6 @@ InitUSBKeyboard (
UINT8 Duration; UINT8 Duration;
EFI_STATUS Status; EFI_STATUS Status;
UINT32 TransferResult; UINT32 TransferResult;
EFI_USB_IO_PROTOCOL *UsbIo;
UsbIo = UsbKeyboardDevice->UsbIo;
KbdReportStatusCode ( KbdReportStatusCode (
UsbKeyboardDevice->DevicePath, UsbKeyboardDevice->DevicePath,
@ -361,19 +358,16 @@ KeyboardHandler (
UINT8 Index; UINT8 Index;
UINT8 Index2; UINT8 Index2;
BOOLEAN Down; BOOLEAN Down;
EFI_STATUS Status;
BOOLEAN KeyRelease; BOOLEAN KeyRelease;
BOOLEAN KeyPress; BOOLEAN KeyPress;
UINT8 SavedTail; UINT8 SavedTail;
USB_KEY UsbKey; USB_KEY UsbKey;
UINT8 NewRepeatKey; UINT8 NewRepeatKey;
UINT32 UsbStatus; UINT32 UsbStatus;
UINT8 *DataPtr;
ASSERT (Context); ASSERT (Context);
NewRepeatKey = 0; NewRepeatKey = 0;
DataPtr = (UINT8 *) Data;
UsbKeyboardDevice = (USB_KB_DEV *) Context; UsbKeyboardDevice = (USB_KB_DEV *) Context;
UsbIo = UsbKeyboardDevice->UsbIo; UsbIo = UsbKeyboardDevice->UsbIo;
@ -413,7 +407,7 @@ KeyboardHandler (
// Delete & Submit this interrupt again // Delete & Submit this interrupt again
// //
Status = UsbIo->UsbAsyncInterruptTransfer ( UsbIo->UsbAsyncInterruptTransfer (
UsbIo, UsbIo,
UsbKeyboardDevice->IntEndpointDescriptor.EndpointAddress, UsbKeyboardDevice->IntEndpointDescriptor.EndpointAddress,
FALSE, FALSE,

View File

@ -84,7 +84,7 @@ enum {
USB_MASS_CMD_SUCCESS = 0, USB_MASS_CMD_SUCCESS = 0,
USB_MASS_CMD_FAIL, USB_MASS_CMD_FAIL,
USB_MASS_CMD_PERSISTENT, USB_MASS_CMD_PERSISTENT
}; };
typedef typedef

View File

@ -89,7 +89,7 @@ UsbBootPutUint16 (
IN UINT16 Data16 IN UINT16 Data16
) )
{ {
Data16 = USB_BOOT_SWAP16 (Data16); Data16 = (UINT16) (USB_BOOT_SWAP16 (Data16));
CopyMem (Buf, &Data16, sizeof (UINT16)); CopyMem (Buf, &Data16, sizeof (UINT16));
} }
@ -125,7 +125,7 @@ UsbBootRequestSense (
ZeroMem (&SenseData, sizeof (USB_BOOT_REQUEST_SENSE_DATA)); ZeroMem (&SenseData, sizeof (USB_BOOT_REQUEST_SENSE_DATA));
SenseCmd.OpCode = USB_BOOT_REQUEST_SENSE_OPCODE; SenseCmd.OpCode = USB_BOOT_REQUEST_SENSE_OPCODE;
SenseCmd.Lun = USB_BOOT_LUN (UsbMass->Lun); SenseCmd.Lun = (UINT8) (USB_BOOT_LUN (UsbMass->Lun));
SenseCmd.AllocLen = sizeof (USB_BOOT_REQUEST_SENSE_DATA); SenseCmd.AllocLen = sizeof (USB_BOOT_REQUEST_SENSE_DATA);
Status = Transport->ExecCommand ( Status = Transport->ExecCommand (
@ -364,7 +364,7 @@ UsbBootIsUnitReady (
ZeroMem (&TestCmd, sizeof (USB_BOOT_TEST_UNIT_READY_CMD)); ZeroMem (&TestCmd, sizeof (USB_BOOT_TEST_UNIT_READY_CMD));
TestCmd.OpCode = USB_BOOT_TEST_UNIT_READY_OPCODE; TestCmd.OpCode = USB_BOOT_TEST_UNIT_READY_OPCODE;
TestCmd.Lun = USB_BOOT_LUN (UsbMass->Lun); TestCmd.Lun = (UINT8) (USB_BOOT_LUN (UsbMass->Lun));
return UsbBootExecCmdWithRetry ( return UsbBootExecCmdWithRetry (
UsbMass, UsbMass,
@ -407,7 +407,7 @@ UsbBootInquiry (
ZeroMem (&InquiryData, sizeof (USB_BOOT_INQUIRY_DATA)); ZeroMem (&InquiryData, sizeof (USB_BOOT_INQUIRY_DATA));
InquiryCmd.OpCode = USB_BOOT_INQUIRY_OPCODE; InquiryCmd.OpCode = USB_BOOT_INQUIRY_OPCODE;
InquiryCmd.Lun = USB_BOOT_LUN (UsbMass->Lun); InquiryCmd.Lun = (UINT8) (USB_BOOT_LUN (UsbMass->Lun));
InquiryCmd.AllocLen = sizeof (InquiryData); InquiryCmd.AllocLen = sizeof (InquiryData);
Status = UsbBootExecCmdWithRetry ( Status = UsbBootExecCmdWithRetry (
@ -423,8 +423,8 @@ UsbBootInquiry (
return Status; return Status;
} }
UsbMass->Pdt = USB_BOOT_PDT (InquiryData.Pdt); UsbMass->Pdt = (UINT8) (USB_BOOT_PDT (InquiryData.Pdt));
Media->RemovableMedia = USB_BOOT_REMOVABLE (InquiryData.Removable); Media->RemovableMedia = (BOOLEAN) (USB_BOOT_REMOVABLE (InquiryData.Removable));
// //
// Default value 512 Bytes, in case no media present at first time // Default value 512 Bytes, in case no media present at first time
// //
@ -466,7 +466,7 @@ UsbBootReadCapacity (
ZeroMem (&CapacityData, sizeof (USB_BOOT_READ_CAPACITY_DATA)); ZeroMem (&CapacityData, sizeof (USB_BOOT_READ_CAPACITY_DATA));
CapacityCmd.OpCode = USB_BOOT_READ_CAPACITY_OPCODE; CapacityCmd.OpCode = USB_BOOT_READ_CAPACITY_OPCODE;
CapacityCmd.Lun = USB_BOOT_LUN (UsbMass->Lun); CapacityCmd.Lun = (UINT8) (USB_BOOT_LUN (UsbMass->Lun));
Status = UsbBootExecCmdWithRetry ( Status = UsbBootExecCmdWithRetry (
UsbMass, UsbMass,
@ -742,7 +742,7 @@ UsbBootReadBlocks (
ZeroMem (&ReadCmd, sizeof (USB_BOOT_READ10_CMD)); ZeroMem (&ReadCmd, sizeof (USB_BOOT_READ10_CMD));
ReadCmd.OpCode = USB_BOOT_READ10_OPCODE; ReadCmd.OpCode = USB_BOOT_READ10_OPCODE;
ReadCmd.Lun = USB_BOOT_LUN (UsbMass->Lun); ReadCmd.Lun = (UINT8) (USB_BOOT_LUN (UsbMass->Lun));
UsbBootPutUint32 (ReadCmd.Lba, Lba); UsbBootPutUint32 (ReadCmd.Lba, Lba);
UsbBootPutUint16 (ReadCmd.TransferLen, Count); UsbBootPutUint16 (ReadCmd.TransferLen, Count);
@ -822,7 +822,7 @@ UsbBootWriteBlocks (
ZeroMem (&WriteCmd, sizeof (USB_BOOT_WRITE10_CMD)); ZeroMem (&WriteCmd, sizeof (USB_BOOT_WRITE10_CMD));
WriteCmd.OpCode = USB_BOOT_WRITE10_OPCODE; WriteCmd.OpCode = USB_BOOT_WRITE10_OPCODE;
WriteCmd.Lun = USB_BOOT_LUN (UsbMass->Lun); WriteCmd.Lun = (UINT8) (USB_BOOT_LUN (UsbMass->Lun));
UsbBootPutUint32 (WriteCmd.Lba, Lba); UsbBootPutUint32 (WriteCmd.Lba, Lba);
UsbBootPutUint16 (WriteCmd.TransferLen, Count); UsbBootPutUint16 (WriteCmd.TransferLen, Count);

View File

@ -101,7 +101,7 @@ enum {
USB_PDT_DIRECT_ACCESS = 0x00, // Direct access device USB_PDT_DIRECT_ACCESS = 0x00, // Direct access device
USB_PDT_CDROM = 0x05, // CDROM USB_PDT_CDROM = 0x05, // CDROM
USB_PDT_OPTICAL = 0x07, // Non-CD optical disks USB_PDT_OPTICAL = 0x07, // Non-CD optical disks
USB_PDT_SIMPLE_DIRECT = 0x0E, // Simplified direct access device USB_PDT_SIMPLE_DIRECT = 0x0E // Simplified direct access device
}; };
// //

View File

@ -182,7 +182,7 @@ UsbBotSendCommand (
Cbw.Signature = USB_BOT_CBW_SIGNATURE; Cbw.Signature = USB_BOT_CBW_SIGNATURE;
Cbw.Tag = UsbBot->CbwTag; Cbw.Tag = UsbBot->CbwTag;
Cbw.DataLen = TransLen; Cbw.DataLen = TransLen;
Cbw.Flag = ((DataDir == EfiUsbDataIn) ? 0x80 : 0); Cbw.Flag = (UINT8) ((DataDir == EfiUsbDataIn) ? 0x80 : 0);
Cbw.Lun = 0; Cbw.Lun = 0;
Cbw.CmdLen = CmdLen; Cbw.CmdLen = CmdLen;

View File

@ -60,7 +60,7 @@ enum {
// //
USB_BOT_CBW_TIMEOUT = 1 * USB_MASS_STALL_1_S, USB_BOT_CBW_TIMEOUT = 1 * USB_MASS_STALL_1_S,
USB_BOT_CSW_TIMEOUT = 1 * USB_MASS_STALL_1_S, USB_BOT_CSW_TIMEOUT = 1 * USB_MASS_STALL_1_S,
USB_BOT_RESET_TIMEOUT = 3 * USB_MASS_STALL_1_S, USB_BOT_RESET_TIMEOUT = 3 * USB_MASS_STALL_1_S
}; };
// //

View File

@ -37,7 +37,7 @@ enum {
// //
// Usb Cbi transfer timeout // Usb Cbi transfer timeout
// //
USB_CBI_RESET_TIMEOUT = 1 * USB_MASS_STALL_1_S, USB_CBI_RESET_TIMEOUT = 1 * USB_MASS_STALL_1_S
}; };
// //

View File

@ -344,7 +344,7 @@ USBMassDriverBindingSupported (
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Controller, Controller,
&gEfiUsbIoProtocolGuid, &gEfiUsbIoProtocolGuid,
&UsbIo, (VOID **) &UsbIo,
This->DriverBindingHandle, This->DriverBindingHandle,
Controller, Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER EFI_OPEN_PROTOCOL_BY_DRIVER
@ -421,7 +421,7 @@ USBMassDriverBindingStart (
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Controller, Controller,
&gEfiUsbIoProtocolGuid, &gEfiUsbIoProtocolGuid,
&UsbIo, (VOID **) &UsbIo,
This->DriverBindingHandle, This->DriverBindingHandle,
Controller, Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER EFI_OPEN_PROTOCOL_BY_DRIVER
@ -547,7 +547,7 @@ USBMassDriverBindingStop (
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Controller, Controller,
&gEfiBlockIoProtocolGuid, &gEfiBlockIoProtocolGuid,
&BlockIo, (VOID **) &BlockIo,
This->DriverBindingHandle, This->DriverBindingHandle,
Controller, Controller,
EFI_OPEN_PROTOCOL_GET_PROTOCOL EFI_OPEN_PROTOCOL_GET_PROTOCOL

View File

@ -33,10 +33,10 @@ typedef struct _USB_MASS_DEVICE USB_MASS_DEVICE;
#include "UsbMassBoot.h" #include "UsbMassBoot.h"
enum { enum {
USB_MASS_SIGNATURE= EFI_SIGNATURE_32 ('U', 's', 'b', 'K'), USB_MASS_SIGNATURE= EFI_SIGNATURE_32 ('U', 's', 'b', 'K')
}; };
typedef struct _USB_MASS_DEVICE { struct _USB_MASS_DEVICE {
UINT32 Signature; UINT32 Signature;
EFI_HANDLE Controller; EFI_HANDLE Controller;
EFI_USB_IO_PROTOCOL *UsbIo; EFI_USB_IO_PROTOCOL *UsbIo;

View File

@ -208,7 +208,7 @@ USBMouseDriverBindingSupported (
OpenStatus = gBS->OpenProtocol ( OpenStatus = gBS->OpenProtocol (
Controller, Controller,
&gEfiUsbIoProtocolGuid, &gEfiUsbIoProtocolGuid,
&UsbIo, (VOID **) &UsbIo,
This->DriverBindingHandle, This->DriverBindingHandle,
Controller, Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER EFI_OPEN_PROTOCOL_BY_DRIVER
@ -279,7 +279,7 @@ USBMouseDriverBindingStart (
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Controller, Controller,
&gEfiUsbIoProtocolGuid, &gEfiUsbIoProtocolGuid,
&UsbIo, (VOID **) &UsbIo,
This->DriverBindingHandle, This->DriverBindingHandle,
Controller, Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER EFI_OPEN_PROTOCOL_BY_DRIVER
@ -513,7 +513,7 @@ USBMouseDriverBindingStop (
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Controller, Controller,
&gEfiSimplePointerProtocolGuid, &gEfiSimplePointerProtocolGuid,
&SimplePointerProtocol, (VOID **) &SimplePointerProtocol,
This->DriverBindingHandle, This->DriverBindingHandle,
Controller, Controller,
EFI_OPEN_PROTOCOL_GET_PROTOCOL EFI_OPEN_PROTOCOL_GET_PROTOCOL
@ -944,12 +944,9 @@ UsbMouseReset (
) )
{ {
USB_MOUSE_DEV *UsbMouseDevice; USB_MOUSE_DEV *UsbMouseDevice;
EFI_USB_IO_PROTOCOL *UsbIo;
UsbMouseDevice = USB_MOUSE_DEV_FROM_MOUSE_PROTOCOL (This); UsbMouseDevice = USB_MOUSE_DEV_FROM_MOUSE_PROTOCOL (This);
UsbIo = UsbMouseDevice->UsbIo;
MouseReportStatusCode ( MouseReportStatusCode (
UsbMouseDevice->DevicePath, UsbMouseDevice->DevicePath,
EFI_PROGRESS_CODE, EFI_PROGRESS_CODE,

View File

@ -41,9 +41,9 @@ Module Name: Service.h
// PCD_DXE_DATABASE_GENTOOL_VERSION is defined in Autogen.h // PCD_DXE_DATABASE_GENTOOL_VERSION is defined in Autogen.h
// and generated by PCD Database generation tool. // and generated by PCD Database generation tool.
// //
#if (PCD_SERVICE_DXE_DRIVER_VERSION != PCD_DXE_SERVICE_DRIVER_AUTOGEN_VERSION) //#if (PCD_SERVICE_DXE_DRIVER_VERSION != PCD_DXE_SERVICE_DRIVER_AUTOGEN_VERSION)
// #error "Please make sure the version of PCD Service DXE Driver and PCD DXE Database Generation Tool matches" // #error "Please make sure the version of PCD Service DXE Driver and PCD DXE Database Generation Tool matches"
#endif //#endif
// //
// Protocol Interface function declaration. // Protocol Interface function declaration.

View File

@ -41,9 +41,9 @@ Module Name: Service.h
// PCD_PEI_DATABASE_GENTOOL_VERSION is defined in Autogen.h // PCD_PEI_DATABASE_GENTOOL_VERSION is defined in Autogen.h
// and generated by PCD Database generation tool. // and generated by PCD Database generation tool.
// //
#if (PCD_SERVICE_PEIM_VERSION != PCD_PEI_SERVICE_DRIVER_AUTOGEN_VERSION ) //#if (PCD_SERVICE_PEIM_VERSION != PCD_PEI_SERVICE_DRIVER_AUTOGEN_VERSION )
// #error "Please make sure the version of PCD Service PEIM and PCD PEI Database Generation Tool matches" // #error "Please make sure the version of PCD Service PEIM and PCD PEI Database Generation Tool matches"
#endif //#endif
// //
// PPI Interface Implementation Declaration. // PPI Interface Implementation Declaration.

View File

@ -150,7 +150,6 @@ Returns:
--*/ --*/
{ {
UINTN Address; UINTN Address;
VOID *PlabelConvertAddress;
UINT64 VirtEndOfRange; UINT64 VirtEndOfRange;
EFI_MEMORY_DESCRIPTOR *VirtEntry; EFI_MEMORY_DESCRIPTOR *VirtEntry;
UINTN Index; UINTN Index;
@ -177,7 +176,6 @@ Returns:
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
PlabelConvertAddress = NULL;
VirtEntry = mVirtualMap; VirtEntry = mVirtualMap;
for (Index = 0; Index < mVirtualMapMaxIndex; Index++) { for (Index = 0; Index < mVirtualMapMaxIndex; Index++) {
// //