xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/arch/tic6x.c (revision 6881a4007f077b54e5f51159c52b9b25f57deb0d)
1*6881a400Schristos /* Copyright (C) 2017-2023 Free Software Foundation, Inc.
27f2ac410Schristos 
37f2ac410Schristos    This file is part of GDB.
47f2ac410Schristos 
57f2ac410Schristos    This program is free software; you can redistribute it and/or modify
67f2ac410Schristos    it under the terms of the GNU General Public License as published by
77f2ac410Schristos    the Free Software Foundation; either version 3 of the License, or
87f2ac410Schristos    (at your option) any later version.
97f2ac410Schristos 
107f2ac410Schristos    This program is distributed in the hope that it will be useful,
117f2ac410Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
127f2ac410Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
137f2ac410Schristos    GNU General Public License for more details.
147f2ac410Schristos 
157f2ac410Schristos    You should have received a copy of the GNU General Public License
167f2ac410Schristos    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
177f2ac410Schristos 
187d62b00eSchristos #include "gdbsupport/tdesc.h"
197f2ac410Schristos #include "tic6x.h"
207d62b00eSchristos #include "gdbsupport/common-defs.h"
217f2ac410Schristos 
227f2ac410Schristos #include "../features/tic6x-core.c"
237f2ac410Schristos #include "../features/tic6x-gp.c"
247f2ac410Schristos #include "../features/tic6x-c6xp.c"
257f2ac410Schristos 
267f2ac410Schristos /* Create tic6x target descriptions according to FEATURE.  */
277f2ac410Schristos 
287f2ac410Schristos target_desc *
297f2ac410Schristos tic6x_create_target_description (enum c6x_feature feature)
307f2ac410Schristos {
31*6881a400Schristos   target_desc_up tdesc = allocate_target_description ();
327f2ac410Schristos 
33*6881a400Schristos   set_tdesc_architecture (tdesc.get (), "tic6x");
34*6881a400Schristos   set_tdesc_osabi (tdesc.get (), "GNU/Linux");
357f2ac410Schristos 
367f2ac410Schristos   long regnum = 0;
377f2ac410Schristos 
38*6881a400Schristos   regnum = create_feature_tic6x_core (tdesc.get (), regnum);
397f2ac410Schristos 
407f2ac410Schristos   if (feature == C6X_GP || feature == C6X_C6XP)
41*6881a400Schristos     regnum = create_feature_tic6x_gp (tdesc.get (), regnum);
427f2ac410Schristos 
437f2ac410Schristos   if (feature == C6X_C6XP)
44*6881a400Schristos     regnum = create_feature_tic6x_c6xp (tdesc.get (), regnum);
457f2ac410Schristos 
46*6881a400Schristos   return tdesc.release ();
477f2ac410Schristos }
48