From bae3b1bfdc3dad7a228af75cfa5afc7e0d57ba64 Mon Sep 17 00:00:00 2001 From: Georg-Johann Lay Date: Tue, 28 Feb 2012 08:44:08 +0000 Subject: re PR target/49868 (Implement named address space to place/access data in flash memory) PR target/49868 PR target/52261 * doc/extend.texi (AVR Named Address Spaces): No more try to fix address spaces located outside of device flash. * config/avr/avr.h (base_arch_s): Remove field n_segments. (mcu_type_s): Add field n_flash. * config/avr/avr-devices.c (avr_arch_types): Remove .n_segments. Set .have_elpm and .have_elpmx to 1 for avrxmega4 and avrxmega5. (AVR_MCU): Add N_FLASH argument. * config/avr/avr-mcus.def (AVR_MCU): Add initializer for .n_flash. * config/avr/avr-c.c (avr_cpu_cpp_builtins): Only define built-in macro __FLASH if that address space makes sense for the device. * config/avr/avr.c (avr_out_lpm): Don't try to fix address spaces outside of target flash. (avr_asm_named_section): Ditto. (avr_asm_select_section): Ditto. (avr_addr_space_convert): Ditto. (avr_emit_movmemhi): Ditto. (avr_nonconst_pointer_addrspace, avr_pgm_check_var_decl): Error if address space is outside of device flash. (avr_insert_attributes): Ditto. (avr_xload_libgcc_p): Use avr_current_device->n_flash instead of avr_current_arch->n_segments. From-SVN: r184614 --- gcc/config/avr/avr-devices.c | 46 ++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'gcc/config/avr/avr-devices.c') diff --git a/gcc/config/avr/avr-devices.c b/gcc/config/avr/avr-devices.c index d044854..4f8696b 100644 --- a/gcc/config/avr/avr-devices.c +++ b/gcc/config/avr/avr-devices.c @@ -30,34 +30,34 @@ const struct base_arch_s avr_arch_types[] = { /* unknown device specified */ - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 32, 1, NULL, "avr2" }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 32, NULL, "avr2" }, /* - A M J LM E E E X R d S S O # F A - S U M PO L L I M A a t F ff 6 l r - M L P MV P P J E M t a R s 4 a c - XW M M M G P a r e s h - X P A D t t k h ID */ - { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 32, 1, "1", "avr1" }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 32, 1, "2", "avr2" }, - { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0x0060, 32, 1, "25", "avr25" }, - { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0x0060, 32, 1, "3", "avr3" }, - { 0, 0, 1, 0, 1, 0, 0, 0, 0, 0x0060, 32, 2, "31", "avr31" }, - { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0x0060, 32, 1, "35", "avr35" }, - { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0x0060, 32, 1, "4", "avr4" }, - { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0x0060, 32, 1, "5", "avr5" }, - { 0, 1, 1, 1, 1, 1, 0, 0, 0, 0x0060, 32, 2, "51", "avr51" }, - { 0, 1, 1, 1, 1, 1, 1, 0, 0, 0x0060, 32, 4, "6", "avr6" }, + A M J LM E E E X R d S S O A + S U M PO L L I M A a t F ff r + M L P MV P P J E M t a R s c + XW M M M G P a r e h + X P A D t t ID */ + { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 32, "1", "avr1" }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 32, "2", "avr2" }, + { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0x0060, 32, "25", "avr25" }, + { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0x0060, 32, "3", "avr3" }, + { 0, 0, 1, 0, 1, 0, 0, 0, 0, 0x0060, 32, "31", "avr31" }, + { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0x0060, 32, "35", "avr35" }, + { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0x0060, 32, "4", "avr4" }, + { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0x0060, 32, "5", "avr5" }, + { 0, 1, 1, 1, 1, 1, 0, 0, 0, 0x0060, 32, "51", "avr51" }, + { 0, 1, 1, 1, 1, 1, 1, 0, 0, 0x0060, 32, "6", "avr6" }, - { 0, 1, 1, 1, 0, 0, 0, 1, 0, 0x2000, 0, 1, "102", "avrxmega2" }, - { 0, 1, 1, 1, 0, 0, 0, 1, 0, 0x2000, 0, 1, "104", "avrxmega4" }, /* Same */ - { 0, 1, 1, 1, 0, 0, 0, 1, 1, 0x2000, 0, 1, "105", "avrxmega5" }, - { 0, 1, 1, 1, 1, 1, 1, 1, 0, 0x2000, 0, 4, "106", "avrxmega6" }, - { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0x2000, 0, 4, "107", "avrxmega7" } + { 0, 1, 1, 1, 0, 0, 0, 1, 0, 0x2000, 0, "102", "avrxmega2" }, + { 0, 1, 1, 1, 1, 1, 0, 1, 0, 0x2000, 0, "104", "avrxmega4" }, + { 0, 1, 1, 1, 1, 1, 0, 1, 1, 0x2000, 0, "105", "avrxmega5" }, + { 0, 1, 1, 1, 1, 1, 1, 1, 0, 0x2000, 0, "106", "avrxmega6" }, + { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0x2000, 0, "107", "avrxmega7" } }; const struct mcu_type_s avr_mcu_types[] = { -#define AVR_MCU(NAME, ARCH, MACRO, SHORT_SP, ERRATA_SKIP, DATA_SEC, LIBRARY_NAME) \ - { NAME, ARCH, MACRO, SHORT_SP, ERRATA_SKIP, DATA_SEC, LIBRARY_NAME }, +#define AVR_MCU(NAME,ARCH,MACRO,SHORT_SP,ERRATA_SKIP,DATA_SEC,N_FLASH,LIB_NAME)\ + { NAME, ARCH, MACRO, SHORT_SP, ERRATA_SKIP, DATA_SEC, N_FLASH, LIB_NAME }, #include "avr-mcus.def" #undef AVR_MCU /* End of list. */ -- cgit v1.1