Skip to content
Snippets Groups Projects
Commit 97929877 authored by Stefan Kristiansson's avatar Stefan Kristiansson Committed by Remy Bohmer
Browse files

usb: align usb_endpoint_descriptor to 16-bit boundary


The usb_endpoint_descriptor struct is 7 bytes large and is
defined as an array (ep_desc[USB_MAXENDPOINTS])
in the usb_interface struct in include/usb.h

This fact will result in that every odd index in that
array will start at an uneven address, this in
turn makes accesses to u16 wMaxPacketSize unaligned.
Such accesses are illegal on the OpenRISC architecture
(as well as other architectures) and will render a bus error.

Setting the aligned(2) attribute on usb_endpoint_descriptor
will force wMaxPacketSize to a 16-bit boundary.

Signed-off-by: default avatarStefan Kristiansson <stefan.kristiansson@saunalahti.fi>
parent 241d9a61
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment