Skip to content

Commit 1583171

Browse files
committed
Merge branch 'for-linus' of git://github.com/cmetcalf-tilera/linux-tile
* 'for-linus' of git://github.com/cmetcalf-tilera/linux-tile: arch/tile: factor out <arch/opcode.h> header arch/tile: add the <arch> headers to the set of installed kernel headers arch/tile: avoid exporting a symbol no longer used by gcc arch/tile: avoid ISO namespace pollution with <asm/sigcontext.h>
2 parents 6736c04 + eb7c792 commit 1583171

20 files changed

Lines changed: 4637 additions & 4396 deletions

‎arch/tile/include/arch/Kbuild‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
header-y += abi.h
2+
header-y += chip.h
3+
header-y += chip_tile64.h
4+
header-y += chip_tilegx.h
5+
header-y += chip_tilepro.h
6+
header-y += icache.h
7+
header-y += interrupts.h
8+
header-y += interrupts_32.h
9+
header-y += interrupts_64.h
10+
header-y += opcode.h
11+
header-y += opcode_tilegx.h
12+
header-y += opcode_tilepro.h
13+
header-y += sim.h
14+
header-y += sim_def.h
15+
header-y += spr_def.h
16+
header-y += spr_def_32.h
17+
header-y += spr_def_64.h

‎arch/tile/include/arch/abi.h‎

Lines changed: 72 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,78 @@
1515
/**
1616
* @file
1717
*
18-
* ABI-related register definitions helpful when writing assembly code.
18+
* ABI-related register definitions.
1919
*/
2020

2121
#ifndef __ARCH_ABI_H__
22-
#define __ARCH_ABI_H__
2322

24-
#include <arch/chip.h>
23+
#if !defined __need_int_reg_t && !defined __DOXYGEN__
24+
# define __ARCH_ABI_H__
25+
# include <arch/chip.h>
26+
#endif
27+
28+
/* Provide the basic machine types. */
29+
#ifndef __INT_REG_BITS
30+
31+
/** Number of bits in a register. */
32+
#if defined __tilegx__
33+
# define __INT_REG_BITS 64
34+
#elif defined __tilepro__
35+
# define __INT_REG_BITS 32
36+
#elif !defined __need_int_reg_t
37+
# include <arch/chip.h>
38+
# define __INT_REG_BITS CHIP_WORD_SIZE()
39+
#else
40+
# error Unrecognized architecture with __need_int_reg_t
41+
#endif
42+
43+
#if __INT_REG_BITS == 64
44+
45+
#ifndef __ASSEMBLER__
46+
/** Unsigned type that can hold a register. */
47+
typedef unsigned long long __uint_reg_t;
48+
49+
/** Signed type that can hold a register. */
50+
typedef long long __int_reg_t;
51+
#endif
52+
53+
/** String prefix to use for printf(). */
54+
#define __INT_REG_FMT "ll"
55+
56+
#else
57+
58+
#ifndef __ASSEMBLER__
59+
/** Unsigned type that can hold a register. */
60+
typedef unsigned long __uint_reg_t;
61+
62+
/** Signed type that can hold a register. */
63+
typedef long __int_reg_t;
64+
#endif
65+
66+
/** String prefix to use for printf(). */
67+
#define __INT_REG_FMT "l"
68+
69+
#endif
70+
#endif /* __INT_REG_BITS */
71+
72+
73+
#ifndef __need_int_reg_t
74+
75+
76+
#ifndef __ASSEMBLER__
77+
/** Unsigned type that can hold a register. */
78+
typedef __uint_reg_t uint_reg_t;
79+
80+
/** Signed type that can hold a register. */
81+
typedef __int_reg_t int_reg_t;
82+
#endif
83+
84+
/** String prefix to use for printf(). */
85+
#define INT_REG_FMT __INT_REG_FMT
86+
87+
/** Number of bits in a register. */
88+
#define INT_REG_BITS __INT_REG_BITS
89+
2590

2691
/* Registers 0 - 55 are "normal", but some perform special roles. */
2792

@@ -59,38 +124,18 @@
59124
* The ABI requires callers to allocate a caller state save area of
60125
* this many bytes at the bottom of each stack frame.
61126
*/
62-
#define C_ABI_SAVE_AREA_SIZE (2 * (CHIP_WORD_SIZE() / 8))
127+
#define C_ABI_SAVE_AREA_SIZE (2 * (INT_REG_BITS / 8))
63128

64129
/**
65130
* The operand to an 'info' opcode directing the backtracer to not
66131
* try to find the calling frame.
67132
*/
68133
#define INFO_OP_CANNOT_BACKTRACE 2
69134

70-
#ifndef __ASSEMBLER__
71-
#if CHIP_WORD_SIZE() > 32
72135

73-
/** Unsigned type that can hold a register. */
74-
typedef unsigned long long uint_reg_t;
136+
#endif /* !__need_int_reg_t */
75137

76-
/** Signed type that can hold a register. */
77-
typedef long long int_reg_t;
78-
79-
/** String prefix to use for printf(). */
80-
#define INT_REG_FMT "ll"
81-
82-
#elif !defined(__LP64__) /* avoid confusion with LP64 cross-build tools */
83-
84-
/** Unsigned type that can hold a register. */
85-
typedef unsigned long uint_reg_t;
86-
87-
/** Signed type that can hold a register. */
88-
typedef long int_reg_t;
89-
90-
/** String prefix to use for printf(). */
91-
#define INT_REG_FMT "l"
92-
93-
#endif
94-
#endif /* __ASSEMBLER__ */
138+
/* Make sure we later can get all the definitions and declarations. */
139+
#undef __need_int_reg_t
95140

96141
#endif /* !__ARCH_ABI_H__ */
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010 Tilera Corporation. All Rights Reserved.
2+
* Copyright 2011 Tilera Corporation. All Rights Reserved.
33
*
44
* This program is free software; you can redistribute it and/or
55
* modify it under the terms of the GNU General Public License
@@ -12,15 +12,10 @@
1212
* more details.
1313
*/
1414

15-
#ifndef _ASM_TILE_OPCODE_CONSTANTS_H
16-
#define _ASM_TILE_OPCODE_CONSTANTS_H
17-
18-
#include <arch/chip.h>
19-
20-
#if CHIP_WORD_SIZE() == 64
21-
#include <asm/opcode_constants_64.h>
15+
#if defined(__tilepro__)
16+
#include <arch/opcode_tilepro.h>
17+
#elif defined(__tilegx__)
18+
#include <arch/opcode_tilegx.h>
2219
#else
23-
#include <asm/opcode_constants_32.h>
20+
#error Unexpected Tilera chip type
2421
#endif
25-
26-
#endif /* _ASM_TILE_OPCODE_CONSTANTS_H */

0 commit comments

Comments
 (0)