VirtualBox

Changeset 50172 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Jan 23, 2014 5:21:08 AM (11 years ago)
Author:
vboxsync
Message:

Try to fix git commit 75f2c56558aee0f3476f170d2ccd96a28eeba710
imported as r91735 (before it falls through proverbial cracks).
Problem also reported upstream.

Apply LWIP_MEM_ALIGN() to memory bases for MEMP_OVERFLOW_CHECK == 1
too. Compensate for potential misalignment of memory bases by
providing padding with LWIP_MEM_ALIGN_BUFFER() like it's done for
memp_memory[].

Compile-tested only with appriate options that are not currently used.
Otherwise, the same binary code is generated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/lwip-new/src/core/memp.c

    r50171 r50172  
    202202 */
    203203#define LWIP_MEMPOOL(name,num,size,desc) u8_t memp_memory_ ## name ## _base \
    204   [((num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size)))];   
     204  [LWIP_MEM_ALIGN_BUFFER((num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size)))];   
    205205#include "lwip/memp_std.h"
    206206
     
    214214
    215215/** This is the actual memory used by the pools (all pools in one big block). */
    216 static u8_t memp_memory[MEM_ALIGNMENT - 1
     216static u8_t memp_memory[MEM_ALIGNMENT - 1 /* XXX: LWIP_MEM_ALIGN_BUFFER */
    217217#define LWIP_MEMPOOL(name,num,size,desc) + ( (num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size) ) )
    218218#include "lwip/memp_std.h"
     
    335335  for (i = 0; i < MEMP_MAX; ++i) {
    336336#if MEMP_SEPARATE_POOLS
    337     p = (struct memp *)(memp_bases[i]);
     337    p = (struct memp *)LWIP_MEM_ALIGN(memp_bases[i]);
    338338#endif /* MEMP_SEPARATE_POOLS */
    339339    for (j = 0; j < memp_num[i]; ++j) {
     
    347347  for (i = 0; i < MEMP_MAX; ++i) {
    348348#if MEMP_SEPARATE_POOLS
    349     p = (struct memp *)(memp_bases[i]);
     349    p = (struct memp *)LWIP_MEM_ALIGN(memp_bases[i]);
    350350#endif /* MEMP_SEPARATE_POOLS */
    351351    for (j = 0; j < memp_num[i]; ++j) {
     
    371371  for (i = 0; i < MEMP_MAX; ++i) {
    372372#if MEMP_SEPARATE_POOLS
    373     p = (struct memp *)(memp_bases[i]);
     373    p = (struct memp *)LWIP_MEM_ALIGN(memp_bases[i]);
    374374#endif /* MEMP_SEPARATE_POOLS */
    375375    for (j = 0; j < memp_num[i]; ++j) {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette