Align packetbuf on an even 32-bit boundary

This commit is contained in:
Simon Duquennoy 2014-12-03 19:06:00 +01:00
parent b6b5c6efbb
commit c0d6b116d6

View file

@ -56,10 +56,10 @@ static uint16_t buflen, bufptr;
static uint8_t hdrptr;
/* The declarations below ensure that the packet buffer is aligned on
an even 16-bit boundary. On some platforms (most notably the
msp430), having apotentially misaligned packet buffer may lead to
problems when accessing 16-bit values. */
static uint16_t packetbuf_aligned[(PACKETBUF_SIZE + PACKETBUF_HDR_SIZE) / 2 + 1];
an even 32-bit boundary. On some platforms (most notably the
msp430 or OpenRISC), having a potentially misaligned packet buffer may lead to
problems when accessing words. */
static uint32_t packetbuf_aligned[(PACKETBUF_SIZE + PACKETBUF_HDR_SIZE + 3) / 4];
static uint8_t *packetbuf = (uint8_t *)packetbuf_aligned;
static uint8_t *packetbufptr;