浏览代码

* fixed compilation of AVR compiler

git-svn-id: trunk@13342 -
florian 16 年之前
父节点
当前提交
60169d34dc
共有 5 个文件被更改,包括 31 次插入5 次删除
  1. 0 1
      compiler/arm/cpuinfo.pas
  2. 1 1
      compiler/avr/cgcpu.pas
  3. 27 0
      compiler/avr/cpuinfo.pas
  4. 1 1
      compiler/avr/navrmat.pas
  5. 2 2
      compiler/globals.pas

+ 0 - 1
compiler/arm/cpuinfo.pas

@@ -120,7 +120,6 @@ Const
       'AT91SAM7x256'
       'AT91SAM7x256'
      );
      );
 
 
-
    { Supported optimizations, only used for information }
    { Supported optimizations, only used for information }
    supported_optimizerswitches = genericlevel1optimizerswitches+
    supported_optimizerswitches = genericlevel1optimizerswitches+
                                  genericlevel2optimizerswitches+
                                  genericlevel2optimizerswitches+

+ 1 - 1
compiler/avr/cgcpu.pas

@@ -181,7 +181,7 @@ unit cgcpu;
                 a_load_ref_reg(list,location^.size,location^.size,tmpref,location^.register);
                 a_load_ref_reg(list,location^.size,location^.size,tmpref,location^.register);
               LOC_REFERENCE:
               LOC_REFERENCE:
                 begin
                 begin
-                  reference_reset_base(ref,location^.reference.index,location^.reference.offset,araloc.alignment);
+                  reference_reset_base(ref,location^.reference.index,location^.reference.offset,paraloc.alignment);
                   { doubles in softemu mode have a strange order of registers and references }
                   { doubles in softemu mode have a strange order of registers and references }
                   if location^.size=OS_32 then
                   if location^.size=OS_32 then
                     g_concatcopy(list,tmpref,ref,4)
                     g_concatcopy(list,tmpref,ref,4)

+ 27 - 0
compiler/avr/cpuinfo.pas

@@ -40,6 +40,16 @@ Type
       fp_libgcc
       fp_libgcc
      );
      );
 
 
+   tcontrollertype =
+     (ct_none,
+
+      ct_atmega16,
+      ct_atmega32,
+      ct_atmega48,
+      ct_atmega64,
+      ct_atmega128
+     );
+
 Const
 Const
    {# Size of native extended floating point type }
    {# Size of native extended floating point type }
    extended_size = 12;
    extended_size = 12;
@@ -71,6 +81,23 @@ Const
      'LIBGCC'
      'LIBGCC'
    );
    );
 
 
+   controllertypestr : array[tcontrollertype] of string[20] =
+     ('',
+      'ATMEGA16',
+      'ATMEGA32',
+      'ATMEGA48',
+      'ATMEGA64',
+      'ATMEGA128'
+     );
+
+   controllerunitstr : array[tcontrollertype] of string[20] =
+     ('',
+      'ATMEGA16',
+      'ATMEGA32',
+      'ATMEGA48',
+      'ATMEGA64',
+      'ATMEGA128'
+     );
    { Supported optimizations, only used for information }
    { Supported optimizations, only used for information }
    supported_optimizerswitches = genericlevel1optimizerswitches+
    supported_optimizerswitches = genericlevel1optimizerswitches+
                                  genericlevel2optimizerswitches+
                                  genericlevel2optimizerswitches+

+ 1 - 1
compiler/avr/navrmat.pas

@@ -123,8 +123,8 @@ implementation
        procedure genOrdConstNodeMod;
        procedure genOrdConstNodeMod;
          var
          var
              modreg, maskreg, tempreg : tregister;
              modreg, maskreg, tempreg : tregister;
-{
          begin
          begin
+{
              if (tordconstnode(right).value = 0) then begin
              if (tordconstnode(right).value = 0) then begin
                  internalerror(2005061702);
                  internalerror(2005061702);
              end
              end

+ 2 - 2
compiler/globals.pas

@@ -138,9 +138,9 @@ interface
          disabledircache : boolean;
          disabledircache : boolean;
 
 
         { CPU targets with microcontroller support can add a controller specific unit }
         { CPU targets with microcontroller support can add a controller specific unit }
-{$if defined(ARM)}
+{$if defined(ARM) or defined(AVR)}
         controllertype   : tcontrollertype;
         controllertype   : tcontrollertype;
-{$endif defined(ARM)}
+{$endif defined(ARM) or defined(AVR)}
        end;
        end;
 
 
     const
     const