]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - arch/tile/include/uapi/arch/abi.h
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[mirror_ubuntu-artful-kernel.git] / arch / tile / include / uapi / arch / abi.h
1 /*
2 * Copyright 2010 Tilera Corporation. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details.
13 */
14
15 /**
16 * @file
17 *
18 * ABI-related register definitions.
19 */
20
21 #ifndef __ARCH_ABI_H__
22
23 #ifndef __tile__ /* support uncommon use of arch headers in non-tile builds */
24 # include <arch/chip.h>
25 # define __INT_REG_BITS CHIP_WORD_SIZE()
26 #endif
27
28 #include <arch/intreg.h>
29
30 /* __need_int_reg_t is deprecated: just include <arch/intreg.h> */
31 #ifndef __need_int_reg_t
32
33 #define __ARCH_ABI_H__
34
35 #ifndef __ASSEMBLER__
36 /** Unsigned type that can hold a register. */
37 typedef __uint_reg_t uint_reg_t;
38
39 /** Signed type that can hold a register. */
40 typedef __int_reg_t int_reg_t;
41 #endif
42
43 /** String prefix to use for printf(). */
44 #define INT_REG_FMT __INT_REG_FMT
45
46 /** Number of bits in a register. */
47 #define INT_REG_BITS __INT_REG_BITS
48
49
50 /* Registers 0 - 55 are "normal", but some perform special roles. */
51
52 #define TREG_FP 52 /**< Frame pointer. */
53 #define TREG_TP 53 /**< Thread pointer. */
54 #define TREG_SP 54 /**< Stack pointer. */
55 #define TREG_LR 55 /**< Link to calling function PC. */
56
57 /** Index of last normal general-purpose register. */
58 #define TREG_LAST_GPR 55
59
60 /* Registers 56 - 62 are "special" network registers. */
61
62 #define TREG_SN 56 /**< Static network access. */
63 #define TREG_IDN0 57 /**< IDN demux 0 access. */
64 #define TREG_IDN1 58 /**< IDN demux 1 access. */
65 #define TREG_UDN0 59 /**< UDN demux 0 access. */
66 #define TREG_UDN1 60 /**< UDN demux 1 access. */
67 #define TREG_UDN2 61 /**< UDN demux 2 access. */
68 #define TREG_UDN3 62 /**< UDN demux 3 access. */
69
70 /* Register 63 is the "special" zero register. */
71
72 #define TREG_ZERO 63 /**< "Zero" register; always reads as "0". */
73
74
75 /** By convention, this register is used to hold the syscall number. */
76 #define TREG_SYSCALL_NR 10
77
78 /** Name of register that holds the syscall number, for use in assembly. */
79 #define TREG_SYSCALL_NR_NAME r10
80
81
82 /**
83 * The ABI requires callers to allocate a caller state save area of
84 * this many bytes at the bottom of each stack frame.
85 */
86 #define C_ABI_SAVE_AREA_SIZE (2 * (INT_REG_BITS / 8))
87
88 /**
89 * The operand to an 'info' opcode directing the backtracer to not
90 * try to find the calling frame.
91 */
92 #define INFO_OP_CANNOT_BACKTRACE 2
93
94
95 #endif /* !__need_int_reg_t */
96
97 /* Make sure we later can get all the definitions and declarations. */
98 #undef __need_int_reg_t
99
100 #endif /* !__ARCH_ABI_H__ */