1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
3 * Copyright 2010 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 * ABI-related register definitions.
22 #ifndef __ARCH_ABI_H__
24 #ifndef __tile__ /* support uncommon use of arch headers in non-tile builds */
25 # include <arch/chip.h>
26 # define __INT_REG_BITS CHIP_WORD_SIZE()
29 #include <arch/intreg.h>
31 /* __need_int_reg_t is deprecated: just include <arch/intreg.h> */
32 #ifndef __need_int_reg_t
34 #define __ARCH_ABI_H__
37 /** Unsigned type that can hold a register. */
38 typedef __uint_reg_t uint_reg_t;
40 /** Signed type that can hold a register. */
41 typedef __int_reg_t int_reg_t;
44 /** String prefix to use for printf(). */
45 #define INT_REG_FMT __INT_REG_FMT
47 /** Number of bits in a register. */
48 #define INT_REG_BITS __INT_REG_BITS
51 /* Registers 0 - 55 are "normal", but some perform special roles. */
53 #define TREG_FP 52 /**< Frame pointer. */
54 #define TREG_TP 53 /**< Thread pointer. */
55 #define TREG_SP 54 /**< Stack pointer. */
56 #define TREG_LR 55 /**< Link to calling function PC. */
58 /** Index of last normal general-purpose register. */
59 #define TREG_LAST_GPR 55
61 /* Registers 56 - 62 are "special" network registers. */
63 #define TREG_SN 56 /**< Static network access. */
64 #define TREG_IDN0 57 /**< IDN demux 0 access. */
65 #define TREG_IDN1 58 /**< IDN demux 1 access. */
66 #define TREG_UDN0 59 /**< UDN demux 0 access. */
67 #define TREG_UDN1 60 /**< UDN demux 1 access. */
68 #define TREG_UDN2 61 /**< UDN demux 2 access. */
69 #define TREG_UDN3 62 /**< UDN demux 3 access. */
71 /* Register 63 is the "special" zero register. */
73 #define TREG_ZERO 63 /**< "Zero" register; always reads as "0". */
76 /** By convention, this register is used to hold the syscall number. */
77 #define TREG_SYSCALL_NR 10
79 /** Name of register that holds the syscall number, for use in assembly. */
80 #define TREG_SYSCALL_NR_NAME r10
84 * The ABI requires callers to allocate a caller state save area of
85 * this many bytes at the bottom of each stack frame.
87 #define C_ABI_SAVE_AREA_SIZE (2 * (INT_REG_BITS / 8))
90 * The operand to an 'info' opcode directing the backtracer to not
91 * try to find the calling frame.
93 #define INFO_OP_CANNOT_BACKTRACE 2
96 #endif /* !__need_int_reg_t */
98 /* Make sure we later can get all the definitions and declarations. */
99 #undef __need_int_reg_t
101 #endif /* !__ARCH_ABI_H__ */