[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 10/15] x86_64: expand and shrink messages in copy{in, out}msg
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 10/15] x86_64: expand and shrink messages in copy{in, out}msg routines |
Date: |
Tue, 4 Oct 2022 23:14:33 +0200 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
Luca, le mar. 04 oct. 2022 22:39:03 +0200, a ecrit:
> Il 30/08/22 07:57, Luca ha scritto:
> > Il 28/08/22 15:13, Samuel Thibault ha scritto:
> > > > + size_t n = size / 8;
> > > > + saddr += n*number;
> > > > + usize += n*number;
> > > > + align_inline(saddr, 4);
> > > > + align_inline(usize, 4);
> > >
> > > This should be alignof(some_align_type)
> >
> >
> > Will do.
>
> Thinking about it, I'm not sure about alignof(). For example, if I add
> something like
>
> #define MACH_MSG_ALIGNMENT alignof(rpc_vm_offset_t)
>
> then I'm assuming that the alignment of a data type with a given size is the
> same on 32-bit and 64-bit variants. While this is true on x86 up to 4-byte
> size, it's not true for 8-byte size. Specifically, on 32-bit this would be
Mmm, good point.
> For me it would be less confusing to just define it as 4.
Ok, but in a macro, please :)
So it's not spread along the code, but in a place that will be easy to
fix for various architectures.
Samuel