Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://github.com/cmetcalf-tilera/linux-tile
Browse files Browse the repository at this point in the history
* '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>
  • Loading branch information
torvalds committed Nov 4, 2011
2 parents 6736c04 + eb7c792 commit 1583171
Show file tree
Hide file tree
Showing 20 changed files with 4,637 additions and 4,396 deletions.
17 changes: 17 additions & 0 deletions arch/tile/include/arch/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
header-y += abi.h
header-y += chip.h
header-y += chip_tile64.h
header-y += chip_tilegx.h
header-y += chip_tilepro.h
header-y += icache.h
header-y += interrupts.h
header-y += interrupts_32.h
header-y += interrupts_64.h
header-y += opcode.h
header-y += opcode_tilegx.h
header-y += opcode_tilepro.h
header-y += sim.h
header-y += sim_def.h
header-y += spr_def.h
header-y += spr_def_32.h
header-y += spr_def_64.h
99 changes: 72 additions & 27 deletions arch/tile/include/arch/abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,78 @@
/**
* @file
*
* ABI-related register definitions helpful when writing assembly code.
* ABI-related register definitions.
*/

#ifndef __ARCH_ABI_H__
#define __ARCH_ABI_H__

#include <arch/chip.h>
#if !defined __need_int_reg_t && !defined __DOXYGEN__
# define __ARCH_ABI_H__
# include <arch/chip.h>
#endif

/* Provide the basic machine types. */
#ifndef __INT_REG_BITS

/** Number of bits in a register. */
#if defined __tilegx__
# define __INT_REG_BITS 64
#elif defined __tilepro__
# define __INT_REG_BITS 32
#elif !defined __need_int_reg_t
# include <arch/chip.h>
# define __INT_REG_BITS CHIP_WORD_SIZE()
#else
# error Unrecognized architecture with __need_int_reg_t
#endif

#if __INT_REG_BITS == 64

#ifndef __ASSEMBLER__
/** Unsigned type that can hold a register. */
typedef unsigned long long __uint_reg_t;

/** Signed type that can hold a register. */
typedef long long __int_reg_t;
#endif

/** String prefix to use for printf(). */
#define __INT_REG_FMT "ll"

#else

#ifndef __ASSEMBLER__
/** Unsigned type that can hold a register. */
typedef unsigned long __uint_reg_t;

/** Signed type that can hold a register. */
typedef long __int_reg_t;
#endif

/** String prefix to use for printf(). */
#define __INT_REG_FMT "l"

#endif
#endif /* __INT_REG_BITS */


#ifndef __need_int_reg_t


#ifndef __ASSEMBLER__
/** Unsigned type that can hold a register. */
typedef __uint_reg_t uint_reg_t;

/** Signed type that can hold a register. */
typedef __int_reg_t int_reg_t;
#endif

/** String prefix to use for printf(). */
#define INT_REG_FMT __INT_REG_FMT

/** Number of bits in a register. */
#define INT_REG_BITS __INT_REG_BITS


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

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

/**
* The operand to an 'info' opcode directing the backtracer to not
* try to find the calling frame.
*/
#define INFO_OP_CANNOT_BACKTRACE 2

#ifndef __ASSEMBLER__
#if CHIP_WORD_SIZE() > 32

/** Unsigned type that can hold a register. */
typedef unsigned long long uint_reg_t;
#endif /* !__need_int_reg_t */

/** Signed type that can hold a register. */
typedef long long int_reg_t;

/** String prefix to use for printf(). */
#define INT_REG_FMT "ll"

#elif !defined(__LP64__) /* avoid confusion with LP64 cross-build tools */

/** Unsigned type that can hold a register. */
typedef unsigned long uint_reg_t;

/** Signed type that can hold a register. */
typedef long int_reg_t;

/** String prefix to use for printf(). */
#define INT_REG_FMT "l"

#endif
#endif /* __ASSEMBLER__ */
/* Make sure we later can get all the definitions and declarations. */
#undef __need_int_reg_t

#endif /* !__ARCH_ABI_H__ */
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010 Tilera Corporation. All Rights Reserved.
* Copyright 2011 Tilera Corporation. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand All @@ -12,15 +12,10 @@
* more details.
*/

#ifndef _ASM_TILE_OPCODE_CONSTANTS_H
#define _ASM_TILE_OPCODE_CONSTANTS_H

#include <arch/chip.h>

#if CHIP_WORD_SIZE() == 64
#include <asm/opcode_constants_64.h>
#if defined(__tilepro__)
#include <arch/opcode_tilepro.h>
#elif defined(__tilegx__)
#include <arch/opcode_tilegx.h>
#else
#include <asm/opcode_constants_32.h>
#error Unexpected Tilera chip type
#endif

#endif /* _ASM_TILE_OPCODE_CONSTANTS_H */
Loading

0 comments on commit 1583171

Please sign in to comment.