Jon Medhurst | 15ce78d | 2014-04-10 09:02:02 +0100 | [diff] [blame] | 1 | /** |
Jon Medhurst | b1d0744 | 2015-05-08 12:04:18 +0100 | [diff] [blame] | 2 | * Copyright (C) ARM Limited 2010-2015. All rights reserved. |
Jon Medhurst | 15ce78d | 2014-04-10 09:02:02 +0100 | [diff] [blame] | 3 | * |
| 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 Medhurst | 96b5615 | 2014-10-30 18:01:15 +0000 | [diff] [blame] | 13 | #define ACCESS_ONCE(x) (*(volatile typeof(x)*)&(x)) |
Jon Medhurst | 15ce78d | 2014-04-10 09:02:02 +0100 | [diff] [blame] | 14 | |
| 15 | #define MAX_PERFORMANCE_COUNTERS 50 |
Jon Medhurst | 96b5615 | 2014-10-30 18:01:15 +0000 | [diff] [blame] | 16 | #define NR_CPUS 32 |
| 17 | |
| 18 | template<typename T> |
| 19 | static inline T min(const T a, const T b) { |
| 20 | return (a < b ? a : b); |
| 21 | } |
| 22 | |
| 23 | template<typename T> |
| 24 | static inline T max(const T a, const T b) { |
| 25 | return (a > b ? a : b); |
| 26 | } |
Jon Medhurst | 15ce78d | 2014-04-10 09:02:02 +0100 | [diff] [blame] | 27 | |
| 28 | #endif // CONFIG_H |