Ignore:
Timestamp:
2023-07-25T13:09:37Z (15 months ago)
Author:
Vojtech Horky <vojtech.horky@…>
Branches:
ticket/834-toolchain-update
Children:
27bfbed
Parents:
1f6bf85
git-author:
Vojtech Horky <vojtech.horky@…> (2023-07-25 13:09:35)
git-committer:
Vojtech Horky <vojtech.horky@…> (2023-07-25 13:09:37)
Message:

Fix packed structures

attribute(packed) actually implies also align(1): thus
the compiler can place the whole structure to arbitrary address.
This commit fixes that by adding explicit align to some of
these structures (where compiler produced a warning).

Following reports explain the issues around packed attribute:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/hw_struct/context.h

    r1f6bf85 r4b992266  
    107107#define XHCI_EP_MAX_ESIT_PAYLOAD_HI(ctx) XHCI_DWORD_EXTRACT((ctx).data[0], 31, 24)
    108108
    109 } __attribute__((packed)) xhci_ep_ctx_t;
     109} __attribute__((packed)) __attribute__((aligned(8))) xhci_ep_ctx_t;
    110110
    111111enum {
     
    165165#define XHCI_SLOT_STATE(ctx)            XHCI_DWORD_EXTRACT((ctx).data[3], 31, 27)
    166166
    167 } __attribute__((packed)) xhci_slot_ctx_t;
     167} __attribute__((packed)) __attribute__((aligned(4))) xhci_slot_ctx_t;
    168168
    169169enum {
     
    222222#define XHCI_STREAM_DEQ_PTR_SET(ctx, val) \
    223223        xhci_qword_set_bits(&(ctx).data[0], (val >> 4), 63, 4)
    224 } __attribute__((packed)) xhci_stream_ctx_t;
     224} __attribute__((packed)) __attribute__((aligned(8))) xhci_stream_ctx_t;
    225225
    226226/**
Note: See TracChangeset for help on using the changeset viewer.