xref: /spdk/lib/ftl/utils/ftl_defs.h (revision 510f4c134a21b45ff3a5add9ebc6c6cf7e49aeab)
1 /*   SPDX-License-Identifier: BSD-3-Clause
2  *   Copyright (c) Intel Corporation.
3  *   All rights reserved.
4  */
5 
6 #ifndef FTL_DEFS_H
7 #define FTL_DEFS_H
8 
9 #include "spdk/stdinc.h"
10 
11 #ifndef KiB
12 #define KiB (1ULL << 10)
13 #endif
14 
15 #ifndef MiB
16 #define MiB (1ULL << 20)
17 #endif
18 
19 #ifndef GiB
20 #define GiB (1ULL << 30)
21 #endif
22 
23 #ifndef TiB
24 #define TiB (1ULL << 40)
25 #endif
26 
27 #define ftl_abort()		\
28 	do {			\
29 		assert(false);	\
30 		abort();	\
31 	} while (0)
32 
33 #define ftl_bug(cond)				\
34 	do {					\
35 		if (spdk_unlikely((cond))) {	\
36 			ftl_abort();		\
37 		}				\
38 	} while (0)
39 
40 #define FTL_INVALID_VALUE		((uint64_t)-1)
41 #define FTL_BAND_ID_INVALID		FTL_INVALID_VALUE
42 #define FTL_BAND_PHYS_ID_INVALID	FTL_INVALID_VALUE
43 
44 #endif /* FTL_DEFS_H */
45