Commit 59ab92d2 by Anatoly Sokolov Committed by Anatoly Sokolov

config.gcc (avr-*-rtems*, avr-*-*): Set extra_gcc_objs and extra_objs.

	* config.gcc (avr-*-rtems*, avr-*-*): Set extra_gcc_objs and
	extra_objs.
	* config/avr/avr.c (avr_current_device): New variable.
	(avr_arch_types, avr_mcu_types): Move to avr-deveces.c.
	(avr_arch, mcu_type_s): Move to avr.h.
	* config/avr/avr.h (base_arch_s). Add reserved2, arch_name and
	default_data_section_start fields.
	(avr_arch): Moved from avr.c.
	(mcu_type_s): Moved from avr.c. Add short_sp, data_section_start and
	library_name fields.
	(avr_current_device, avr_mcu_types, avr_arch_types,
	avr_device_to_arch, avr_device_to_data_start,
	avr_device_to_startfiles, avr_device_to_devicelib): Declare.
	(EXTRA_SPEC_FUNCTIONS): Define.
	(LINK_SPEC): Remove device name to '-m ...' and '-Tdata ...' linker
	options mapping. Use device_to_arch and device_to_data_start insted.
	(STARTFILE_SPEC): Use device_to_startfile instead of crt_binutils.
	(CRT_BINUTILS_SPECS, EXTRA_SPECS): Remove.
	* config/avr/t-avr (driver-avr.o, avr-devices.o): New rules.
	* config/avr/driver-avr.c: New file.
	* config/avr/avr-devices.c: New file.

