diff options
author | Georg-Johann Lay <avr@gjlay.de> | 2012-05-08 12:28:29 +0000 |
---|---|---|
committer | Georg-Johann Lay <gjl@gcc.gnu.org> | 2012-05-08 12:28:29 +0000 |
commit | 04d170d214ae0a801ccfc4f66bf11531d19e75a8 (patch) | |
tree | f2bbb3660ff30b54fe18a7c267b668d2d16746a1 /gcc/config | |
parent | 9c04723a04fc5bbedd779431fede2571561e276f (diff) | |
download | gcc-04d170d214ae0a801ccfc4f66bf11531d19e75a8.zip gcc-04d170d214ae0a801ccfc4f66bf11531d19e75a8.tar.gz gcc-04d170d214ae0a801ccfc4f66bf11531d19e75a8.tar.bz2 |
Makefile.in (TEXI_GCC_FILES): Add avr-mmcu.texi.
* Makefile.in (TEXI_GCC_FILES): Add avr-mmcu.texi.
* doc/avr-mmcu.texi: New auto-generated file.
* doc/invoke.texi (AVR Options): Include avr-mmcu.texi in order
to document all valid -mmcu= arguments.
* config/avr/avr.h (arch_info_s): New struct definition.
* config/avr/avr-devices.c (avr_texinfo): New variable.
* config/avr/gen-avr-mmcu-texi.c: New file.
* config/avr/t-avr: New rules and dependencies to build avr-mmcu.texi.
From-SVN: r187279
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/avr/avr-devices.c | 45 | ||||
-rw-r--r-- | gcc/config/avr/avr.h | 8 | ||||
-rw-r--r-- | gcc/config/avr/gen-avr-mmcu-texi.c | 73 | ||||
-rw-r--r-- | gcc/config/avr/t-avr | 20 |
4 files changed, 146 insertions, 0 deletions
diff --git a/gcc/config/avr/avr-devices.c b/gcc/config/avr/avr-devices.c index 41688c8..47cfefd 100644 --- a/gcc/config/avr/avr-devices.c +++ b/gcc/config/avr/avr-devices.c @@ -55,6 +55,51 @@ avr_arch_types[] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0x2000, 0, "107", "avrxmega7" } }; +const struct arch_info_s +avr_texinfo[] = +{ + { ARCH_AVR1, + "This ISA is implemented by the minimal AVR core and supported " + "for assembler only." }, + { ARCH_AVR2, + "``Classic'' devices with up to 8@tie{}KiB of program memory." }, + { ARCH_AVR25, + "``Classic'' devices with up to 8@tie{}KiB of program memory and with " + "the @code{MOVW} instruction." }, + { ARCH_AVR3, + "``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of " + " program memory." }, + { ARCH_AVR31, + "``Classic'' devices with 128@tie{}KiB of program memory." }, + { ARCH_AVR35, + "``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of " + "program memory and with the @code{MOVW} instruction." }, + { ARCH_AVR4, + "``Enhanced'' devices with up to 8@tie{}KiB of program memory." }, + { ARCH_AVR5, + "``Enhanced'' devices with 16@tie{}KiB up to 64@tie{}KiB of " + "program memory." }, + { ARCH_AVR51, + "``Enhanced'' devices with 128@tie{}KiB of program memory." }, + { ARCH_AVR6, + "``Enhanced'' devices with 3-byte PC, i.e.@: with more than 128@tie{}KiB " + "of program memory." }, + { ARCH_AVRXMEGA2, + "``XMEGA'' devices with more than 8@tie{}KiB and up to 64@tie{}KiB " + "of program memory." }, + { ARCH_AVRXMEGA4, + "``XMEGA'' devices with more than 64@tie{}KiB and up to 128@tie{}KiB " + "of program memory." }, + { ARCH_AVRXMEGA5, + "``XMEGA'' devices with more than 64@tie{}KiB and up to 128@tie{}KiB " + "of program memory and more than 64@tie{}KiB of RAM." }, + { ARCH_AVRXMEGA6, + "``XMEGA'' devices with more than 128@tie{}KiB of program memory." }, + { ARCH_AVRXMEGA7, + "``XMEGA'' devices with more than 128@tie{}KiB of program memory " + "and more than 64@tie{}KiB of RAM." } +}; + const struct mcu_type_s avr_mcu_types[] = { #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 }, diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h index 591e21d..ef98a91 100644 --- a/gcc/config/avr/avr.h +++ b/gcc/config/avr/avr.h @@ -133,6 +133,14 @@ struct mcu_type_s { const char *const library_name; }; +struct arch_info_s { + /* Architecture ID. */ + enum avr_arch arch; + + /* textinfo source to describe the archtiecture. */ + const char *texinfo; +}; + /* Preprocessor macros to define depending on MCU type. */ extern const char *avr_extra_arch_macro; extern const struct base_arch_s *avr_current_arch; diff --git a/gcc/config/avr/gen-avr-mmcu-texi.c b/gcc/config/avr/gen-avr-mmcu-texi.c new file mode 100644 index 0000000..0bbd3a3 --- /dev/null +++ b/gcc/config/avr/gen-avr-mmcu-texi.c @@ -0,0 +1,73 @@ +/* Copyright (C) 2012 + Free Software Foundation, Inc. + Contributed by Georg-Johann Lay (avr@gjlay.de) + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + <http://www.gnu.org/licenses/>. */ + +#include "avr-devices.c" + +int main (void) +{ + enum avr_arch arch = 0; + unsigned i, first = 1; + const struct mcu_type_s *mcu; + + printf ("@c Copyright (C) 2012 Free Software Foundation, Inc.\n"); + printf ("@c This is part of the GCC manual.\n"); + printf ("@c For copying conditions, see the file " + "gcc/doc/include/fdl.texi.\n\n"); + + printf ("@c This file is generated automatically using\n"); + printf ("@c gcc/config/avr/gen-avr-mmcu-texi.c from:\n"); + printf ("@c gcc/config/avr/avr-devices.c\n"); + printf ("@c gcc/config/avr/avr-mcus.def\n\n"); + + printf ("@c Please do not edit manually.\n\n"); + + printf ("@table @code\n\n"); + + for (mcu = avr_mcu_types; mcu->name; mcu++) + { + if (mcu->macro == NULL) + { + arch = mcu->arch; + + for (i = 0; i < sizeof (avr_texinfo) / sizeof (*avr_texinfo); i++) + { + if (arch == avr_texinfo[i].arch) + { + if (mcu != avr_mcu_types) + printf (".\n\n"); + printf ("@item %s\n%s\n", mcu->name, avr_texinfo[i].texinfo); + printf ("@*@var{mcu}@tie{}="); + first = 1; + break; + } + } + } + else if (arch == (enum avr_arch) mcu->arch) + { + printf ("%s @code{%s}", first ? "" : ",", mcu->name); + first = 0; + } + } + + printf (".\n\n"); + printf ("@end table\n"); + + return EXIT_SUCCESS; +} diff --git a/gcc/config/avr/t-avr b/gcc/config/avr/t-avr index 9963833..24cdd92 100644 --- a/gcc/config/avr/t-avr +++ b/gcc/config/avr/t-avr @@ -43,6 +43,26 @@ AVR_MCUS = $(srcdir)/config/avr/avr-mcus.def $(srcdir)/config/avr/avr-tables.opt: $(srcdir)/config/avr/genopt.sh $(AVR_MCUS) $(SHELL) $< $(AVR_MCUS) > $@ +gen-avr-mmcu-texi$(build_exeext): $(srcdir)/config/avr/gen-avr-mmcu-texi.c \ + $(TM_H) $(AVR_MCUS) $(srcdir)/config/avr/avr-devices.c + $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< -o $@ + +avr-devices.o: s-avr-mmcu-texi + +s-avr-mmcu-texi: gen-avr-mmcu-texi$(build_exeext) + $(RUN_GEN) $< | sed -e 's:\r::g' > avr-mmcu.texi + @if cmp -s $(srcdir)/doc/avr-mmcu.texi avr-mmcu.texi; then \ + $(STAMP) $@; \ + else \ + echo >&2 ; \ + echo "***" >&2 ; \ + echo "*** Verify that you have permission to grant a" >&2 ; \ + echo "*** GFDL license for all new text in" >&2 ; \ + echo "*** avr-mmcu.texi, then copy it to $(srcdir)/doc/avr-mmcu.texi" >&2 ; \ + echo "***" >&2 ; \ + false; \ + fi + # MULTILIB_OPTIONS # MULTILIB_DIRNAMES # MULTILIB_EXCEPTIONS |