16ca2c52aSchristos /* TI COFF information for Texas Instruments TMS320C54X.
26ca2c52aSchristos    This file customizes the settings in coff/ti.h.
36ca2c52aSchristos 
4*184b2d41Schristos    Copyright (C) 2000-2020 Free Software Foundation, Inc.
56ca2c52aSchristos 
66ca2c52aSchristos    This program is free software; you can redistribute it and/or modify
76ca2c52aSchristos    it under the terms of the GNU General Public License as published by
86ca2c52aSchristos    the Free Software Foundation; either version 3 of the License, or
96ca2c52aSchristos    (at your option) any later version.
106ca2c52aSchristos 
116ca2c52aSchristos    This program is distributed in the hope that it will be useful,
126ca2c52aSchristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
136ca2c52aSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
146ca2c52aSchristos    GNU General Public License for more details.
156ca2c52aSchristos 
166ca2c52aSchristos    You should have received a copy of the GNU General Public License
176ca2c52aSchristos    along with this program; if not, write to the Free Software
186ca2c52aSchristos    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
196ca2c52aSchristos    MA 02110-1301, USA.  */
206ca2c52aSchristos 
216ca2c52aSchristos #ifndef COFF_TIC54X_H
226ca2c52aSchristos #define COFF_TIC54X_H
236ca2c52aSchristos 
246ca2c52aSchristos #define TIC54X_TARGET_ID 0x98
256ca2c52aSchristos #define TIC54XALGMAGIC  0x009B  /* c54x algebraic assembler output */
266ca2c52aSchristos #define TIC5X_TARGET_ID  0x92
276ca2c52aSchristos #define TI_TARGET_ID TIC54X_TARGET_ID
286ca2c52aSchristos #define OCTETS_PER_BYTE_POWER 1 /* octets per byte, as a power of two */
296ca2c52aSchristos #define HOWTO_BANK 6 /* add to howto to get absolute/sect-relative version */
306ca2c52aSchristos #define TICOFF_TARGET_ARCH bfd_arch_tic54x
316ca2c52aSchristos #define TICOFF_DEFAULT_MAGIC TICOFF1MAGIC /* we use COFF1 for compatibility */
326ca2c52aSchristos 
336ca2c52aSchristos /* Page macros
346ca2c52aSchristos 
356ca2c52aSchristos    The first GDB port requires flags in its remote memory access commands to
366ca2c52aSchristos    distinguish between data/prog space.  Hopefully we can make this go away
376ca2c52aSchristos    eventually.  Stuff the page in the upper bits of a 32-bit address, since
386ca2c52aSchristos    the c5x family only uses 16 or 23 bits.
396ca2c52aSchristos 
406ca2c52aSchristos    c2x, c5x and most c54x devices have 16-bit addresses, but the c548 has
416ca2c52aSchristos    23-bit program addresses.  Make sure the page flags don't interfere.
426ca2c52aSchristos    These flags are used by GDB to identify the destination page for
436ca2c52aSchristos    addresses.
446ca2c52aSchristos */
456ca2c52aSchristos 
466ca2c52aSchristos /* Recognized load pages (by common convention).  */
476ca2c52aSchristos #define PG_PROG         0x0         /* PROG page */
486ca2c52aSchristos #define PG_DATA         0x1         /* DATA page */
496ca2c52aSchristos #define PG_IO           0x2         /* I/O page */
506ca2c52aSchristos 
516ca2c52aSchristos /** Indicate whether the given storage class requires a page flag.  */
526ca2c52aSchristos #define NEEDS_PAGE(X) ((X)==C_EXT)
536ca2c52aSchristos #define PAGE_MASK       0xFF000000
546ca2c52aSchristos #define ADDR_MASK       0x00FFFFFF
556ca2c52aSchristos #define PG_TO_FLAG(p)   (((unsigned long)(p) & 0xFF) << 24)
566ca2c52aSchristos #define FLAG_TO_PG(f)   (((f) >> 24) & 0xFF)
576ca2c52aSchristos 
586ca2c52aSchristos #include "coff/ti.h"
596ca2c52aSchristos 
606ca2c52aSchristos #endif /* COFF_TIC54X_H */
61