Re: aspeed: video frames pass-through

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




18.11.2015, 17:29, "Anton D. Kachalov" <mouse@xxxxxxxxxxxxxx>:
> Hi.
>
>
> struct {
>   uint16_t foo;
>   uint32_t bar;
> }
>
> What alignment would be on "bar" access (ptr address input for read_uint32)?

This might work:

uint32_t read_uint32(uint8_t *ptr) {
   return ptr[3] << 24 | ... | ptr[0];
}

but question in the byte-access overhead code versus memcpy code.

>
> May be better to use memcpy? It is align-safe.

memcpy should be definitely better choice for float/double reads/writes. Meanwhile, current protocol doesn't have such fields' types.

-- 
Anton D. Kachalov
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]