staging: csr: clean up csr_types.h a bit
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / staging / csr / csr_types.h
1 #ifndef CSR_TYPES_H__
2 #define CSR_TYPES_H__
3 /*****************************************************************************
4
5             (c) Cambridge Silicon Radio Limited 2010
6             All rights reserved and confidential information of CSR
7
8             Refer to LICENSE.txt included with this source for details
9             on the license terms.
10
11 *****************************************************************************/
12
13 #include <linux/stddef.h>
14 #include <linux/kernel.h>
15 #include <linux/types.h>
16 #include <linux/string.h>
17 #include <asm/byteorder.h>
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 #undef  FALSE
24 #define FALSE (0)
25
26 #undef  TRUE
27 #define TRUE (1)
28
29 /* Basic types */
30 typedef size_t CsrSize;         /* Return type of sizeof (ISO/IEC 9899:1990 7.1.6) */
31 typedef ptrdiff_t CsrPtrdiff;   /* Type of the result of subtracting two pointers (ISO/IEC 9899:1990 7.1.6) */
32 typedef uintptr_t CsrUintptr;   /* Unsigned integer large enough to hold any pointer (ISO/IEC 9899:1999 7.18.1.4) */
33 typedef ptrdiff_t CsrIntptr;    /* intptr_t is not defined in kernel. Use the equivalent ptrdiff_t. */
34
35 /* Unsigned fixed width types */
36 typedef uint8_t CsrUint8;
37 typedef uint16_t CsrUint16;
38 typedef uint32_t CsrUint32;
39
40 /* Signed fixed width types */
41 typedef int8_t CsrInt8;
42 typedef int16_t CsrInt16;
43 typedef int32_t CsrInt32;
44
45 /* Boolean */
46 typedef CsrUint8 CsrBool;
47
48 /* String types */
49 typedef char CsrCharString;
50 typedef CsrUint8 CsrUtf8String;
51 typedef CsrUint16 CsrUtf16String;   /* 16-bit UTF16 strings */
52 typedef CsrUint32 CsrUint24;
53
54 /*
55  * 64-bit integers
56  *
57  * Note: If a given compiler does not support 64-bit types, it is
58  * OK to omit these definitions;  32-bit versions of the code using
59  * these types may be available.  Consult the relevant documentation
60  * or the customer support group for information on this.
61  */
62 #define CSR_HAVE_64_BIT_INTEGERS
63 typedef uint64_t CsrUint64;
64 typedef int64_t CsrInt64;
65
66
67 #ifdef __cplusplus
68 }
69 #endif
70
71 #endif