File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -219,9 +219,14 @@ pub fn module(ts: TokenStream) -> TokenStream {
219219
220220 const {param_name}: __{name}_{param_name} = __{name}_{param_name};
221221
222- // FIXME: does the `align` do the right thing here?
223- // `core::mem::size_of(usize)`
224- #[repr(C,align(8))]
222+ // Note: the C macro that generates the static structs for the `__param` section
223+ // asks for them to be `aligned(sizeof(void *))`. However, that was put in place
224+ // in 2003 in commit 38d5b085d2 (\" [PATCH] Fix over-alignment problem on x86-64\" )
225+ // to undo GCC over-alignment of static structs of >32 bytes. It seems that is
226+ // not the case anymore, so we simplify to a transparent representation here
227+ // in the expectation that it is not needed anymore.
228+ // TODO: revisit this to confirm the above comment and remove it if it happened
229+ #[repr(transparent)]
225230 struct __{name}_{param_name}_RacyKernelParam(kernel::bindings::kernel_param);
226231
227232 unsafe impl Sync for __{name}_{param_name}_RacyKernelParam {{
You can’t perform that action at this time.
0 commit comments