Changeset View
Changeset View
Standalone View
Standalone View
stand/libsa/zalloc_defs.h
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
* Required malloc alignment. | * Required malloc alignment. | ||||
* | * | ||||
* Embedded platforms using the u-boot API drivers require that all I/O buffers | * Embedded platforms using the u-boot API drivers require that all I/O buffers | ||||
* be on a cache line sized boundary. The worst case size for that is 64 bytes. | * be on a cache line sized boundary. The worst case size for that is 64 bytes. | ||||
* For other platforms, 16 bytes works fine. The alignment also must be at | * For other platforms, 16 bytes works fine. The alignment also must be at | ||||
* least sizeof(struct MemNode); this is asserted in zalloc.c. | * least sizeof(struct MemNode); this is asserted in zalloc.c. | ||||
*/ | */ | ||||
#if defined(__arm__) || defined(__mips__) || defined(__powerpc__) | #if defined(__arm__) || defined(__powerpc__) | ||||
#define MALLOCALIGN 64 | #define MALLOCALIGN 64 | ||||
#else | #else | ||||
#define MALLOCALIGN 16 | #define MALLOCALIGN 16 | ||||
#endif | #endif | ||||
#define MALLOCALIGN_MASK (MALLOCALIGN - 1) | #define MALLOCALIGN_MASK (MALLOCALIGN - 1) | ||||
typedef struct Guard { | typedef struct Guard { | ||||
size_t ga_Bytes; | size_t ga_Bytes; | ||||
Show All 9 Lines |