mirror of https://github.com/acidanthera/audk.git
ShellPkg: add size cast to bit operations
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15763 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
a81fcd30c1
commit
7aae3c355f
|
@ -1394,23 +1394,23 @@ ParseHandleDatabaseByRelationshipWithType (
|
||||||
// Set the bit describing what this handle has
|
// Set the bit describing what this handle has
|
||||||
//
|
//
|
||||||
if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiLoadedImageProtocolGuid) ) {
|
if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiLoadedImageProtocolGuid) ) {
|
||||||
(*HandleType)[HandleIndex] |= HR_IMAGE_HANDLE;
|
(*HandleType)[HandleIndex] |= (UINTN)HR_IMAGE_HANDLE;
|
||||||
} else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverBindingProtocolGuid) ) {
|
} else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverBindingProtocolGuid) ) {
|
||||||
(*HandleType)[HandleIndex] |= HR_DRIVER_BINDING_HANDLE;
|
(*HandleType)[HandleIndex] |= (UINTN)HR_DRIVER_BINDING_HANDLE;
|
||||||
} else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverConfiguration2ProtocolGuid)) {
|
} else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverConfiguration2ProtocolGuid)) {
|
||||||
(*HandleType)[HandleIndex] |= HR_DRIVER_CONFIGURATION_HANDLE;
|
(*HandleType)[HandleIndex] |= (UINTN)HR_DRIVER_CONFIGURATION_HANDLE;
|
||||||
} else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverConfigurationProtocolGuid) ) {
|
} else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverConfigurationProtocolGuid) ) {
|
||||||
(*HandleType)[HandleIndex] |= HR_DRIVER_CONFIGURATION_HANDLE;
|
(*HandleType)[HandleIndex] |= (UINTN)HR_DRIVER_CONFIGURATION_HANDLE;
|
||||||
} else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverDiagnostics2ProtocolGuid) ) {
|
} else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverDiagnostics2ProtocolGuid) ) {
|
||||||
(*HandleType)[HandleIndex] |= HR_DRIVER_DIAGNOSTICS_HANDLE;
|
(*HandleType)[HandleIndex] |= (UINTN)HR_DRIVER_DIAGNOSTICS_HANDLE;
|
||||||
} else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverDiagnosticsProtocolGuid) ) {
|
} else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverDiagnosticsProtocolGuid) ) {
|
||||||
(*HandleType)[HandleIndex] |= HR_DRIVER_DIAGNOSTICS_HANDLE;
|
(*HandleType)[HandleIndex] |= (UINTN)HR_DRIVER_DIAGNOSTICS_HANDLE;
|
||||||
} else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiComponentName2ProtocolGuid) ) {
|
} else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiComponentName2ProtocolGuid) ) {
|
||||||
(*HandleType)[HandleIndex] |= HR_COMPONENT_NAME_HANDLE;
|
(*HandleType)[HandleIndex] |= (UINTN)HR_COMPONENT_NAME_HANDLE;
|
||||||
} else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiComponentNameProtocolGuid) ) {
|
} else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiComponentNameProtocolGuid) ) {
|
||||||
(*HandleType)[HandleIndex] |= HR_COMPONENT_NAME_HANDLE;
|
(*HandleType)[HandleIndex] |= (UINTN)HR_COMPONENT_NAME_HANDLE;
|
||||||
} else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDevicePathProtocolGuid) ) {
|
} else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDevicePathProtocolGuid) ) {
|
||||||
(*HandleType)[HandleIndex] |= HR_DEVICE_HANDLE;
|
(*HandleType)[HandleIndex] |= (UINTN)HR_DEVICE_HANDLE;
|
||||||
} else {
|
} else {
|
||||||
DEBUG_CODE_BEGIN();
|
DEBUG_CODE_BEGIN();
|
||||||
ASSERT((*HandleType)[HandleIndex] == (*HandleType)[HandleIndex]);
|
ASSERT((*HandleType)[HandleIndex] == (*HandleType)[HandleIndex]);
|
||||||
|
@ -1436,19 +1436,19 @@ ParseHandleDatabaseByRelationshipWithType (
|
||||||
//
|
//
|
||||||
for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) {
|
for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) {
|
||||||
if (OpenInfo[OpenInfoIndex].AgentHandle == DriverBindingHandle && (OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) != 0) {
|
if (OpenInfo[OpenInfoIndex].AgentHandle == DriverBindingHandle && (OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) != 0) {
|
||||||
(*HandleType)[HandleIndex] |= (HR_DEVICE_HANDLE | HR_CONTROLLER_HANDLE);
|
(*HandleType)[HandleIndex] |= (UINTN)(HR_DEVICE_HANDLE | HR_CONTROLLER_HANDLE);
|
||||||
if (DriverBindingHandleIndex != -1) {
|
if (DriverBindingHandleIndex != -1) {
|
||||||
(*HandleType)[DriverBindingHandleIndex] |= HR_DEVICE_DRIVER;
|
(*HandleType)[DriverBindingHandleIndex] |= (UINTN)HR_DEVICE_DRIVER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (OpenInfo[OpenInfoIndex].AgentHandle == DriverBindingHandle && (OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
|
if (OpenInfo[OpenInfoIndex].AgentHandle == DriverBindingHandle && (OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
|
||||||
(*HandleType)[HandleIndex] |= (HR_DEVICE_HANDLE | HR_CONTROLLER_HANDLE);
|
(*HandleType)[HandleIndex] |= (UINTN)(HR_DEVICE_HANDLE | HR_CONTROLLER_HANDLE);
|
||||||
if (DriverBindingHandleIndex != -1) {
|
if (DriverBindingHandleIndex != -1) {
|
||||||
(*HandleType)[DriverBindingHandleIndex] |= (HR_BUS_DRIVER | HR_DEVICE_DRIVER);
|
(*HandleType)[DriverBindingHandleIndex] |= (UINTN)(HR_BUS_DRIVER | HR_DEVICE_DRIVER);
|
||||||
}
|
}
|
||||||
for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) {
|
for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) {
|
||||||
if (OpenInfo[OpenInfoIndex].ControllerHandle == (*HandleBuffer)[ChildIndex]) {
|
if (OpenInfo[OpenInfoIndex].ControllerHandle == (*HandleBuffer)[ChildIndex]) {
|
||||||
(*HandleType)[ChildIndex] |= (HR_DEVICE_HANDLE | HR_CHILD_HANDLE);
|
(*HandleType)[ChildIndex] |= (UINTN)(HR_DEVICE_HANDLE | HR_CHILD_HANDLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1456,22 +1456,22 @@ ParseHandleDatabaseByRelationshipWithType (
|
||||||
}
|
}
|
||||||
if (DriverBindingHandle == NULL && ControllerHandle != NULL) {
|
if (DriverBindingHandle == NULL && ControllerHandle != NULL) {
|
||||||
if (ControllerHandle == (*HandleBuffer)[HandleIndex]) {
|
if (ControllerHandle == (*HandleBuffer)[HandleIndex]) {
|
||||||
(*HandleType)[HandleIndex] |= (HR_DEVICE_HANDLE | HR_CONTROLLER_HANDLE);
|
(*HandleType)[HandleIndex] |= (UINTN)(HR_DEVICE_HANDLE | HR_CONTROLLER_HANDLE);
|
||||||
for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) {
|
for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) {
|
||||||
if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) != 0) {
|
if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) != 0) {
|
||||||
for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) {
|
for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) {
|
||||||
if (OpenInfo[OpenInfoIndex].AgentHandle == (*HandleBuffer)[ChildIndex]) {
|
if (OpenInfo[OpenInfoIndex].AgentHandle == (*HandleBuffer)[ChildIndex]) {
|
||||||
(*HandleType)[ChildIndex] |= HR_DEVICE_DRIVER;
|
(*HandleType)[ChildIndex] |= (UINTN)HR_DEVICE_DRIVER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
|
if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
|
||||||
for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) {
|
for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) {
|
||||||
if (OpenInfo[OpenInfoIndex].AgentHandle == (*HandleBuffer)[ChildIndex]) {
|
if (OpenInfo[OpenInfoIndex].AgentHandle == (*HandleBuffer)[ChildIndex]) {
|
||||||
(*HandleType)[ChildIndex] |= (HR_BUS_DRIVER | HR_DEVICE_DRIVER);
|
(*HandleType)[ChildIndex] |= (UINTN)(HR_BUS_DRIVER | HR_DEVICE_DRIVER);
|
||||||
}
|
}
|
||||||
if (OpenInfo[OpenInfoIndex].ControllerHandle == (*HandleBuffer)[ChildIndex]) {
|
if (OpenInfo[OpenInfoIndex].ControllerHandle == (*HandleBuffer)[ChildIndex]) {
|
||||||
(*HandleType)[ChildIndex] |= (HR_DEVICE_HANDLE | HR_CHILD_HANDLE);
|
(*HandleType)[ChildIndex] |= (UINTN)(HR_DEVICE_HANDLE | HR_CHILD_HANDLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1480,7 +1480,7 @@ ParseHandleDatabaseByRelationshipWithType (
|
||||||
for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) {
|
for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) {
|
||||||
if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
|
if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
|
||||||
if (OpenInfo[OpenInfoIndex].ControllerHandle == ControllerHandle) {
|
if (OpenInfo[OpenInfoIndex].ControllerHandle == ControllerHandle) {
|
||||||
(*HandleType)[HandleIndex] |= (HR_DEVICE_HANDLE | HR_PARENT_HANDLE);
|
(*HandleType)[HandleIndex] |= (UINTN)(HR_DEVICE_HANDLE | HR_PARENT_HANDLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1488,12 +1488,12 @@ ParseHandleDatabaseByRelationshipWithType (
|
||||||
}
|
}
|
||||||
if (DriverBindingHandle != NULL && ControllerHandle != NULL) {
|
if (DriverBindingHandle != NULL && ControllerHandle != NULL) {
|
||||||
if (ControllerHandle == (*HandleBuffer)[HandleIndex]) {
|
if (ControllerHandle == (*HandleBuffer)[HandleIndex]) {
|
||||||
(*HandleType)[HandleIndex] |= (HR_DEVICE_HANDLE | HR_CONTROLLER_HANDLE);
|
(*HandleType)[HandleIndex] |= (UINTN)(HR_DEVICE_HANDLE | HR_CONTROLLER_HANDLE);
|
||||||
for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) {
|
for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) {
|
||||||
if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) != 0) {
|
if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) != 0) {
|
||||||
if (OpenInfo[OpenInfoIndex].AgentHandle == DriverBindingHandle) {
|
if (OpenInfo[OpenInfoIndex].AgentHandle == DriverBindingHandle) {
|
||||||
if (DriverBindingHandleIndex != -1) {
|
if (DriverBindingHandleIndex != -1) {
|
||||||
(*HandleType)[DriverBindingHandleIndex] |= HR_DEVICE_DRIVER;
|
(*HandleType)[DriverBindingHandleIndex] |= (UINTN)HR_DEVICE_DRIVER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1501,14 +1501,14 @@ ParseHandleDatabaseByRelationshipWithType (
|
||||||
if (OpenInfo[OpenInfoIndex].AgentHandle == DriverBindingHandle) {
|
if (OpenInfo[OpenInfoIndex].AgentHandle == DriverBindingHandle) {
|
||||||
for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) {
|
for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) {
|
||||||
if (OpenInfo[OpenInfoIndex].ControllerHandle == (*HandleBuffer)[ChildIndex]) {
|
if (OpenInfo[OpenInfoIndex].ControllerHandle == (*HandleBuffer)[ChildIndex]) {
|
||||||
(*HandleType)[ChildIndex] |= (HR_DEVICE_HANDLE | HR_CHILD_HANDLE);
|
(*HandleType)[ChildIndex] |= (UINTN)(HR_DEVICE_HANDLE | HR_CHILD_HANDLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) {
|
for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) {
|
||||||
if (OpenInfo[OpenInfoIndex].AgentHandle == (*HandleBuffer)[ChildIndex]) {
|
if (OpenInfo[OpenInfoIndex].AgentHandle == (*HandleBuffer)[ChildIndex]) {
|
||||||
(*HandleType)[ChildIndex] |= (HR_BUS_DRIVER | HR_DEVICE_DRIVER);
|
(*HandleType)[ChildIndex] |= (UINTN)(HR_BUS_DRIVER | HR_DEVICE_DRIVER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1517,7 +1517,7 @@ ParseHandleDatabaseByRelationshipWithType (
|
||||||
for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) {
|
for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) {
|
||||||
if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
|
if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
|
||||||
if (OpenInfo[OpenInfoIndex].ControllerHandle == ControllerHandle) {
|
if (OpenInfo[OpenInfoIndex].ControllerHandle == ControllerHandle) {
|
||||||
(*HandleType)[HandleIndex] |= (HR_DEVICE_HANDLE | HR_PARENT_HANDLE);
|
(*HandleType)[HandleIndex] |= (UINTN)(HR_DEVICE_HANDLE | HR_PARENT_HANDLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue