seL4/include/model/smp.h
Hesham Almatary ee28936d48 SMP: Introduce ENABLE_SMP_SUPPORT
- Make it more readable and less confusing compared to the 'CONFIG_MAX_NUM_NODES > 1' check
2017-06-29 16:23:39 +10:00

36 lines
998 B
C

/*
* Copyright 2017, Data61
* Commonwealth Scientific and Industrial Research Organisation (CSIRO)
* ABN 41 687 119 230.
*
* This software may be distributed and modified according to the terms of
* the GNU General Public License version 2. Note that NO WARRANTY is provided.
* See "LICENSE_GPLv2.txt" for details.
*
* @TAG(DATA61_GPL)
*/
#ifndef __MODEL_SMP_H_
#define __MODEL_SMP_H_
#include <config.h>
#include <arch/types.h>
#include <arch/model/statedata.h>
#include <model/statedata.h>
#ifdef ENABLE_SMP_SUPPORT
/* Use this to avoid false sharing between cores for per-core data structures */
#define PAD_TO_NEXT_CACHE_LN(used) char padding[L1_CACHE_LINE_SIZE - ((used) % L1_CACHE_LINE_SIZE)]
typedef struct smpStatedata {
archNodeState_t cpu;
nodeState_t system;
PAD_TO_NEXT_CACHE_LN(sizeof(archNodeState_t) + sizeof(nodeState_t));
} smpStatedata_t;
extern smpStatedata_t ksSMP[CONFIG_MAX_NUM_NODES];
#endif /* ENABLE_SMP_SUPPORT */
#endif /* __MODEL_SMP_H_ */