AW: [PATCH 3/3] i386: Port to RTEMS
Sebastian Huber
sebastian.huber at embedded-brains.de
Wed Feb 5 09:18:21 UTC 2020
On 05/02/2020 09:51, Jan.Sommer at dlr.de wrote:
>
>> -----Ursprüngliche Nachricht-----
>> Von: Sebastian Huber [mailto:sebastian.huber at embedded-brains.de]
>> Gesendet: Dienstag, 4. Februar 2020 17:15
>> An: rtems-devel at rtems.org
>> Cc: Sommer, Jan
>> Betreff: Re: [PATCH 3/3] i386: Port to RTEMS
>>
>> On 31/01/2020 18:26, Jan Sommer wrote:
>>
>>> diff --git a/freebsd/sys/sys/mbuf.h b/freebsd/sys/sys/mbuf.h
>>> index ba2e1873..95058e36 100644
>>> --- a/freebsd/sys/sys/mbuf.h
>>> +++ b/freebsd/sys/sys/mbuf.h
>>> @@ -348,6 +348,7 @@ struct mbuf_ext_pgs {
>>> vm_paddr_t pa[MBUF_PEXT_MAX_PGS]; /* phys addrs of pages
>> */
>>> char hdr[MBUF_PEXT_HDR_LEN]; /* TLS header */
>>> struct ktls_session *tls; /* TLS session */
>>> +#ifndef __rtems__
>>> #if defined(__i386__) || \
>>> (defined(__powerpc__) && !defined(__powerpc64__) &&
>> defined(BOOKE))
>>> /*
>>> @@ -356,6 +357,7 @@ struct mbuf_ext_pgs {
>>> */
>>> uint32_t pad;
>>> #endif
>>> +#endif /* __rtems__ */
>> This change also affects other targets. Why is it necessary?
> The comment inside this #if block says that for i386 targets the "vm_paddr_t" is 64 bit, but at least for i386-rtems it is only 32 bits and this affects the size of "pa" (will be 156 bytes).
> With "pad" included the whole "struct mbuf_ext_pgs" is 260 bytes and this will trigger the assert:
> ./freebsd/sys/kern/kern_mbuf.c:323:_Static_assert(sizeof(struct mbuf_ext_pgs) == 256
This discrepancy between RTEMS and FreeBSD with respect to the
vm_paddr_t for i386 could be an issue.
>
> You are right, the change as it stands changes the situation for other targets.
> Would something like this be acceptable?:
> #if defined(__rtems__) && !defined(__i386__)
>
> Or do you have a better suggestion?
Yes, please change the #if so that only i386 is affected.
More information about the devel
mailing list