diff options
author | Jason Thorpe <thorpej@netbsd.org> | 2002-05-26 17:59:39 +0000 |
---|---|---|
committer | Jason Thorpe <thorpej@netbsd.org> | 2002-05-26 17:59:39 +0000 |
commit | 72e36ef519850c09b159d05cfb7dcc1fae1322b9 (patch) | |
tree | 1a9c287e1834dc39b6e6889701ec1cc703e676c2 /gdb/ns32k-tdep.c | |
parent | b6423c9b1441973e17a7fea8d166fc8b682e9296 (diff) | |
download | gdb-72e36ef519850c09b159d05cfb7dcc1fae1322b9.tar.gz |
* ns32k-tdep.c (ns32k_register_byte_32082,
ns32k_register_byte_32382, ns32k_register_raw_size,
ns32k_register_virtual_size, ns32k_register_virtual_type): New
functions.
* config/ns32k/tm-nbsd.h (REGISTER_BYTE): Define as
ns32k_register_byte_32382.
* config/ns32k/tm-umax.h: Update copyright years.
(REGISTER_BYTE): Define as ns32k_register_byte_32082.
(REGISTER_RAW_SIZE): Define as ns32k_register_raw_size.
(REGISTER_VIRTUAL_SIZE): Define as ns32k_register_virtual_size.
(REGISTER_VIRTUAL_TYPE): Define as ns32k_register_virtual_type.
(ns32k_get_enter_addr): Fix prototype.
Diffstat (limited to 'gdb/ns32k-tdep.c')
-rw-r--r-- | gdb/ns32k-tdep.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c index 4c2fd0fa90c..f6fb85fad2f 100644 --- a/gdb/ns32k-tdep.c +++ b/gdb/ns32k-tdep.c @@ -64,6 +64,59 @@ ns32k_register_name_32382 (int regno) return (register_names[regno]); } +int +ns32k_register_byte_32082 (int regno) +{ + if (regno >= LP0_REGNUM) + return (LP0_REGNUM * 4) + ((regno - LP0_REGNUM) * 8); + + return (regno * 4); +} + +int +ns32k_register_byte_32382 (int regno) +{ + /* This is a bit yuk. The even numbered double precision floating + point long registers occupy the same space as the even:odd numbered + single precision floating point registers, but the extra 32381 FPU + registers are at the end. Doing it this way is compatible for both + 32081 and 32381 equipped machines. */ + + return ((regno < LP0_REGNUM ? regno + : (regno - LP0_REGNUM) & 1 ? regno - 1 + : (regno - LP0_REGNUM + FP0_REGNUM)) * 4); +} + +int +ns32k_register_raw_size (int regno) +{ + /* All registers are 4 bytes, except for the doubled floating + registers. */ + + return ((regno >= LP0_REGNUM) ? 8 : 4); +} + +int +ns32k_register_virtual_size (int regno) +{ + return ((regno >= LP0_REGNUM) ? 8 : 4); +} + +struct type * +ns32k_register_virtual_type (int regno) +{ + if (regno < FP0_REGNUM) + return (builtin_type_int); + + if (regno < FP0_REGNUM + 8) + return (builtin_type_float); + + if (regno < LP0_REGNUM) + return (builtin_type_int); + + return (builtin_type_double); +} + /* Advance PC across any function entry prologue instructions to reach some "real" code. */ |