aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@ozlabs.ru>2019-10-22 13:53:42 +1100
committerAlexey Kardashevskiy <aik@ozlabs.ru>2019-10-22 14:15:41 +1100
commitd3596133f47546d76c47c301a19c35f294ded9ad (patch)
tree973f30ddfd0d8d881a7f52551d4d0fba2137b880 /lib
parentf7f312e7e66ef9c9f222743877f1b1444a1c39c2 (diff)
downloadSLOF-d3596133f47546d76c47c301a19c35f294ded9ad.zip
SLOF-d3596133f47546d76c47c301a19c35f294ded9ad.tar.gz
SLOF-d3596133f47546d76c47c301a19c35f294ded9ad.tar.bz2
libusb: Fix compiler warnings with gcc9
gcc9 enforces -Waddress-of-packed-member, fix this. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'lib')
-rw-r--r--lib/libusb/usb-core.h2
-rw-r--r--lib/libusb/usb-ehci.h4
-rw-r--r--lib/libusb/usb-ohci.h2
-rw-r--r--lib/libusb/usb-xhci.h14
4 files changed, 11 insertions, 11 deletions
diff --git a/lib/libusb/usb-core.h b/lib/libusb/usb-core.h
index 070aab5..d27107f 100644
--- a/lib/libusb/usb-core.h
+++ b/lib/libusb/usb-core.h
@@ -55,7 +55,7 @@ struct usb_ep_descr {
uint8_t bmAttributes;
uint16_t wMaxPacketSize;
uint8_t bInterval;
-} __attribute__((packed));
+} __attribute__((packed, aligned(4)));
#define DEV_HID_KEYB 0x030101 /* class=HIB, protocol=Keyboard */
#define DEV_HID_MOUSE 0x030102 /* class=HIB, protocol=Mouse */
diff --git a/lib/libusb/usb-ehci.h b/lib/libusb/usb-ehci.h
index 2955a9c..05ffb52 100644
--- a/lib/libusb/usb-ehci.h
+++ b/lib/libusb/usb-ehci.h
@@ -29,7 +29,7 @@ struct ehci_cap_regs {
uint32_t hcsparams;
uint32_t hccparams;
uint64_t portroute;
-} __attribute__ ((packed));
+} __attribute__ ((packed, aligned(4)));
struct ehci_op_regs {
uint32_t usbcmd;
@@ -42,7 +42,7 @@ struct ehci_op_regs {
uint32_t reserved[9];
uint32_t configflag;
uint32_t portsc[0];
-} __attribute__ ((packed));
+} __attribute__ ((packed, aligned(4)));
struct ehci_framelist {
uint32_t fl_ptr[FL_SIZE];
diff --git a/lib/libusb/usb-ohci.h b/lib/libusb/usb-ohci.h
index f4535fd..a373634 100644
--- a/lib/libusb/usb-ohci.h
+++ b/lib/libusb/usb-ohci.h
@@ -47,7 +47,7 @@ struct ohci_regs {
uint32_t rh_desc_b;
uint32_t rh_status;
uint32_t rh_ps[5];
-} __attribute__((packed));
+} __attribute__((packed, aligned(4)));
#define EDA_FADDR(x) ((x & 0x7F))
#define EDA_EP(x) ((x & 0x0F) << 7)
diff --git a/lib/libusb/usb-xhci.h b/lib/libusb/usb-xhci.h
index 02b382b..8e94a4b 100644
--- a/lib/libusb/usb-xhci.h
+++ b/lib/libusb/usb-xhci.h
@@ -37,7 +37,7 @@ struct xhci_cap_regs {
#define XHCI_HCCPARAMS_XECP(x) ((x & 0xFFFF0000) >> 16)
uint32_t dboff;
uint32_t rtsoff;
-} __attribute__ ((packed));
+} __attribute__ ((packed, aligned(4)));
/* USB 3.0: Section 7 and 7.2 */
#define XHCI_XECP_CAP_ID(x) ((x & 0xF))
@@ -90,7 +90,7 @@ struct xhci_port_regs {
uint32_t portpmsc;
uint32_t portli;
uint32_t reserved;
-} __attribute__ ((packed));
+} __attribute__ ((packed, aligned(4)));
struct port_state {
bool PP;
@@ -132,7 +132,7 @@ struct xhci_op_regs {
/* USB Port register set */
#define XHCI_PORT_MAX 256
struct xhci_port_regs prs[XHCI_PORT_MAX];
-} __attribute__ ((packed));
+} __attribute__ ((packed, aligned(8)));
/*
* 5.5.2 Interrupter Register Set
@@ -148,7 +148,7 @@ struct xhci_int_regs {
#define XHCI_ERST_ADDR_MASK (~(0x3FUL))
uint64_t erdp;
#define XHCI_ERDP_MASK (~(0xFUL))
-} __attribute__ ((packed));
+} __attribute__ ((packed, aligned(8)));
/* 5.5 Host Controller Runtime Registers */
struct xhci_run_regs {
@@ -156,12 +156,12 @@ struct xhci_run_regs {
uint8_t reserved[28];
#define XHCI_IRS_MAX 1024
struct xhci_int_regs irs[XHCI_IRS_MAX];
-} __attribute__ ((packed));
+} __attribute__ ((packed, aligned(8)));
/* 5.6 Doorbell Registers*/
struct xhci_db_regs {
uint32_t db[256];
-} __attribute__ ((packed));
+} __attribute__ ((packed, aligned(4)));
#define COMP_SUCCESS 1
@@ -259,7 +259,7 @@ struct xhci_erst_entry {
uint64_t addr;
uint32_t size;
uint32_t reserved;
-} __attribute__ ((packed));
+} __attribute__ ((packed, aligned(8)));
struct xhci_erst {
struct xhci_erst_entry *entries;