1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
3 * Copyright 2017 Tilera Corporation. All Rights Reserved.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation, version 2.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
12 * NON INFRINGEMENT. See the GNU General Public License for
19 * Provide types and defines for the type that can hold a register,
20 * in the implementation namespace.
23 #ifndef __ARCH_INTREG_H__
24 #define __ARCH_INTREG_H__
27 * Get number of bits in a register. __INT_REG_BITS may be defined
28 * prior to including this header to force a particular bit width.
31 #ifndef __INT_REG_BITS
32 # if defined __tilegx__
33 # define __INT_REG_BITS 64
34 # elif defined __tilepro__
35 # define __INT_REG_BITS 32
37 # error Unrecognized architecture
41 #if __INT_REG_BITS == 64
43 # ifndef __ASSEMBLER__
44 /** Unsigned type that can hold a register. */
45 typedef unsigned long long __uint_reg_t;
47 /** Signed type that can hold a register. */
48 typedef long long __int_reg_t;
51 /** String prefix to use for printf(). */
52 # define __INT_REG_FMT "ll"
54 #elif __INT_REG_BITS == 32
56 # ifndef __ASSEMBLER__
57 /** Unsigned type that can hold a register. */
58 typedef unsigned long __uint_reg_t;
60 /** Signed type that can hold a register. */
61 typedef long __int_reg_t;
64 /** String prefix to use for printf(). */
65 # define __INT_REG_FMT "l"
68 # error Unrecognized value of __INT_REG_BITS
71 #endif /* !__ARCH_INTREG_H__ */