Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47224 )
Change subject: libpayload: Use typedef for OHCI enums ......................................................................
libpayload: Use typedef for OHCI enums
The OHCI header file declares various enums as follows:
enum { ... } enum_name;
Since the name is at the end, this is actually declaring a variable called enum_name and *not* a type, which is causing a multiple definition error in GCC 10. Add typedef to each enum so it declares a type to prevent this.
Signed-off-by: Jacob Garber jgarber1@ualberta.ca Change-Id: I452c0a1b118990942aa53f1e7e77f5e8378e8975 --- M payloads/libpayload/drivers/usb/ohci_private.h 1 file changed, 16 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/47224/1
diff --git a/payloads/libpayload/drivers/usb/ohci_private.h b/payloads/libpayload/drivers/usb/ohci_private.h index 796be29..aa51490 100644 --- a/payloads/libpayload/drivers/usb/ohci_private.h +++ b/payloads/libpayload/drivers/usb/ohci_private.h @@ -36,7 +36,7 @@ // FIXME: fake typedef enum { CMD} reg;
- enum { + typedef enum { NumberDownstreamPorts = 1 << 0, PowerSwitchingMode = 1 << 8, NoPowerSwitching = 1 << 9, @@ -46,17 +46,17 @@ PowerOnToPowerGoodTime = 1 << 24 } HcRhDescriptorAReg;
- enum { + typedef enum { NumberDownstreamPortsMask = MASK(0, 8), PowerOnToPowerGoodTimeMask = MASK(24, 8) } HcRhDescriptorAMask;
- enum { + typedef enum { DeviceRemovable = 1 << 0, PortPowerControlMask = 1 << 16 } HcRhDescriptorBReg;
- enum { + typedef enum { CurrentConnectStatus = 1 << 0, PortEnableStatus = 1 << 1, PortSuspendStatus = 1 << 2, @@ -70,7 +70,8 @@ PortOverCurrentIndicatorChange = 1 << 19, PortResetStatusChange = 1 << 20 } HcRhPortStatusRead; - enum { + + typedef enum { ClearPortEnable = 1 << 0, SetPortEnable = 1 << 1, SetPortSuspend = 1 << 2, @@ -80,7 +81,7 @@ ClearPortPower = 1 << 9, } HcRhPortStatusSet;
- enum { + typedef enum { LocalPowerStatus = 1 << 0, OverCurrentIndicator = 1 << 1, DeviceRemoteWakeupEnable = 1 << 15, @@ -89,18 +90,19 @@ ClearRemoteWakeupEnable = 1 << 31 } HcRhStatusReg;
- enum { + typedef enum { FrameInterval = 1 << 0, FSLargestDataPacket = 1 << 16, FrameIntervalToggle = 1 << 31 } HcFmIntervalOffset; - enum { + + typedef enum { FrameIntervalMask = MASK(0, 14), FSLargestDataPacketMask = MASK(16, 15), FrameIntervalToggleMask = MASK(31, 1) } HcFmIntervalMask;
- enum { + typedef enum { ControlBulkServiceRatio = 1 << 0, PeriodicListEnable = 1 << 2, IsochronousEnable = 1 << 3, @@ -112,7 +114,7 @@ RemoteWakeupEnable = 1 << 10 } HcControlReg;
- enum { + typedef enum { ControlBulkServiceRatioMask = MASK(0, 2), HostControllerFunctionalStateMask = MASK(6, 2) } HcControlMask; @@ -124,7 +126,7 @@ USBSuspend = 3*HostControllerFunctionalState };
- enum { + typedef enum { HostControllerReset = 1 << 0, ControlListFilled = 1 << 1, BulkListFilled = 1 << 2, @@ -132,16 +134,16 @@ SchedulingOverrunCount = 1 << 16 } HcCommandStatusReg;
- enum { + typedef enum { SchedulingOverrunCountMask = MASK(16, 2) } HcCommandStatusMask;
- enum { + typedef enum { FrameRemaining = 1 << 0, FrameRemainingToggle = 1 << 31 } HcFmRemainingReg;
- enum { + typedef enum { SchedulingOverrung = 1 << 0, WritebackDoneHead = 1 << 1, StartofFrame = 1 << 2,