aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@redhat.com>2006-02-25 01:34:09 +0000
committerDavid S. Miller <davem@redhat.com>2006-02-25 01:34:09 +0000
commit10156f834aaa08d496723f79ddc0da1a7b1416bd (patch)
treed200929fbf75b5cdcbe481556c5ea6caf36660d4
parentff3f9d5b2aa1a57de59495d64b77ded11bd4def2 (diff)
downloadgdb-10156f834aaa08d496723f79ddc0da1a7b1416bd.zip
gdb-10156f834aaa08d496723f79ddc0da1a7b1416bd.tar.gz
gdb-10156f834aaa08d496723f79ddc0da1a7b1416bd.tar.bz2
2006-02-24 David S. Miller <davem@sunset.davemloft.net>
* config/tc-sparc.c (priv_reg_table): Add entry for "gl". (hpriv_reg_table): New table for hyperprivileged registers. (sparc_ip): New cases '$' and '%' for wrhpr/rdhpr hyperprivileged register encoding.
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-sparc.c50
2 files changed, 56 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index a484a9f..28b5575 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2006-02-24 David S. Miller <davem@sunset.davemloft.net>
+
+ * config/tc-sparc.c (priv_reg_table): Add entry for "gl".
+ (hpriv_reg_table): New table for hyperprivileged registers.
+ (sparc_ip): New cases '$' and '%' for wrhpr/rdhpr hyperprivileged
+ register encoding.
+
2006-02-24 DJ Delorie <dj@redhat.com>
* config/tc-m32c.h (md_apply_fix): Define to m32c_apply_fix.
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index b14c377..04bfb53 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -724,7 +724,7 @@ struct
{NULL, NULL, NULL},
};
-/* sparc64 privileged registers. */
+/* sparc64 privileged and hyperprivileged registers. */
struct priv_reg_entry
{
@@ -750,10 +750,22 @@ struct priv_reg_entry priv_reg_table[] =
{"otherwin", 13},
{"wstate", 14},
{"fq", 15},
+ {"gl", 16},
{"ver", 31},
{"", -1}, /* End marker. */
};
+struct priv_reg_entry hpriv_reg_table[] =
+{
+ {"hpstate", 0},
+ {"htstate", 1},
+ {"hintp", 3},
+ {"htba", 5},
+ {"hver", 6},
+ {"hstick_cmpr", 31},
+ {"", -1}, /* End marker. */
+};
+
/* v9a specific asrs. */
struct priv_reg_entry v9a_asr_table[] =
@@ -1572,6 +1584,42 @@ sparc_ip (str, pinsn)
goto error;
}
+ case '$':
+ case '%':
+ /* Parse a sparc64 hyperprivileged register. */
+ if (*s == '%')
+ {
+ struct priv_reg_entry *p = hpriv_reg_table;
+ unsigned int len = 9999999; /* Init to make gcc happy. */
+
+ s += 1;
+ while (p->name[0] > s[0])
+ p++;
+ while (p->name[0] == s[0])
+ {
+ len = strlen (p->name);
+ if (strncmp (p->name, s, len) == 0)
+ break;
+ p++;
+ }
+ if (p->name[0] != s[0])
+ {
+ error_message = _(": unrecognizable hyperprivileged register");
+ goto error;
+ }
+ if (*args == '$')
+ opcode |= (p->regnum << 14);
+ else
+ opcode |= (p->regnum << 25);
+ s += len;
+ continue;
+ }
+ else
+ {
+ error_message = _(": unrecognizable hyperprivileged register");
+ goto error;
+ }
+
case '_':
case '/':
/* Parse a v9a/v9b ancillary state register. */