aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/backtrace.c
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2011-11-02 23:02:17 -0400
committerChris Metcalf <cmetcalf@tilera.com>2011-11-03 16:58:54 -0400
commiteb7c792da5afa3b9ec3e802c30952f82d2e9722b (patch)
treedb796193297d4cc14bdb4d2b8001750a1f515f17 /arch/tile/kernel/backtrace.c
parentaeddea5d37d86d38c7a347110d8a052e9f45d955 (diff)
arch/tile: factor out <arch/opcode.h> header
The kernel code was using some <asm> headers that included a mix of hardware-specific information (typically found in Tilera <arch> headers) and structures, enums, and function declarations supporting the disassembly function of the tile-desc.c sources. This change refactors that code so that a hardware-specific, but OS- and application-agnostic header, is created: <arch/opcode.h>. This header is then exported to userspace along with the other <arch> headers and can be used to build userspace code; in particular, it is used by glibc as part of implementing the backtrace() function. The new header, together with a header that specifically describes the disassembly code (<asm/tile-desc.h> with _32 and _64 variants), replaces the old <asm/opcode-tile*.h> and <asm/opcode_constants*.h> headers. As part of this change, we are also renaming the 32-bit constants from TILE_xxx to TILEPRO_xxx to better reflect the fact that they are specific to the TILEPro architecture, and not to TILE-Gx and any successor "tile" architecture chips. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile/kernel/backtrace.c')
-rw-r--r--arch/tile/kernel/backtrace.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/arch/tile/kernel/backtrace.c b/arch/tile/kernel/backtrace.c
index 1dc71eabfc5a..9092ce8aa6b4 100644
--- a/arch/tile/kernel/backtrace.c
+++ b/arch/tile/kernel/backtrace.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright 2010 Tilera Corporation. All Rights Reserved. 2 * Copyright 2011 Tilera Corporation. All Rights Reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or 4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License 5 * modify it under the terms of the GNU General Public License
@@ -15,13 +15,11 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/string.h> 16#include <linux/string.h>
17#include <asm/backtrace.h> 17#include <asm/backtrace.h>
18#include <asm/opcode-tile.h> 18#include <asm/tile-desc.h>
19#include <arch/abi.h> 19#include <arch/abi.h>
20 20
21#ifdef __tilegx__ 21#ifdef __tilegx__
22#define tile_bundle_bits tilegx_bundle_bits
23#define TILE_MAX_INSTRUCTIONS_PER_BUNDLE TILEGX_MAX_INSTRUCTIONS_PER_BUNDLE 22#define TILE_MAX_INSTRUCTIONS_PER_BUNDLE TILEGX_MAX_INSTRUCTIONS_PER_BUNDLE
24#define TILE_BUNDLE_ALIGNMENT_IN_BYTES TILEGX_BUNDLE_ALIGNMENT_IN_BYTES
25#define tile_decoded_instruction tilegx_decoded_instruction 23#define tile_decoded_instruction tilegx_decoded_instruction
26#define tile_mnemonic tilegx_mnemonic 24#define tile_mnemonic tilegx_mnemonic
27#define parse_insn_tile parse_insn_tilegx 25#define parse_insn_tile parse_insn_tilegx
@@ -35,7 +33,18 @@
35#define OPCODE_STORE TILEGX_OPC_ST 33#define OPCODE_STORE TILEGX_OPC_ST
36typedef long long bt_int_reg_t; 34typedef long long bt_int_reg_t;
37#else 35#else
38#define OPCODE_STORE TILE_OPC_SW 36#define TILE_MAX_INSTRUCTIONS_PER_BUNDLE TILEPRO_MAX_INSTRUCTIONS_PER_BUNDLE
37#define tile_decoded_instruction tilepro_decoded_instruction
38#define tile_mnemonic tilepro_mnemonic
39#define parse_insn_tile parse_insn_tilepro
40#define TILE_OPC_IRET TILEPRO_OPC_IRET
41#define TILE_OPC_ADDI TILEPRO_OPC_ADDI
42#define TILE_OPC_ADDLI TILEPRO_OPC_ADDLI
43#define TILE_OPC_INFO TILEPRO_OPC_INFO
44#define TILE_OPC_INFOL TILEPRO_OPC_INFOL
45#define TILE_OPC_JRP TILEPRO_OPC_JRP
46#define TILE_OPC_MOVE TILEPRO_OPC_MOVE
47#define OPCODE_STORE TILEPRO_OPC_SW
39typedef int bt_int_reg_t; 48typedef int bt_int_reg_t;
40#endif 49#endif
41 50