📄 avr.h
字号:
/* Definitions of target machine for GNU compiler, for ATMEL AVR at90s8515, ATmega103/103L, ATmega603/603L microcontrollers. Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Denis Chertykov (denisc@overta.ru)This file is part of GNU CC.GNU CC is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2, or (at your option)any later version.GNU CC is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU CC; see the file COPYING. If not, write tothe Free Software Foundation, 59 Temple Place - Suite 330,Boston, MA 02111-1307, USA. *//* Names to predefine in the preprocessor for this target machine. */#define TARGET_CPU_CPP_BUILTINS() \ do \ { \ builtin_define_std ("AVR"); \ if (avr_base_arch_macro) \ builtin_define (avr_base_arch_macro); \ if (avr_extra_arch_macro) \ builtin_define (avr_extra_arch_macro); \ if (avr_asm_only_p) \ builtin_define ("__AVR_ASM_ONLY__"); \ if (avr_enhanced_p) \ builtin_define ("__AVR_ENHANCED__"); \ if (avr_mega_p) \ builtin_define ("__AVR_MEGA__"); \ if (TARGET_NO_INTERRUPTS) \ builtin_define ("__NO_INTERRUPTS__"); \ } \ while (0)/* This declaration should be present. */extern int target_flags;#define MASK_RTL_DUMP 0x00000010#define MASK_ALL_DEBUG 0x00000FE0#define MASK_ORDER_1 0x00001000#define MASK_INSN_SIZE_DUMP 0x00002000#define MASK_ORDER_2 0x00004000#define MASK_NO_TABLEJUMP 0x00008000#define MASK_INT8 0x00010000#define MASK_NO_INTERRUPTS 0x00020000#define MASK_CALL_PROLOGUES 0x00040000#define MASK_TINY_STACK 0x00080000#define MASK_SHORT_CALLS 0x00100000#define TARGET_ORDER_1 (target_flags & MASK_ORDER_1)#define TARGET_ORDER_2 (target_flags & MASK_ORDER_2)#define TARGET_INT8 (target_flags & MASK_INT8)#define TARGET_NO_INTERRUPTS (target_flags & MASK_NO_INTERRUPTS)#define TARGET_INSN_SIZE_DUMP (target_flags & MASK_INSN_SIZE_DUMP)#define TARGET_CALL_PROLOGUES (target_flags & MASK_CALL_PROLOGUES)#define TARGET_TINY_STACK (target_flags & MASK_TINY_STACK)#define TARGET_NO_TABLEJUMP (target_flags & MASK_NO_TABLEJUMP)#define TARGET_SHORT_CALLS (target_flags & MASK_SHORT_CALLS)/* Dump each assembler insn's rtl into the output file. This is for debugging the compiler itself. */#define TARGET_RTL_DUMP (target_flags & MASK_RTL_DUMP)#define TARGET_ALL_DEBUG (target_flags & MASK_ALL_DEBUG)#define TARGET_SWITCHES { \ { "order1", MASK_ORDER_1, NULL }, \ { "order2", MASK_ORDER_2, NULL }, \ { "int8", MASK_INT8, N_("Assume int to be 8 bit integer") }, \ { "no-interrupts", MASK_NO_INTERRUPTS, \ N_("Change the stack pointer without disabling interrupts") }, \ { "call-prologues", MASK_CALL_PROLOGUES, \ N_("Use subroutines for function prologue/epilogue") }, \ { "tiny-stack", MASK_TINY_STACK, \ N_("Change only the low 8 bits of the stack pointer") }, \ { "no-tablejump", MASK_NO_TABLEJUMP, \ N_("Do not generate tablejump insns") }, \ { "short-calls", MASK_SHORT_CALLS, \ N_("Use rjmp/rcall (limited range) on >8K devices") }, \ { "rtl", MASK_RTL_DUMP, NULL }, \ { "size", MASK_INSN_SIZE_DUMP, \ N_("Output instruction sizes to the asm file") }, \ { "deb", MASK_ALL_DEBUG, NULL }, \ { "", 0, NULL } }extern const char *avr_init_stack;extern const char *avr_mcu_name;extern const char *avr_base_arch_macro;extern const char *avr_extra_arch_macro;extern int avr_mega_p;extern int avr_enhanced_p;extern int avr_asm_only_p;#define AVR_MEGA (avr_mega_p && !TARGET_SHORT_CALLS)#define AVR_ENHANCED (avr_enhanced_p)#define TARGET_OPTIONS { \ { "init-stack=", &avr_init_stack, N_("Specify the initial stack address") }, \ { "mcu=", &avr_mcu_name, N_("Specify the MCU name") } }#define TARGET_VERSION fprintf (stderr, " (GNU assembler syntax)");/* This macro is a C statement to print on `stderr' a string describing the particular machine description choice. Every machine description should define `TARGET_VERSION'. For example: #ifdef MOTOROLA #define TARGET_VERSION \ fprintf (stderr, " (68k, Motorola syntax)"); #else #define TARGET_VERSION \ fprintf (stderr, " (68k, MIT syntax)"); #endif */#define OVERRIDE_OPTIONS avr_override_options ()/* `OVERRIDE_OPTIONS' Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro `OVERRIDE_OPTIONS' to take account of this. This macro, if defined, is executed once just after all the command options have been parsed. Don't use this macro to turn on various extra optimizations for `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */#define CAN_DEBUG_WITHOUT_FP/* Define this macro if debugging can be performed even without a frame pointer. If this macro is defined, GNU CC will turn on the `-fomit-frame-pointer' option whenever `-O' is specified. *//* Define this if most significant byte of a word is the lowest numbered. */#define BITS_BIG_ENDIAN 0/* Define this if most significant byte of a word is the lowest numbered. */#define BYTES_BIG_ENDIAN 0/* Define this if most significant word of a multiword number is the lowest numbered. */#define WORDS_BIG_ENDIAN 0#ifdef IN_LIBGCC2/* This is to get correct SI and DI modes in libgcc2.c (32 and 64 bits). */#define UNITS_PER_WORD 4#else/* Width of a word, in units (bytes). */#define UNITS_PER_WORD 1#endif/* Width in bits of a pointer. See also the macro `Pmode' defined below. */#define POINTER_SIZE 16/* Maximum sized of reasonable data type DImode or Dfmode ... */#define MAX_FIXED_MODE_SIZE 32/* Allocation boundary (in *bits*) for storing arguments in argument list. */#define PARM_BOUNDARY 8/* Allocation boundary (in *bits*) for the code of a function. */#define FUNCTION_BOUNDARY 8/* Alignment of field after `int : 0' in a structure. */#define EMPTY_FIELD_BOUNDARY 8/* No data type wants to be aligned rounder than this. */#define BIGGEST_ALIGNMENT 8/* Define this if move instructions will actually fail to work when given unaligned data. */#define STRICT_ALIGNMENT 0/* A C expression for the size in bits of the type `int' on the target machine. If you don't define this, the default is one word. */#define INT_TYPE_SIZE (TARGET_INT8 ? 8 : 16)/* A C expression for the size in bits of the type `short' on the target machine. If you don't define this, the default is half a word. (If this would be less than one storage unit, it is rounded up to one unit.) */#define SHORT_TYPE_SIZE (INT_TYPE_SIZE == 8 ? INT_TYPE_SIZE : 16)/* A C expression for the size in bits of the type `long' on the target machine. If you don't define this, the default is one word. */#define LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 16 : 32)#define MAX_LONG_TYPE_SIZE 32/* Maximum number for the size in bits of the type `long' on the target machine. If this is undefined, the default is `LONG_TYPE_SIZE'. Otherwise, it is the constant value that is the largest value that `LONG_TYPE_SIZE' can have at run-time. This is used in `cpp'. */#define LONG_LONG_TYPE_SIZE 64/* A C expression for the size in bits of the type `long long' on the target machine. If you don't define this, the default is two words. If you want to support GNU Ada on your machine, the value of macro must be at least 64. */#define FLOAT_TYPE_SIZE 32/* A C expression for the size in bits of the type `float' on the target machine. If you don't define this, the default is one word. */#define DOUBLE_TYPE_SIZE 32/* A C expression for the size in bits of the type `double' on the target machine. If you don't define this, the default is two words. */#define LONG_DOUBLE_TYPE_SIZE 32/* A C expression for the size in bits of the type `long double' on the target machine. If you don't define this, the default is two words. */#define DEFAULT_SIGNED_CHAR 1/* An expression whose value is 1 or 0, according to whether the type `char' should be signed or unsigned by default. The user can always override this default with the options `-fsigned-char' and `-funsigned-char'. *//* `DEFAULT_SHORT_ENUMS' A C expression to determine whether to give an `enum' type only as many bytes as it takes to represent the range of possible values of that type. A nonzero value means to do that; a zero value means all `enum' types should be allocated like `int'. If you don't define the macro, the default is 0. */#define SIZE_TYPE (INT_TYPE_SIZE == 8 ? "long unsigned int" : "unsigned int")/* A C expression for a string describing the name of the data type to use for size values. The typedef name `size_t' is defined using the contents of the string. The string can contain more than one keyword. If so, separate them with spaces, and write first any length keyword, then `unsigned' if appropriate, and finally `int'. The string must exactly match one of the data type names defined in the function `init_decl_processing' in the file `c-decl.c'. You may not omit `int' or change the order--that would cause the compiler to crash on startup. If you don't define this macro, the default is `"long unsigned int"'. */#define PTRDIFF_TYPE (INT_TYPE_SIZE == 8 ? "long int" :"int")/* A C expression for a string describing the name of the data type to use for the result of subtracting two pointers. The typedef name `ptrdiff_t' is defined using the contents of the string. See `SIZE_TYPE' above for more information. If you don't define this macro, the default is `"long int"'. */#define WCHAR_TYPE_SIZE 16/* A C expression for the size in bits of the data type for wide characters. This is used in `cpp', which cannot make use of `WCHAR_TYPE'. */#define FIRST_PSEUDO_REGISTER 36/* Number of hardware registers known to the compiler. They receive numbers 0 through `FIRST_PSEUDO_REGISTER-1'; thus, the first pseudo register's number really is assigned the number `FIRST_PSEUDO_REGISTER'. */#define FIXED_REGISTERS {\ 1,1,/* r0 r1 */\ 0,0,/* r2 r3 */\ 0,0,/* r4 r5 */\ 0,0,/* r6 r7 */\ 0,0,/* r8 r9 */\ 0,0,/* r10 r11 */\ 0,0,/* r12 r13 */\ 0,0,/* r14 r15 */\ 0,0,/* r16 r17 */\ 0,0,/* r18 r19 */\ 0,0,/* r20 r21 */\ 0,0,/* r22 r23 */\ 0,0,/* r24 r25 */\ 0,0,/* r26 r27 */\ 0,0,/* r28 r29 */\ 0,0,/* r30 r31 */\ 1,1,/* STACK */\
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -