CVS: gcc/gcc-3.3/gcc/config/msp430 msp430.c, 1.92, 1.93

Chris Liechti <[email protected]> Tue, 13 Feb 2007 07:24:43 -0800
Newsgroups gmane.comp.hardware.texas-instruments.msp430.gcc.cvs
Message-ID <[email protected]>
Update of /cvsroot/mspgcc/gcc/gcc-3.3/gcc/config/msp430
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv22423/gcc/gcc-3.3/gcc/config/msp430

Modified Files:
	msp430.c 
Log Message:
fix for MSP430X arch wich has larger interrupt table

Index: msp430.c
===================================================================
RCS file: /cvsroot/mspgcc/gcc/gcc-3.3/gcc/config/msp430/msp430.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -w -d -r1.92 -r1.93
--- msp430.c	13 Jan 2007 14:29:50 -0000	1.92
+++ msp430.c	13 Feb 2007 15:24:40 -0000	1.93
@@ -434,6 +434,34 @@
   return a != NULL_TREE;
 }
 
+enum msp430_arch
+msp430_get_arch ()
+{
+  const struct mcu_type_s *t;
+
+  for (t = msp430_mcu_types; t->name; t++)
+    {
+      if (strcmp (t->name, msp430_mcu_name) == 0)
+	break;
+    }
+
+  if (!t->name)
+    {
+      error ("MCU %s not supported", msp430_mcu_name);
+      fprintf (stderr, "Known MCU names:\n");
+      for (t = msp430_mcu_types; t->name; t++)
+	fprintf (stderr, "   %s\n", t->name);
+      abort ();
+      return -1;
+    }
+  return t->arch;
+}
+
+int
+msp430_is_xarch ()
+{
+    return (msp430_get_arch() == MSP430_ISA_46);
+}
 
 void
 msp430_override_options ()
@@ -583,6 +611,7 @@
   int interrupt_func_p;
   tree ss = 0;
   int vector = -1;
+  int vectors_start;
   int cfp = msp430_critical_function_p (current_function_decl);
   int ree = msp430_reentrant_function_p (current_function_decl);
 
@@ -596,6 +625,15 @@
        * .type   This_func1,@function
        *
        */
+      if (msp430_is_xarch())
+        {
+          vectors_start = 0xffc0;
+        }
+      else
+        {
+          vectors_start = 0xffe0;
+        }
+    
       ss = lookup_attribute ("interrupt",
 			     DECL_ATTRIBUTES (current_function_decl));
       ss = TREE_VALUE (ss);
@@ -606,7 +644,7 @@
 	    vector = TREE_INT_CST_LOW (ss);
 
 	  if (vector != NOVECTOR)
-	    vector += 0xffe0ul;
+	    vector += vectors_start;
 	}
 
       if (vector == -1)
@@ -614,7 +652,7 @@
 	  warning ("No valid interrupt vector assigned to ISR `%s'.", name);
 	}
 
-      if ((vector < 0xffe0 || vector > 0xfffe || (vector & 1))
+      if ((vector < vectors_start || vector > 0xfffe || (vector & 1))
 	  && (vector != NOVECTOR && vector != -1))
 	{
 	  warning


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642