diff --git a/include/device.h b/include/device.h index 93500d93373..19a091eecaf 100644 --- a/include/device.h +++ b/include/device.h @@ -108,7 +108,8 @@ extern "C" { .config_info = (cfg_info) \ }; \ static struct device _CONCAT(__device_, dev_name) __used \ - __attribute__((__section__(".init_" #level STRINGIFY(prio)))) = { \ + __attribute__((__section__(".init_" #level STRINGIFY(prio)), \ + aligned(__alignof(struct device)))) = { \ .config = &_CONCAT(__config_, dev_name), \ .driver_api = api, \ .driver_data = data \ @@ -165,7 +166,8 @@ extern "C" { .config_info = (cfg_info) \ }; \ static struct device _CONCAT(__device_, dev_name) __used \ - __attribute__((__section__(".init_" #level STRINGIFY(prio)))) = { \ + __attribute__((__section__(".init_" #level STRINGIFY(prio)), \ + aligned(__alignof(struct device)))) = { \ .config = &_CONCAT(__config_, dev_name), \ .driver_api = api, \ .driver_data = data, \ @@ -276,14 +278,6 @@ struct device { struct device_config *config; const void *driver_api; void *driver_data; -#if defined(__x86_64) && __SIZEOF_POINTER__ == 4 - /* The x32 ABI hits an edge case. This is a 12 byte struct, - * but the x86_64 linker will pack them only in units of 8 - * bytes, leading to alignment problems when iterating over - * the link-time array. - */ - void *padding; -#endif }; void z_sys_device_do_config_level(s32_t level);