aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-06-27 01:45:30 +0000
committerNick Clifton <nickc@redhat.com>2000-06-27 01:45:30 +0000
commit65aa24b6e8082b40bb8de63732b35908cbfd088a (patch)
treefdf3cf5418105392e2b0cc7fec1c89ee566de17b /gas
parentcc040812f5558d0d2b9c876ea0bfbb3c46e9b6dd (diff)
downloadgdb-65aa24b6e8082b40bb8de63732b35908cbfd088a.zip
gdb-65aa24b6e8082b40bb8de63732b35908cbfd088a.tar.gz
gdb-65aa24b6e8082b40bb8de63732b35908cbfd088a.tar.bz2
Applied Marek Michalkiewicz <marekm@linux.org.pl>'s patch to ehance the AVR port.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog12
-rw-r--r--gas/config/tc-avr.c50
2 files changed, 39 insertions, 23 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 8173884..fdbd4d6 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,15 @@
+2000-06-26 Marek Michalkiewicz <marekm@linux.org.pl>
+
+ * config/tc-avr.c (mcu_types): Rename avr4 to avr5, add avr4.
+ Add more MCU types for avr4 and avr5. Replace at94k{10,20,40}
+ with just at94k. Change AVR_ISA_85xx back to AVR_ISA_2xxx.
+ (md_show_usage): Update usage message.
+ (md_parse_option): Allow redefinition of MCU type within the
+ same avr[1-5] bfd machine type. Show both old and new MCU type
+ in the error message.
+ (md_apply_fix3): Support 8K wrap if AVR_ISA_MEGA is not set.
+ Simplify 8K wrap code.
+
2000-06-25 Kazu Hirata <kazu@hxi.com>
* config/obj-aout.c: Remove all uses of DEFUN.
diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c
index d93b16b..97f614d 100644
--- a/gas/config/tc-avr.c
+++ b/gas/config/tc-avr.c
@@ -59,9 +59,10 @@ struct mcu_type_s
static struct mcu_type_s mcu_types[] =
{
{"avr1", AVR_ISA_TINY1, bfd_mach_avr1},
- {"avr2", AVR_ISA_85xx, bfd_mach_avr2},
+ {"avr2", AVR_ISA_2xxx, bfd_mach_avr2},
{"avr3", AVR_ISA_M103, bfd_mach_avr3},
- {"avr4", AVR_ISA_ALL, bfd_mach_avr4},
+ {"avr4", AVR_ISA_M83, bfd_mach_avr4},
+ {"avr5", AVR_ISA_ALL, bfd_mach_avr5},
{"at90s1200", AVR_ISA_1200, bfd_mach_avr1},
{"attiny10", AVR_ISA_TINY1, bfd_mach_avr1},
{"attiny11", AVR_ISA_TINY1, bfd_mach_avr1},
@@ -76,15 +77,17 @@ static struct mcu_type_s mcu_types[] =
{"at90s4433", AVR_ISA_2xxx, bfd_mach_avr2},
{"at90s4414", AVR_ISA_2xxx, bfd_mach_avr2},
{"at90s4434", AVR_ISA_2xxx, bfd_mach_avr2},
- {"at90s8515", AVR_ISA_85xx, bfd_mach_avr2},
- {"at90s8535", AVR_ISA_85xx, bfd_mach_avr2},
- {"at90c8534", AVR_ISA_85xx, bfd_mach_avr2},
+ {"at90s8515", AVR_ISA_2xxx, bfd_mach_avr2},
+ {"at90s8535", AVR_ISA_2xxx, bfd_mach_avr2},
+ {"at90c8534", AVR_ISA_2xxx, bfd_mach_avr2},
{"atmega603", AVR_ISA_M603, bfd_mach_avr3},
{"atmega103", AVR_ISA_M103, bfd_mach_avr3},
- {"atmega161", AVR_ISA_M161, bfd_mach_avr4},
- {"at94k10", AVR_ISA_94K, bfd_mach_avr4},
- {"at94k20", AVR_ISA_94K, bfd_mach_avr4},
- {"at94k40", AVR_ISA_94K, bfd_mach_avr4},
+ {"atmega83", AVR_ISA_M83, bfd_mach_avr4},
+ {"atmega85", AVR_ISA_M83, bfd_mach_avr4},
+ {"atmega161", AVR_ISA_M161, bfd_mach_avr5},
+ {"atmega163", AVR_ISA_M161, bfd_mach_avr5},
+ {"atmega32", AVR_ISA_M161, bfd_mach_avr5},
+ {"at94k", AVR_ISA_94K, bfd_mach_avr5},
{NULL, 0, 0}
};
@@ -204,10 +207,11 @@ md_show_usage (stream)
_ ("AVR options:\n"
" -mmcu=[avr-name] select microcontroller variant\n"
" [avr-name] can be:\n"
- " avr1 - AT90S1200\n"
- " avr2 - AT90S2xxx, AT90S4xxx, AT90S85xx, ATtiny22\n"
- " avr3 - ATmega103 or ATmega603\n"
- " avr4 - ATmega161\n"
+ " avr1 - AT90S1200, ATtiny1x, ATtiny28\n"
+ " avr2 - AT90S2xxx, AT90S4xxx, AT90S8xxx, ATtiny22\n"
+ " avr3 - ATmega103, ATmega603\n"
+ " avr4 - ATmega83, ATmega85\n"
+ " avr5 - ATmega161, ATmega163, ATmega32, AT94K\n"
" or immediate microcontroller name.\n"));
}
@@ -244,10 +248,16 @@ md_parse_option (c, arg)
if (!mcu_types[i].name)
as_fatal (_ ("unknown MCU: %s\n"), arg);
- if (avr_mcu == &default_mcu)
+
+ /* It is OK to redefine mcu type within the same avr[1-5] bfd machine
+ type - this for allows passing -mmcu=... via gcc ASM_SPEC as well
+ as .arch ... in the asm output at the same time. */
+
+ if (avr_mcu == &default_mcu || avr_mcu->mach == mcu_types[i].mach)
avr_mcu = &mcu_types[i];
else
- as_fatal (_ ("redefinition of mcu type `%s'"), mcu_types[i].name);
+ as_fatal (_ ("redefinition of mcu type `%s' to `%s'"),
+ avr_mcu->name, mcu_types[i].name);
return 1;
}
return 0;
@@ -818,14 +828,8 @@ md_apply_fix3 (fixp, valuep, seg)
if (value < -2048 || value > 2047)
{
- if (avr_mcu->isa & AVR_ISA_WRAP)
- {
- if (value > 2047)
- value -= 4096;
- else
- value += 4096;
- }
- else
+ /* No wrap for devices with >8K of program memory. */
+ if (avr_mcu->isa & AVR_ISA_MEGA)
as_bad_where (fixp->fx_file, fixp->fx_line,
_("operand out of range: %ld"), value);
}