blob: eb31556e6426a89bb2c2c185d8d8167b6b172fed [file] [log] [blame]
Jon Medhurst15ce78d2014-04-10 09:02:02 +01001/**
Jon Medhurstb1d07442015-05-08 12:04:18 +01002 * Copyright (C) ARM Limited 2010-2015. All rights reserved.
Jon Medhurst15ce78d2014-04-10 09:02:02 +01003 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef CONFIG_H
10#define CONFIG_H
11
12#define ARRAY_LENGTH(A) static_cast<int>(sizeof(A)/sizeof((A)[0]))
Jon Medhurst96b56152014-10-30 18:01:15 +000013#define ACCESS_ONCE(x) (*(volatile typeof(x)*)&(x))
Jon Medhurst15ce78d2014-04-10 09:02:02 +010014
15#define MAX_PERFORMANCE_COUNTERS 50
Jon Medhurst96b56152014-10-30 18:01:15 +000016#define NR_CPUS 32
17
18template<typename T>
19static inline T min(const T a, const T b) {
20 return (a < b ? a : b);
21}
22
23template<typename T>
24static inline T max(const T a, const T b) {
25 return (a > b ? a : b);
26}
Jon Medhurst15ce78d2014-04-10 09:02:02 +010027
28#endif // CONFIG_H