summaryrefslogtreecommitdiff
path: root/arch/tile/include/uapi/arch/intreg.h
blob: 1cf2fbf7430659a2708fd10343624ac8fc7708f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * Copyright 2017 Tilera Corporation. All Rights Reserved.
 *
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public License
 *   as published by the Free Software Foundation, version 2.
 *
 *   This program is distributed in the hope that it will be useful, but
 *   WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
 *   NON INFRINGEMENT.  See the GNU General Public License for
 *   more details.
 */

/**
 * @file
 *
 * Provide types and defines for the type that can hold a register,
 * in the implementation namespace.
 */

#ifndef __ARCH_INTREG_H__
#define __ARCH_INTREG_H__

/*
 * Get number of bits in a register.  __INT_REG_BITS may be defined
 * prior to including this header to force a particular bit width.
 */

#ifndef __INT_REG_BITS
# if defined __tilegx__
#  define __INT_REG_BITS 64
# elif defined __tilepro__
#  define __INT_REG_BITS 32
# else
#  error Unrecognized architecture
# endif
#endif

#if __INT_REG_BITS == 64

# ifndef __ASSEMBLER__
/** Unsigned type that can hold a register. */
typedef unsigned long long __uint_reg_t;

/** Signed type that can hold a register. */
typedef long long __int_reg_t;
# endif

/** String prefix to use for printf(). */
# define __INT_REG_FMT "ll"

#elif __INT_REG_BITS == 32

# ifndef __ASSEMBLER__
/** Unsigned type that can hold a register. */
typedef unsigned long __uint_reg_t;

/** Signed type that can hold a register. */
typedef long __int_reg_t;
# endif

/** String prefix to use for printf(). */
# define __INT_REG_FMT "l"

#else
# error Unrecognized value of __INT_REG_BITS
#endif

#endif /* !__ARCH_INTREG_H__ */