From-SVN: r148868
parent 33436e29
2009-06-23 Anatoly Sokolov <aesok@post.ru>
* config.gcc (avr-*-rtems*, avr-*-*): Set extra_gcc_objs and
extra_objs.
* config/avr/avr.c (avr_current_device): New variable.
(avr_arch_types, avr_mcu_types): Move to avr-deveces.c.
(avr_arch, mcu_type_s): Move to avr.h.
* config/avr/avr.h (base_arch_s). Add reserved2, arch_name and
default_data_section_start fields.
(avr_arch): Moved from avr.c.
(mcu_type_s): Moved from avr.c. Add short_sp, data_section_start and
library_name fields.
(avr_current_device, avr_mcu_types, avr_arch_types,
avr_device_to_arch, avr_device_to_data_start,
avr_device_to_startfiles, avr_device_to_devicelib): Declare.
(EXTRA_SPEC_FUNCTIONS): Define.
(LINK_SPEC): Remove device name to '-m ...' and '-Tdata ...' linker
options mapping. Use device_to_arch and device_to_data_start insted.
(STARTFILE_SPEC): Use device_to_startfile instead of crt_binutils.
(CRT_BINUTILS_SPECS, EXTRA_SPECS): Remove.
* config/avr/t-avr (driver-avr.o, avr-devices.o): New rules.
* config/avr/driver-avr.c: New file.
* config/avr/avr-devices.c: New file.
2009-06-23 Jakub Jelinek <jakub@redhat.com> 2009-06-23 Jakub Jelinek <jakub@redhat.com>
* var-tracking.c (unshare_variable): Force initialized to * var-tracking.c (unshare_variable): Force initialized to
......
...@@ -802,10 +802,14 @@ arm-*-pe*) ...@@ -802,10 +802,14 @@ arm-*-pe*)
avr-*-rtems*) avr-*-rtems*)
tm_file="avr/avr.h dbxelf.h avr/rtems.h rtems.h newlib-stdint.h" tm_file="avr/avr.h dbxelf.h avr/rtems.h rtems.h newlib-stdint.h"
tmake_file="avr/t-avr t-rtems avr/t-rtems" tmake_file="avr/t-avr t-rtems avr/t-rtems"
extra_gcc_objs="driver-avr.o avr-devices.o"
extra_objs="avr-devices.o"
;; ;;
avr-*-*) avr-*-*)
tm_file="avr/avr.h dbxelf.h newlib-stdint.h" tm_file="avr/avr.h dbxelf.h newlib-stdint.h"
use_gcc_stdint=wrap use_gcc_stdint=wrap
extra_gcc_objs="driver-avr.o avr-devices.o"
extra_objs="avr-devices.o"
;; ;;
bfin*-elf*) bfin*-elf*)
tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h bfin/elf.h" tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h bfin/elf.h"
......
...@@ -112,204 +112,10 @@ const char *avr_extra_arch_macro; ...@@ -112,204 +112,10 @@ const char *avr_extra_arch_macro;
/* Current architecture. */ /* Current architecture. */
const struct base_arch_s *avr_current_arch; const struct base_arch_s *avr_current_arch;
section *progmem_section; /* Current device. */
const struct mcu_type_s *avr_current_device;
static const struct base_arch_s avr_arch_types[] = {
{ 1, 0, 0, 0, 0, 0, 0, 0, NULL }, /* unknown device specified */
{ 1, 0, 0, 0, 0, 0, 0, 0, "__AVR_ARCH__=1" },
{ 0, 0, 0, 0, 0, 0, 0, 0, "__AVR_ARCH__=2" },
{ 0, 0, 0, 1, 0, 0, 0, 0, "__AVR_ARCH__=25" },
{ 0, 0, 1, 0, 0, 0, 0, 0, "__AVR_ARCH__=3" },
{ 0, 0, 1, 0, 1, 0, 0, 0, "__AVR_ARCH__=31" },
{ 0, 0, 1, 1, 0, 0, 0, 0, "__AVR_ARCH__=35" },
{ 0, 1, 0, 1, 0, 0, 0, 0, "__AVR_ARCH__=4" },
{ 0, 1, 1, 1, 0, 0, 0, 0, "__AVR_ARCH__=5" },
{ 0, 1, 1, 1, 1, 1, 0, 0, "__AVR_ARCH__=51" },
{ 0, 1, 1, 1, 1, 1, 1, 0, "__AVR_ARCH__=6" }
};
/* These names are used as the index into the avr_arch_types[] table section *progmem_section;
above. */
enum avr_arch
{
ARCH_UNKNOWN,
ARCH_AVR1,
ARCH_AVR2,
ARCH_AVR25,
ARCH_AVR3,
ARCH_AVR31,
ARCH_AVR35,
ARCH_AVR4,
ARCH_AVR5,
ARCH_AVR51,
ARCH_AVR6
};
struct mcu_type_s {
const char *const name;
int arch; /* index in avr_arch_types[] */
/* Must lie outside user's namespace. NULL == no macro. */
const char *const macro;
};
/* List of all known AVR MCU types - if updated, it has to be kept
in sync in several places (FIXME: is there a better way?):
- here
- avr.h (CPP_SPEC, LINK_SPEC, CRT_BINUTILS_SPECS)
- t-avr (MULTILIB_MATCHES)
- gas/config/tc-avr.c
- avr-libc */
static const struct mcu_type_s avr_mcu_types[] = {
/* Classic, <= 8K. */
{ "avr2", ARCH_AVR2, NULL },
{ "at90s2313", ARCH_AVR2, "__AVR_AT90S2313__" },
{ "at90s2323", ARCH_AVR2, "__AVR_AT90S2323__" },
{ "at90s2333", ARCH_AVR2, "__AVR_AT90S2333__" },
{ "at90s2343", ARCH_AVR2, "__AVR_AT90S2343__" },
{ "attiny22", ARCH_AVR2, "__AVR_ATtiny22__" },
{ "attiny26", ARCH_AVR2, "__AVR_ATtiny26__" },
{ "at90s4414", ARCH_AVR2, "__AVR_AT90S4414__" },
{ "at90s4433", ARCH_AVR2, "__AVR_AT90S4433__" },
{ "at90s4434", ARCH_AVR2, "__AVR_AT90S4434__" },
{ "at90s8515", ARCH_AVR2, "__AVR_AT90S8515__" },
{ "at90c8534", ARCH_AVR2, "__AVR_AT90C8534__" },
{ "at90s8535", ARCH_AVR2, "__AVR_AT90S8535__" },
/* Classic + MOVW, <= 8K. */
{ "avr25", ARCH_AVR25, NULL },
{ "ata6289", ARCH_AVR25, "__AVR_ATA6289__" },
{ "attiny13", ARCH_AVR25, "__AVR_ATtiny13__" },
{ "attiny13a", ARCH_AVR25, "__AVR_ATtiny13A__" },
{ "attiny2313", ARCH_AVR25, "__AVR_ATtiny2313__" },
{ "attiny24", ARCH_AVR25, "__AVR_ATtiny24__" },
{ "attiny44", ARCH_AVR25, "__AVR_ATtiny44__" },
{ "attiny84", ARCH_AVR25, "__AVR_ATtiny84__" },
{ "attiny25", ARCH_AVR25, "__AVR_ATtiny25__" },
{ "attiny45", ARCH_AVR25, "__AVR_ATtiny45__" },
{ "attiny85", ARCH_AVR25, "__AVR_ATtiny85__" },
{ "attiny261", ARCH_AVR25, "__AVR_ATtiny261__" },
{ "attiny461", ARCH_AVR25, "__AVR_ATtiny461__" },
{ "attiny861", ARCH_AVR25, "__AVR_ATtiny861__" },
{ "attiny43u", ARCH_AVR25, "__AVR_ATtiny43U__" },
{ "attiny87", ARCH_AVR25, "__AVR_ATtiny87__" },
{ "attiny48", ARCH_AVR25, "__AVR_ATtiny48__" },
{ "attiny88", ARCH_AVR25, "__AVR_ATtiny88__" },
{ "at86rf401", ARCH_AVR25, "__AVR_AT86RF401__" },
/* Classic, > 8K, <= 64K. */
{ "avr3", ARCH_AVR3, NULL },
{ "at43usb355", ARCH_AVR3, "__AVR_AT43USB355__" },
{ "at76c711", ARCH_AVR3, "__AVR_AT76C711__" },
/* Classic, == 128K. */
{ "avr31", ARCH_AVR31, NULL },
{ "atmega103", ARCH_AVR31, "__AVR_ATmega103__" },
{ "at43usb320", ARCH_AVR31, "__AVR_AT43USB320__" },
/* Classic + MOVW + JMP/CALL. */
{ "avr35", ARCH_AVR35, NULL },
{ "at90usb82", ARCH_AVR35, "__AVR_AT90USB82__" },
{ "at90usb162", ARCH_AVR35, "__AVR_AT90USB162__" },
{ "attiny167", ARCH_AVR35, "__AVR_ATtiny167__" },
{ "attiny327", ARCH_AVR35, "__AVR_ATtiny327__" },
/* Enhanced, <= 8K. */
{ "avr4", ARCH_AVR4, NULL },
{ "atmega8", ARCH_AVR4, "__AVR_ATmega8__" },
{ "atmega48", ARCH_AVR4, "__AVR_ATmega48__" },
{ "atmega48p", ARCH_AVR4, "__AVR_ATmega48P__" },
{ "atmega88", ARCH_AVR4, "__AVR_ATmega88__" },
{ "atmega88p", ARCH_AVR4, "__AVR_ATmega88P__" },
{ "atmega8515", ARCH_AVR4, "__AVR_ATmega8515__" },
{ "atmega8535", ARCH_AVR4, "__AVR_ATmega8535__" },
{ "atmega8hva", ARCH_AVR4, "__AVR_ATmega8HVA__" },
{ "atmega4hvd", ARCH_AVR4, "__AVR_ATmega4HVD__" },
{ "atmega8hvd", ARCH_AVR4, "__AVR_ATmega8HVD__" },
{ "atmega8c1", ARCH_AVR4, "__AVR_ATmega8C1__" },
{ "atmega8m1", ARCH_AVR4, "__AVR_ATmega8M1__" },
{ "at90pwm1", ARCH_AVR4, "__AVR_AT90PWM1__" },
{ "at90pwm2", ARCH_AVR4, "__AVR_AT90PWM2__" },
{ "at90pwm2b", ARCH_AVR4, "__AVR_AT90PWM2B__" },
{ "at90pwm3", ARCH_AVR4, "__AVR_AT90PWM3__" },
{ "at90pwm3b", ARCH_AVR4, "__AVR_AT90PWM3B__" },
{ "at90pwm81", ARCH_AVR4, "__AVR_AT90PWM81__" },
/* Enhanced, > 8K, <= 64K. */
{ "avr5", ARCH_AVR5, NULL },
{ "atmega16", ARCH_AVR5, "__AVR_ATmega16__" },
{ "atmega161", ARCH_AVR5, "__AVR_ATmega161__" },
{ "atmega162", ARCH_AVR5, "__AVR_ATmega162__" },
{ "atmega163", ARCH_AVR5, "__AVR_ATmega163__" },
{ "atmega164p", ARCH_AVR5, "__AVR_ATmega164P__" },
{ "atmega165", ARCH_AVR5, "__AVR_ATmega165__" },
{ "atmega165p", ARCH_AVR5, "__AVR_ATmega165P__" },
{ "atmega168", ARCH_AVR5, "__AVR_ATmega168__" },
{ "atmega168p", ARCH_AVR5, "__AVR_ATmega168P__" },
{ "atmega169", ARCH_AVR5, "__AVR_ATmega169__" },
{ "atmega169p", ARCH_AVR5, "__AVR_ATmega169P__" },
{ "atmega32", ARCH_AVR5, "__AVR_ATmega32__" },
{ "atmega323", ARCH_AVR5, "__AVR_ATmega323__" },
{ "atmega324p", ARCH_AVR5, "__AVR_ATmega324P__" },
{ "atmega325", ARCH_AVR5, "__AVR_ATmega325__" },
{ "atmega325p", ARCH_AVR5, "__AVR_ATmega325P__" },
{ "atmega3250", ARCH_AVR5, "__AVR_ATmega3250__" },
{ "atmega3250p", ARCH_AVR5, "__AVR_ATmega3250P__" },
{ "atmega328p", ARCH_AVR5, "__AVR_ATmega328P__" },
{ "atmega329", ARCH_AVR5, "__AVR_ATmega329__" },
{ "atmega329p", ARCH_AVR5, "__AVR_ATmega329P__" },
{ "atmega3290", ARCH_AVR5, "__AVR_ATmega3290__" },
{ "atmega3290p", ARCH_AVR5, "__AVR_ATmega3290P__" },
{ "atmega406", ARCH_AVR5, "__AVR_ATmega406__" },
{ "atmega64", ARCH_AVR5, "__AVR_ATmega64__" },
{ "atmega640", ARCH_AVR5, "__AVR_ATmega640__" },
{ "atmega644", ARCH_AVR5, "__AVR_ATmega644__" },
{ "atmega644p", ARCH_AVR5, "__AVR_ATmega644P__" },
{ "atmega645", ARCH_AVR5, "__AVR_ATmega645__" },
{ "atmega6450", ARCH_AVR5, "__AVR_ATmega6450__" },
{ "atmega649", ARCH_AVR5, "__AVR_ATmega649__" },
{ "atmega6490", ARCH_AVR5, "__AVR_ATmega6490__" },
{ "atmega16hva", ARCH_AVR5, "__AVR_ATmega16HVA__" },
{ "atmega16hvb", ARCH_AVR5, "__AVR_ATmega16HVB__" },
{ "atmega32hvb", ARCH_AVR5, "__AVR_ATmega32HVB__" },
{ "at90can32", ARCH_AVR5, "__AVR_AT90CAN32__" },
{ "at90can64", ARCH_AVR5, "__AVR_AT90CAN64__" },
{ "at90pwm216", ARCH_AVR5, "__AVR_AT90PWM216__" },
{ "at90pwm316", ARCH_AVR5, "__AVR_AT90PWM316__" },
{ "atmega16c1", ARCH_AVR5, "__AVR_ATmega16C1__" },
{ "atmega32c1", ARCH_AVR5, "__AVR_ATmega32C1__" },
{ "atmega64c1", ARCH_AVR5, "__AVR_ATmega64C1__" },
{ "atmega16m1", ARCH_AVR5, "__AVR_ATmega16M1__" },
{ "atmega32m1", ARCH_AVR5, "__AVR_ATmega32M1__" },
{ "atmega64m1", ARCH_AVR5, "__AVR_ATmega64M1__" },
{ "atmega16u4", ARCH_AVR5, "__AVR_ATmega16U4__" },
{ "atmega32u4", ARCH_AVR5, "__AVR_ATmega32U4__" },
{ "atmega32u6", ARCH_AVR5, "__AVR_ATmega32U6__" },
{ "at90scr100", ARCH_AVR5, "__AVR_AT90SCR100__" },
{ "at90usb646", ARCH_AVR5, "__AVR_AT90USB646__" },
{ "at90usb647", ARCH_AVR5, "__AVR_AT90USB647__" },
{ "at94k", ARCH_AVR5, "__AVR_AT94K__" },
/* Enhanced, == 128K. */
{ "avr51", ARCH_AVR51, NULL },
{ "atmega128", ARCH_AVR51, "__AVR_ATmega128__" },
{ "atmega1280", ARCH_AVR51, "__AVR_ATmega1280__" },
{ "atmega1281", ARCH_AVR51, "__AVR_ATmega1281__" },
{ "atmega1284p", ARCH_AVR51, "__AVR_ATmega1284P__" },
{ "atmega128rfa1", ARCH_AVR51, "__AVR_ATmega128RFA1__" },
{ "at90can128", ARCH_AVR51, "__AVR_AT90CAN128__" },
{ "at90usb1286", ARCH_AVR51, "__AVR_AT90USB1286__" },
{ "at90usb1287", ARCH_AVR51, "__AVR_AT90USB1287__" },
{ "m3000f", ARCH_AVR51, "__AVR_M3000F__" },
{ "m3000s", ARCH_AVR51, "__AVR_M3000S__" },
{ "m3001b", ARCH_AVR51, "__AVR_M3001B__" },
/* 3-Byte PC. */
{ "avr6", ARCH_AVR6, NULL },
{ "atmega2560", ARCH_AVR6, "__AVR_ATmega2560__" },
{ "atmega2561", ARCH_AVR6, "__AVR_ATmega2561__" },
/* Assembler only. */
{ "avr1", ARCH_AVR1, NULL },
{ "at90s1200", ARCH_AVR1, "__AVR_AT90S1200__" },
{ "attiny11", ARCH_AVR1, "__AVR_ATtiny11__" },
{ "attiny12", ARCH_AVR1, "__AVR_ATtiny12__" },
{ "attiny15", ARCH_AVR1, "__AVR_ATtiny15__" },
{ "attiny28", ARCH_AVR1, "__AVR_ATtiny28__" },
{ NULL, ARCH_UNKNOWN, NULL }
};
/* Initialize the GCC target structure. */ /* Initialize the GCC target structure. */
......
...@@ -44,13 +44,63 @@ struct base_arch_s { ...@@ -44,13 +44,63 @@ struct base_arch_s {
/* Core have 'EICALL' and 'EIJMP' instructions. */ /* Core have 'EICALL' and 'EIJMP' instructions. */
int have_eijmp_eicall; int have_eijmp_eicall;
/* Reserved. */ /* Reserved for xmega architecture. */
int reserved; int reserved;
/* Reserved for xmega architecture. */
int reserved2;
/* Default start of data section address for architecture. */
int default_data_section_start;
const char *const macro;
/* Architecture name. */
const char *const arch_name;
};
/* These names are used as the index into the avr_arch_types[] table
above. */
enum avr_arch
{
ARCH_UNKNOWN,
ARCH_AVR1,
ARCH_AVR2,
ARCH_AVR25,
ARCH_AVR3,
ARCH_AVR31,
ARCH_AVR35,
ARCH_AVR4,
ARCH_AVR5,
ARCH_AVR51,
ARCH_AVR6
};
struct mcu_type_s {
/* Device name. */
const char *const name;
/* Index in avr_arch_types[]. */
int arch;
/* Must lie outside user's namespace. NULL == no macro. */
const char *const macro; const char *const macro;
/* Stack pointer have 8 bits width. */
int short_sp;
/* Start of data section. */
int data_section_start;
/* Name of device library. */
const char *const library_name;
}; };
extern const struct base_arch_s *avr_current_arch; extern const struct base_arch_s *avr_current_arch;
extern const struct mcu_type_s *avr_current_device;
extern const struct mcu_type_s avr_mcu_types[];
extern const struct base_arch_s avr_arch_types[];
#define TARGET_CPU_CPP_BUILTINS() \ #define TARGET_CPU_CPP_BUILTINS() \
do \ do \
...@@ -756,6 +806,17 @@ fprintf (STREAM, "\t.skip %lu,0\n", (unsigned long)(N)) ...@@ -756,6 +806,17 @@ fprintf (STREAM, "\t.skip %lu,0\n", (unsigned long)(N))
#define ADJUST_INSN_LENGTH(INSN, LENGTH) (LENGTH =\ #define ADJUST_INSN_LENGTH(INSN, LENGTH) (LENGTH =\
adjust_insn_length (INSN, LENGTH)) adjust_insn_length (INSN, LENGTH))
extern const char *avr_device_to_arch (int argc, const char **argv);
extern const char *avr_device_to_data_start (int argc, const char **argv);
extern const char *avr_device_to_startfiles (int argc, const char **argv);
extern const char *avr_device_to_devicelib (int argc, const char **argv);
#define EXTRA_SPEC_FUNCTIONS \
{ "device_to_arch", avr_device_to_arch }, \
{ "device_to_data_start", avr_device_to_data_start }, \
{ "device_to_startfile", avr_device_to_startfiles }, \
{ "device_to_devicelib", avr_device_to_devicelib },
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}" #define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
#define CC1_SPEC "%{profile:-p}" #define CC1_SPEC "%{profile:-p}"
...@@ -778,106 +839,8 @@ mmcu=*:-mmcu=%*}" ...@@ -778,106 +839,8 @@ mmcu=*:-mmcu=%*}"
%{mmcu=atmega64*|\ %{mmcu=atmega64*|\
mmcu=at90can64*|\ mmcu=at90can64*|\
mmcu=at90usb64*:--pmem-wrap-around=64k}}}\ mmcu=at90usb64*:--pmem-wrap-around=64k}}}\
%{!mmcu*: -m avr2}\ %:device_to_arch(%{mmcu=*:%*})\
%{mmcu=at90s1200|\ %:device_to_data_start(%{mmcu=*:%*})"
mmcu=attiny11|\
mmcu=attiny12|\
mmcu=attiny15|\
mmcu=attiny28: -m avr1}\
%{mmcu=attiny22|\
mmcu=attiny26|\
mmcu=at90s2*|\
mmcu=at90s4*|\
mmcu=at90s8*|\
mmcu=at90c8*|\
mmcu=at86rf401|\
mmcu=ata6289|\
mmcu=attiny13*|\
mmcu=attiny2313|\
mmcu=attiny24|\
mmcu=attiny25|\
mmcu=attiny261|\
mmcu=attiny4*|\
mmcu=attiny8*: -m avr2}\
%{mmcu=atmega103|\
mmcu=at43*|\
mmcu=at76*|\
mmcu=at90usb82|\
mmcu=at90usb162|\
mmcu=attiny16*|\
mmcu=attiny32*: -m avr3}\
%{mmcu=atmega8*|\
mmcu=atmega4*|\
mmcu=at90pwm1|\
mmcu=at90pwm2|\
mmcu=at90pwm2b|\
mmcu=at90pwm3|\
mmcu=at90pwm3b|\
mmcu=at90pwm81: -m avr4}\
%{mmcu=atmega16*|\
mmcu=atmega32*|\
mmcu=atmega406|\
mmcu=atmega64*|\
mmcu=atmega128*|\
mmcu=at90can*|\
mmcu=at90pwm216|\
mmcu=at90pwm316|\
mmcu=at90scr100|\
mmcu=at90usb64*|\
mmcu=at90usb128*|\
mmcu=at94k|\
mmcu=m3000*|\
mmcu=m3001*: -m avr5}\
%{mmcu=atmega256*:-m avr6}\
%{mmcu=atmega324*|\
mmcu=atmega325*|\
mmcu=atmega328p|\
mmcu=atmega329*|\
mmcu=atmega406|\
mmcu=atmega48*|\
mmcu=atmega88*|\
mmcu=atmega64|\
mmcu=atmega644*|\
mmcu=atmega645*|\
mmcu=atmega649*|\
mmcu=atmega128|\
mmcu=atmega1284p|\
mmcu=atmega162|\
mmcu=atmega164*|\
mmcu=atmega165*|\
mmcu=atmega168*|\
mmcu=atmega169*|\
mmcu=atmega4hv*|\
mmcu=atmega8hv*|\
mmcu=atmega16hv*|\
mmcu=atmega32hv*|\
mmcu=attiny48|\
mmcu=attiny88|\
mmcu=attiny87|\
mmcu=attiny167|\
mmcu=attiny327|\
mmcu=at90can*|\
mmcu=at90pwm*|\
mmcu=atmega8c1|\
mmcu=atmega16c1|\
mmcu=atmega32c1|\
mmcu=atmega64c1|\
mmcu=atmega8m1|\
mmcu=atmega16m1|\
mmcu=atmega32m1|\
mmcu=atmega64m1|\
mmcu=atmega16u4|\
mmcu=atmega32u*|\
mmcu=at90scr100|\
mmcu=ata6289|\
mmcu=at90usb*: -Tdata 0x800100}\
%{mmcu=atmega640|\
mmcu=atmega1280|\
mmcu=atmega1281|\
mmcu=atmega256*|\
mmcu=atmega128rfa1: -Tdata 0x800200}\
%{mmcu=m3000*|\
mmcu=m3001*: -Tdata 0x801000}"
#define LIB_SPEC \ #define LIB_SPEC \
"%{!mmcu=at90s1*:%{!mmcu=attiny11:%{!mmcu=attiny12:%{!mmcu=attiny15:%{!mmcu=attiny28: -lc }}}}}" "%{!mmcu=at90s1*:%{!mmcu=attiny11:%{!mmcu=attiny12:%{!mmcu=attiny15:%{!mmcu=attiny28: -lc }}}}}"
...@@ -888,140 +851,10 @@ mmcu=*:-mmcu=%*}" ...@@ -888,140 +851,10 @@ mmcu=*:-mmcu=%*}"
#define LIBGCC_SPEC \ #define LIBGCC_SPEC \
"%{!mmcu=at90s1*:%{!mmcu=attiny11:%{!mmcu=attiny12:%{!mmcu=attiny15:%{!mmcu=attiny28: -lgcc }}}}}" "%{!mmcu=at90s1*:%{!mmcu=attiny11:%{!mmcu=attiny12:%{!mmcu=attiny15:%{!mmcu=attiny28: -lgcc }}}}}"
#define STARTFILE_SPEC "%(crt_binutils)" #define STARTFILE_SPEC "%:device_to_startfile(%{mmcu=*:%*})"
#define ENDFILE_SPEC "" #define ENDFILE_SPEC ""
#define CRT_BINUTILS_SPECS "\
%{mmcu=at90s1200|mmcu=avr1:crts1200.o%s} \
%{mmcu=attiny11:crttn11.o%s} \
%{mmcu=attiny12:crttn12.o%s} \
%{mmcu=attiny15:crttn15.o%s} \
%{mmcu=attiny28:crttn28.o%s} \
%{!mmcu*|mmcu=at90s8515|mmcu=avr2:crts8515.o%s} \
%{mmcu=at90s2313:crts2313.o%s} \
%{mmcu=at90s2323:crts2323.o%s} \
%{mmcu=at90s2333:crts2333.o%s} \
%{mmcu=at90s2343:crts2343.o%s} \
%{mmcu=attiny22:crttn22.o%s} \
%{mmcu=attiny26:crttn26.o%s} \
%{mmcu=at90s4433:crts4433.o%s} \
%{mmcu=at90s4414:crts4414.o%s} \
%{mmcu=at90s4434:crts4434.o%s} \
%{mmcu=at90c8534:crtc8534.o%s} \
%{mmcu=at90s8535:crts8535.o%s} \
%{mmcu=at86rf401:crt86401.o%s} \
%{mmcu=attiny13:crttn13.o%s} \
%{mmcu=attiny13a:crttn13a.o%s} \
%{mmcu=attiny2313|mmcu=avr25:crttn2313.o%s} \
%{mmcu=attiny24:crttn24.o%s} \
%{mmcu=attiny44:crttn44.o%s} \
%{mmcu=attiny84:crttn84.o%s} \
%{mmcu=attiny25:crttn25.o%s} \
%{mmcu=attiny45:crttn45.o%s} \
%{mmcu=attiny85:crttn85.o%s} \
%{mmcu=attiny261:crttn261.o%s} \
%{mmcu=attiny461:crttn461.o%s} \
%{mmcu=attiny861:crttn861.o%s} \
%{mmcu=attiny43u:crttn43u.o%s} \
%{mmcu=attiny87:crttn87.o%s} \
%{mmcu=attiny48:crttn48.o%s} \
%{mmcu=attiny88:crttn88.o%s} \
%{mmcu=ata6289:crta6289.o%s} \
%{mmcu=at43usb355|mmcu=avr3:crt43355.o%s} \
%{mmcu=at76c711:crt76711.o%s} \
%{mmcu=atmega103|mmcu=avr31:crtm103.o%s} \
%{mmcu=at43usb320:crt43320.o%s} \
%{mmcu=at90usb162|mmcu=avr35:crtusb162.o%s} \
%{mmcu=at90usb82:crtusb82.o%s} \
%{mmcu=attiny167:crttn167.o%s} \
%{mmcu=attiny327:crttn327.o%s} \
%{mmcu=atmega8|mmcu=avr4:crtm8.o%s} \
%{mmcu=atmega48:crtm48.o%s} \
%{mmcu=atmega48p:crtm48p.o%s} \
%{mmcu=atmega88:crtm88.o%s} \
%{mmcu=atmega88p:crtm88p.o%s} \
%{mmcu=atmega8515:crtm8515.o%s} \
%{mmcu=atmega8535:crtm8535.o%s} \
%{mmcu=atmega8c1:crtm8c1.o%s} \
%{mmcu=atmega8m1:crtm8m1.o%s} \
%{mmcu=at90pwm1:crt90pwm1.o%s} \
%{mmcu=at90pwm2:crt90pwm2.o%s} \
%{mmcu=at90pwm2b:crt90pwm2b.o%s} \
%{mmcu=at90pwm3:crt90pwm3.o%s} \
%{mmcu=at90pwm3b:crt90pwm3b.o%s} \
%{mmcu=at90pwm81:crt90pwm81.o%s} \
%{mmcu=atmega16:crtm16.o%s} \
%{mmcu=atmega161|mmcu=avr5:crtm161.o%s} \
%{mmcu=atmega162:crtm162.o%s} \
%{mmcu=atmega163:crtm163.o%s} \
%{mmcu=atmega164p:crtm164p.o%s} \
%{mmcu=atmega165:crtm165.o%s} \
%{mmcu=atmega165p:crtm165p.o%s} \
%{mmcu=atmega168:crtm168.o%s} \
%{mmcu=atmega168p:crtm168p.o%s} \
%{mmcu=atmega169:crtm169.o%s} \
%{mmcu=atmega169p:crtm169p.o%s} \
%{mmcu=atmega32:crtm32.o%s} \
%{mmcu=atmega323:crtm323.o%s} \
%{mmcu=atmega324p:crtm324p.o%s} \
%{mmcu=atmega325:crtm325.o%s} \
%{mmcu=atmega325p:crtm325p.o%s} \
%{mmcu=atmega3250:crtm3250.o%s} \
%{mmcu=atmega3250p:crtm3250p.o%s} \
%{mmcu=atmega328p:crtm328p.o%s} \
%{mmcu=atmega329:crtm329.o%s} \
%{mmcu=atmega329p:crtm329p.o%s} \
%{mmcu=atmega3290:crtm3290.o%s} \
%{mmcu=atmega3290p:crtm3290p.o%s} \
%{mmcu=atmega406:crtm406.o%s} \
%{mmcu=atmega64:crtm64.o%s} \
%{mmcu=atmega640:crtm640.o%s} \
%{mmcu=atmega644:crtm644.o%s} \
%{mmcu=atmega644p:crtm644p.o%s} \
%{mmcu=atmega645:crtm645.o%s} \
%{mmcu=atmega6450:crtm6450.o%s} \
%{mmcu=atmega649:crtm649.o%s} \
%{mmcu=atmega6490:crtm6490.o%s} \
%{mmcu=atmega8hva:crtm8hva.o%s} \
%{mmcu=atmega16hva:crtm16hva.o%s} \
%{mmcu=atmega16hvb:crtm16hvb.o%s} \
%{mmcu=atmega32hvb:crtm32hvb.o%s} \
%{mmcu=atmega4hvd:crtm4hvd.o%s} \
%{mmcu=atmega8hvd:crtm8hvd.o%s} \
%{mmcu=at90can32:crtcan32.o%s} \
%{mmcu=at90can64:crtcan64.o%s} \
%{mmcu=at90pwm216:crt90pwm216.o%s} \
%{mmcu=at90pwm316:crt90pwm316.o%s} \
%{mmcu=atmega16c1:crtm16c1.o%s} \
%{mmcu=atmega32c1:crtm32c1.o%s} \
%{mmcu=atmega64c1:crtm64c1.o%s} \
%{mmcu=atmega16m1:crtm16m1.o%s} \
%{mmcu=atmega32m1:crtm32m1.o%s} \
%{mmcu=atmega64m1:crtm64m1.o%s} \
%{mmcu=atmega16u4:crtm16u4.o%s} \
%{mmcu=atmega32u4:crtm32u4.o%s} \
%{mmcu=atmega32u6:crtm32u6.o%s} \
%{mmcu=at90scr100:crt90scr100.o%s} \
%{mmcu=at90usb646:crtusb646.o%s} \
%{mmcu=at90usb647:crtusb647.o%s} \
%{mmcu=at94k:crtat94k.o%s} \
%{mmcu=atmega128|mmcu=avr51:crtm128.o%s} \
%{mmcu=atmega1280:crtm1280.o%s} \
%{mmcu=atmega1281:crtm1281.o%s} \
%{mmcu=atmega1284p:crtm1284p.o%s} \
%{mmcu=at90can128:crtcan128.o%s} \
%{mmcu=atmega128rfa1:crtm128rfa1.o%s} \
%{mmcu=at90usb1286:crtusb1286.o%s} \
%{mmcu=at90usb1287:crtusb1287.o%s} \
%{mmcu=m3000f:crtm3000f.o%s} \
%{mmcu=m3000s:crtm3000s.o%s} \
%{mmcu=m3001b:crtm3001b.o%s} \
%{mmcu=atmega2560|mmcu=avr6:crtm2560.o%s} \
%{mmcu=atmega2561:crtm2561.o%s}"
#define EXTRA_SPECS {"crt_binutils", CRT_BINUTILS_SPECS},
/* This is the default without any -mmcu=* option (AT90S*). */ /* This is the default without any -mmcu=* option (AT90S*). */
#define MULTILIB_DEFAULTS { "mmcu=avr2" } #define MULTILIB_DEFAULTS { "mmcu=avr2" }
......
/* Subroutines for the gcc driver.
Copyright (C) 2009 Free Software Foundation, Inc.
Contributed by Anatoly Sokolov <aesok@post.ru>
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 "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include <stdlib.h>
/* Current architecture. */
const struct base_arch_s *avr_current_arch = NULL;
/* Current device. */
const struct mcu_type_s *avr_current_device = NULL;
/* Initialize avr_current_arch and avr_current_device variables. */
static void
avr_set_current_device (const char *name)
{
if (NULL != avr_current_arch)
return;
for (avr_current_device = avr_mcu_types; avr_current_device->name;
avr_current_device++)
{
if (strcmp (avr_current_device->name, name) == 0)
break;
}
avr_current_arch = &avr_arch_types[avr_current_device->arch];
}
/* Returns command line parameters that describe the device architecture. */
const char *
avr_device_to_arch (int argc, const char **argv)
{
if (0 == argc)
return;
avr_set_current_device (argv[0]);
return concat ("-m ", avr_current_arch->arch_name, NULL);
}
/* Returns command line parameters that describe start of date section. */
const char *
avr_device_to_data_start (int argc, const char **argv)
{
unsigned long data_section_start;
char data_section_start_str[16];
if (0 == argc)
return;
avr_set_current_device (argv[0]);
if (avr_current_device->data_section_start
== avr_current_arch->default_data_section_start)
return NULL;
data_section_start = 0x800000 + avr_current_device->data_section_start;
snprintf (data_section_start_str, sizeof(data_section_start_str) - 1,
"0x%lX", data_section_start);
return concat ("-Tdata ", data_section_start_str, NULL);
}
/* Returns command line parameters that describe the device startfile. */
const char *
avr_device_to_startfiles (int argc, const char **argv)
{
if (0 == argc)
return;
avr_set_current_device (argv[0]);
return concat ("crt", avr_current_device->library_name, ".o%s", NULL);
}
/* Returns command line parameters that describe the device library. */
const char *
avr_device_to_devicelib (int argc, const char **argv)
{
if (0 == argc)
return;
avr_set_current_device (argv[0]);
return concat ("-l", avr_current_device->library_name, NULL);
}
...@@ -17,6 +17,14 @@ ...@@ -17,6 +17,14 @@
# along with GCC; see the file COPYING3. If not see # along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>. # <http://www.gnu.org/licenses/>.
driver-avr.o: $(srcdir)/config/avr/driver-avr.c \
$(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
avr-devices.o: $(srcdir)/config/avr/avr-devices.c \
$(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
LIB1ASMSRC = avr/libgcc.S LIB1ASMSRC = avr/libgcc.S
LIB1ASMFUNCS = \ LIB1ASMFUNCS = \
_mulqi3 \ _mulqi3 \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment