1272343Sngie/* TI COFF information for Texas Instruments TMS320C54X. 2272343Sngie This file customizes the settings in coff/ti.h. 3272343Sngie 4272343Sngie Copyright (C) 2000-2022 Free Software Foundation, Inc. 5272343Sngie 6272343Sngie This program is free software; you can redistribute it and/or modify 7272343Sngie it under the terms of the GNU General Public License as published by 8272343Sngie the Free Software Foundation; either version 3 of the License, or 9272343Sngie (at your option) any later version. 10272343Sngie 11272343Sngie This program is distributed in the hope that it will be useful, 12272343Sngie but WITHOUT ANY WARRANTY; without even the implied warranty of 13272343Sngie MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14272343Sngie GNU General Public License for more details. 15272343Sngie 16272343Sngie You should have received a copy of the GNU General Public License 17272343Sngie along with this program; if not, write to the Free Software 18272343Sngie Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 19272343Sngie MA 02110-1301, USA. */ 20272343Sngie 21272343Sngie#ifndef COFF_TIC54X_H 22272343Sngie#define COFF_TIC54X_H 23272343Sngie 24272343Sngie#define TIC54X_TARGET_ID 0x98 25272343Sngie#define TIC54XALGMAGIC 0x009B /* c54x algebraic assembler output */ 26272343Sngie#define TIC5X_TARGET_ID 0x92 27272343Sngie#define TI_TARGET_ID TIC54X_TARGET_ID 28272343Sngie#define OCTETS_PER_BYTE_POWER 1 /* octets per byte, as a power of two */ 29272343Sngie#define HOWTO_BANK 6 /* add to howto to get absolute/sect-relative version */ 30272343Sngie#define TICOFF_TARGET_ARCH bfd_arch_tic54x 31272343Sngie#define TICOFF_DEFAULT_MAGIC TICOFF1MAGIC /* we use COFF1 for compatibility */ 32272343Sngie 33272343Sngie/* Page macros 34272343Sngie 35272343Sngie The first GDB port requires flags in its remote memory access commands to 36272343Sngie distinguish between data/prog space. Hopefully we can make this go away 37272343Sngie eventually. Stuff the page in the upper bits of a 32-bit address, since 38272343Sngie the c5x family only uses 16 or 23 bits. 39272343Sngie 40272343Sngie c2x, c5x and most c54x devices have 16-bit addresses, but the c548 has 41272343Sngie 23-bit program addresses. Make sure the page flags don't interfere. 42272343Sngie These flags are used by GDB to identify the destination page for 43272343Sngie addresses. 44272343Sngie*/ 45272343Sngie 46272343Sngie/* Recognized load pages (by common convention). */ 47272343Sngie#define PG_PROG 0x0 /* PROG page */ 48272343Sngie#define PG_DATA 0x1 /* DATA page */ 49272343Sngie#define PG_IO 0x2 /* I/O page */ 50272343Sngie 51272343Sngie/** Indicate whether the given storage class requires a page flag. */ 52272343Sngie#define NEEDS_PAGE(X) ((X)==C_EXT) 53272343Sngie#define PAGE_MASK 0xFF000000 54272343Sngie#define ADDR_MASK 0x00FFFFFF 55272343Sngie#define PG_TO_FLAG(p) (((unsigned long)(p) & 0xFF) << 24) 56272343Sngie#define FLAG_TO_PG(f) (((f) >> 24) & 0xFF) 57272343Sngie 58272343Sngie#include "coff/ti.h" 59272343Sngie 60272343Sngie#endif /* COFF_TIC54X_H */ 61272343Sngie