From 4d8872bcface446b127cf2ff0979a656096b7a23 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Wed, 12 Oct 2011 02:09:57 -0700 Subject: [PATCH] fix alignment bug --- drivers/net/mmnif.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/mmnif.c b/drivers/net/mmnif.c index 3281e9dd..9d81ee77 100644 --- a/drivers/net/mmnif.c +++ b/drivers/net/mmnif.c @@ -91,7 +91,7 @@ */ #if MMNIF_USE_MPB -#define MMNIF_RX_BUFFERLEN (2*1024) +#define MMNIF_RX_BUFFERLEN (7*1024) #else #define MMNIF_RX_BUFFERLEN (8*1024) #endif @@ -999,9 +999,6 @@ err_t mmnif_init(struct netif *netif) */ heap_size = MMNIF_RX_BUFFERLEN; - // align mpb size to the granularity of a page size - heap_size = (heap_size + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1); - #if MMNIF_USE_MPB heap_start_address = RCCE_malloc(RCCE_LINE_SIZE); DEBUGPRINTF("MessagePassingBuffer allocated @ : %p\n", heap_start_address); @@ -1015,6 +1012,9 @@ err_t mmnif_init(struct netif *netif) } #else + // align size to the granularity of a page size + heap_size = (heap_size + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1); + heap_start_address = (void*) RCCE_shmalloc(heap_size * MMNIF_CORES); DEBUGPRINTF("RCCE_shmalloc : %p (size %u)\n", header_start_address, MMNIF_CORES * header_size);