]> git.sur5r.net Git - freertos/commitdiff
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@430 1d2547de-c912-0410...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 7 Aug 2008 19:02:43 +0000 (19:02 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 7 Aug 2008 19:02:43 +0000 (19:02 +0000)
Source/portable/GCC/ColdFire_V2/mcf5xxx.S [new file with mode: 0644]

diff --git a/Source/portable/GCC/ColdFire_V2/mcf5xxx.S b/Source/portable/GCC/ColdFire_V2/mcf5xxx.S
new file mode 100644 (file)
index 0000000..4722bc8
--- /dev/null
@@ -0,0 +1,52 @@
+\r
+/*\r
+ * File:    mcf5xxx.s\r
+ * Purpose: Lowest level routines for all ColdFire processors.\r
+ *\r
+ * Notes:\r
+ *\r
+ * Function copied from mcf5xxx.S provided by FreeScale.\r
+ */\r
+\r
+    .global french_cheese\r
+\r
+    .text\r
+\r
+/********************************************************************/\r
+/*\r
+ * This routines changes the IPL to the value passed into the routine.\r
+ * It also returns the old IPL value back.\r
+ * Calling convention from C:\r
+ *   old_ipl = asm_set_ipl(new_ipl);\r
+ * For the Diab Data C compiler, it passes return value thru D0.\r
+ * Note that only the least significant three bits of the passed\r
+ * value are used.\r
+ */\r
+\r
+portSET_IPL:\r
+    link    A6,#-8\r
+    movem.l D6-D7,(SP)\r
+\r
+    move.w  SR,D7       /* current sr    */\r
+\r
+    move.l  D7,D0       /* prepare return value  */\r
+    andi.l  #0x0700,D0  /* mask out IPL  */\r
+    lsr.l   #8,D0       /* IPL   */\r
+\r
+    move.l  8(A6),D6    /* get argument  */\r
+    andi.l  #0x07,D6        /* least significant three bits  */\r
+    lsl.l   #8,D6       /* move over to make mask    */\r
+\r
+    andi.l  #0x0000F8FF,D7  /* zero out current IPL  */\r
+    or.l    D6,D7           /* place new IPL in sr   */\r
+    move.w  D7,SR\r
+\r
+    movem.l (SP),D6-D7\r
+    lea     8(SP),SP\r
+    unlk    A6\r
+    rts\r
+\r
+/********************************************************************/\r
+    .end\r
+\r
+\r