Skip to content

Commit

Permalink
Align packetbuf on an even 32-bit boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
simonduq committed Dec 3, 2014
1 parent b6b5c6e commit c0d6b11
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/net/packetbuf.c
Expand Up @@ -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;
Expand Down

0 comments on commit c0d6b11

Please sign in to comment.