|
Packit Service |
97d2fb |
/* Register names and numbers for ARM DWARF.
|
|
Packit Service |
97d2fb |
Copyright (C) 2009 Red Hat, Inc.
|
|
Packit Service |
97d2fb |
This file is part of elfutils.
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
This file is free software; you can redistribute it and/or modify
|
|
Packit Service |
97d2fb |
it under the terms of either
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
* the GNU Lesser General Public License as published by the Free
|
|
Packit Service |
97d2fb |
Software Foundation; either version 3 of the License, or (at
|
|
Packit Service |
97d2fb |
your option) any later version
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
or
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
* the GNU General Public License as published by the Free
|
|
Packit Service |
97d2fb |
Software Foundation; either version 2 of the License, or (at
|
|
Packit Service |
97d2fb |
your option) any later version
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
or both in parallel, as here.
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
elfutils is distributed in the hope that it will be useful, but
|
|
Packit Service |
97d2fb |
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
97d2fb |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
97d2fb |
General Public License for more details.
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
You should have received copies of the GNU General Public License and
|
|
Packit Service |
97d2fb |
the GNU Lesser General Public License along with this program. If
|
|
Packit Service |
97d2fb |
not, see <http://www.gnu.org/licenses/>. */
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
#ifdef HAVE_CONFIG_H
|
|
Packit Service |
97d2fb |
# include <config.h>
|
|
Packit Service |
97d2fb |
#endif
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
#include <string.h>
|
|
Packit Service |
97d2fb |
#include <dwarf.h>
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
#define BACKEND arm_
|
|
Packit Service |
97d2fb |
#include "libebl_CPU.h"
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
ssize_t
|
|
Packit Service |
97d2fb |
arm_register_info (Ebl *ebl __attribute__ ((unused)),
|
|
Packit Service |
97d2fb |
int regno, char *name, size_t namelen,
|
|
Packit Service |
97d2fb |
const char **prefix, const char **setname,
|
|
Packit Service |
97d2fb |
int *bits, int *type)
|
|
Packit Service |
97d2fb |
{
|
|
Packit Service |
97d2fb |
if (name == NULL)
|
|
Packit Service |
97d2fb |
return 320;
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
if (regno < 0 || regno > 320 || namelen < 5)
|
|
Packit Service |
97d2fb |
return -1;
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
*prefix = "";
|
|
Packit Service |
97d2fb |
*bits = 32;
|
|
Packit Service |
97d2fb |
*type = DW_ATE_signed;
|
|
Packit Service |
97d2fb |
*setname = "integer";
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
switch (regno)
|
|
Packit Service |
97d2fb |
{
|
|
Packit Service |
97d2fb |
case 0 ... 9:
|
|
Packit Service |
97d2fb |
name[0] = 'r';
|
|
Packit Service |
97d2fb |
name[1] = regno + '0';
|
|
Packit Service |
97d2fb |
namelen = 2;
|
|
Packit Service |
97d2fb |
break;
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
case 10 ... 12:
|
|
Packit Service |
97d2fb |
name[0] = 'r';
|
|
Packit Service |
97d2fb |
name[1] = '1';
|
|
Packit Service |
97d2fb |
name[2] = regno % 10 + '0';
|
|
Packit Service |
97d2fb |
namelen = 3;
|
|
Packit Service |
97d2fb |
break;
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
case 13 ... 15:
|
|
Packit Service |
97d2fb |
*type = DW_ATE_address;
|
|
Packit Service |
97d2fb |
name[0] = "slp"[regno - 13];
|
|
Packit Service |
97d2fb |
name[1] = "prc"[regno - 13];
|
|
Packit Service |
97d2fb |
namelen = 2;
|
|
Packit Service |
97d2fb |
break;
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
case 16 + 0 ... 16 + 7:
|
|
Packit Service |
97d2fb |
regno += 96 - 16;
|
|
Packit Service |
97d2fb |
FALLTHROUGH;
|
|
Packit Service |
97d2fb |
case 96 + 0 ... 96 + 7:
|
|
Packit Service |
97d2fb |
*setname = "FPA";
|
|
Packit Service |
97d2fb |
*type = DW_ATE_float;
|
|
Packit Service |
97d2fb |
*bits = 96;
|
|
Packit Service |
97d2fb |
name[0] = 'f';
|
|
Packit Service |
97d2fb |
name[1] = regno - 96 + '0';
|
|
Packit Service |
97d2fb |
namelen = 2;
|
|
Packit Service |
97d2fb |
break;
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
case 128:
|
|
Packit Service |
97d2fb |
*type = DW_ATE_unsigned;
|
|
Packit Service |
97d2fb |
return stpcpy (name, "spsr") + 1 - name;
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
case 256 + 0 ... 256 + 9:
|
|
Packit Service |
97d2fb |
*setname = "VFP";
|
|
Packit Service |
97d2fb |
*type = DW_ATE_float;
|
|
Packit Service |
97d2fb |
*bits = 64;
|
|
Packit Service |
97d2fb |
name[0] = 'd';
|
|
Packit Service |
97d2fb |
name[1] = regno - 256 + '0';
|
|
Packit Service |
97d2fb |
namelen = 2;
|
|
Packit Service |
97d2fb |
break;
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
case 256 + 10 ... 256 + 31:
|
|
Packit Service |
97d2fb |
*setname = "VFP";
|
|
Packit Service |
97d2fb |
*type = DW_ATE_float;
|
|
Packit Service |
97d2fb |
*bits = 64;
|
|
Packit Service |
97d2fb |
name[0] = 'd';
|
|
Packit Service |
97d2fb |
name[1] = (regno - 256) / 10 + '0';
|
|
Packit Service |
97d2fb |
name[2] = (regno - 256) % 10 + '0';
|
|
Packit Service |
97d2fb |
namelen = 3;
|
|
Packit Service |
97d2fb |
break;
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
default:
|
|
Packit Service |
97d2fb |
*setname = NULL;
|
|
Packit Service |
97d2fb |
return 0;
|
|
Packit Service |
97d2fb |
}
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
name[namelen++] = '\0';
|
|
Packit Service |
97d2fb |
return namelen;
|
|
Packit Service |
97d2fb |
}
|