diff options
| author | George Harris <ashandore@gmail.com> | 2020-01-25 22:35:39 +0100 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2020-01-25 13:35:39 -0800 |
| commit | e9ffc5347690ad2212d7217e406fb6018ed17079 (patch) | |
| tree | f7c34e84d0dc3c641332ded9e9a748f13fd55390 /tmk_core | |
| parent | 480a391929de9e66d36c84df900c49297c7dfec0 (diff) | |
| download | qmk_firmware-e9ffc5347690ad2212d7217e406fb6018ed17079.tar.gz qmk_firmware-e9ffc5347690ad2212d7217e406fb6018ed17079.zip | |
Fix unaligned access with LTO (#7801)
Forces 4 byte alignment for USB input & output buffers to prevent unaligned accesses by chibios with LTO enabled
Diffstat (limited to 'tmk_core')
| -rw-r--r-- | tmk_core/protocol/chibios/usb_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index 9981477a5..2617c73c1 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c | |||
| @@ -227,8 +227,8 @@ typedef struct { | |||
| 227 | .in_size = stream##_EPSIZE, \ | 227 | .in_size = stream##_EPSIZE, \ |
| 228 | .out_size = stream##_EPSIZE, \ | 228 | .out_size = stream##_EPSIZE, \ |
| 229 | .fixed_size = fixedsize, \ | 229 | .fixed_size = fixedsize, \ |
| 230 | .ib = (uint8_t[BQ_BUFFER_SIZE(stream##_IN_CAPACITY, stream##_EPSIZE)]){}, \ | 230 | .ib = (__attribute__((aligned(4))) uint8_t[BQ_BUFFER_SIZE(stream##_IN_CAPACITY, stream##_EPSIZE)]){}, \ |
| 231 | .ob = (uint8_t[BQ_BUFFER_SIZE(stream##_OUT_CAPACITY, stream##_EPSIZE)]){}, \ | 231 | .ob = (__attribute__((aligned(4))) uint8_t[BQ_BUFFER_SIZE(stream##_OUT_CAPACITY, stream##_EPSIZE)]){}, \ |
| 232 | } \ | 232 | } \ |
| 233 | } | 233 | } |
| 234 | 234 | ||
