<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2011-09-24)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>sh</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-09-24 Sebastian Huber <sebastian.huber@embedded-brains.de>

        PR 1921/cpukit
        * score/inline/rtems/score/thread.inl,
        score/src/threadstartmultitasking.c: Allow CPU port to provide
        optional multitasking start and stop.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2924&r2=text&tr2=1.2925&diff_format=h">M</a></td><td width='1%'>1.2925</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/inline/rtems/score/thread.inl.diff?r1=text&tr1=1.46&r2=text&tr2=1.47&diff_format=h">M</a></td><td width='1%'>1.47</td><td width='100%'>cpukit/score/inline/rtems/score/thread.inl</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/threadstartmultitasking.c.diff?r1=text&tr1=1.13&r2=text&tr2=1.14&diff_format=h">M</a></td><td width='1%'>1.14</td><td width='100%'>cpukit/score/src/threadstartmultitasking.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2924 rtems/cpukit/ChangeLog:1.2925
--- rtems/cpukit/ChangeLog:1.2924       Tue Sep 20 08:06:41 2011
+++ rtems/cpukit/ChangeLog      Sat Sep 24 07:45:55 2011
</font><font color='#997700'>@@ -1,3 +1,10 @@
</font><font color='#000088'>+2011-09-24    Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+       PR 1921/cpukit
+       * score/inline/rtems/score/thread.inl,
+       score/src/threadstartmultitasking.c: Allow CPU port to provide
+       optional multitasking start and stop.
+
</font> 2011-09-20        Petr Benes <benesp16@fel.cvut.cz>
 
        PR 1916/testing

<font color='#006600'>diff -u rtems/cpukit/score/inline/rtems/score/thread.inl:1.46 rtems/cpukit/score/inline/rtems/score/thread.inl:1.47
--- rtems/cpukit/score/inline/rtems/score/thread.inl:1.46       Mon May 23 08:30:15 2011
+++ rtems/cpukit/score/inline/rtems/score/thread.inl    Sat Sep 24 07:45:55 2011
</font><font color='#997700'>@@ -111,6 +111,9 @@
</font> 
 RTEMS_INLINE_ROUTINE void _Thread_Stop_multitasking( void )
 {
<font color='#000088'>+#if defined(_CPU_Stop_multitasking)
+  _CPU_Stop_multitasking( &_Thread_BSP_context );
+#else
</font>   /*
    *  This may look a bit of an odd but _Context_Restart_self is just
    *  a very careful restore of a specific context which ensures that
<font color='#997700'>@@ -120,6 +123,7 @@
</font>    *  saving the context.
    */
   _Context_Restart_self( &_Thread_BSP_context );
<font color='#000088'>+#endif
</font> 
   /***************************************************************
    ***************************************************************

<font color='#006600'>diff -u rtems/cpukit/score/src/threadstartmultitasking.c:1.13 rtems/cpukit/score/src/threadstartmultitasking.c:1.14
--- rtems/cpukit/score/src/threadstartmultitasking.c:1.13       Sun Jul 24 18:55:14 2011
+++ rtems/cpukit/score/src/threadstartmultitasking.c    Sat Sep 24 07:45:55 2011
</font><font color='#997700'>@@ -86,5 +86,9 @@
</font>      _Context_Restore_fp( &_Thread_Heir->fp_context );
 #endif
 
<font color='#000088'>+#if defined(_CPU_Start_multitasking)
+  _CPU_Start_multitasking( &_Thread_BSP_context, &_Thread_Heir->Registers );
+#else
</font>   _Context_Switch( &_Thread_BSP_context, &_Thread_Heir->Registers );
<font color='#000088'>+#endif
</font> }
</pre>
<p> </p>
<a name='cs2'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>sh</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-09-24 Sebastian Huber <sebastian.huber@embedded-brains.de>

        * rtems/score/armv7m.h, armv7m-context-initialize.c,
        armv7m-context-restore.c, armv7m-context-switch.c,
        armv7m-exception-handler-get.c, armv7m-exception-handler-set.c,
        armv7m-exception-priority-get.c, armv7m-exception-priority-set.c,
        armv7m-initialize.c, armv7m-isr-dispatch.c, armv7m-isr-enter-leave.c,
        armv7m-isr-level-get.c, armv7m-isr-level-set.c,
        armv7m-isr-vector-install.c, armv7m-multitasking-start-stop.c: New
        files.
        * Makefile.am, preinstall.am: Reflect changes above.
        * rtems/score/arm.h: Define ARM_MULTILIB_ARCH_V4 and
        ARM_MULTILIB_ARCH_V7M.
        * rtems/score/cpu.h, cpu_asm.S, cpu.c, arm_exc_abort.S,
        arm_exc_handler_high.c, arm_exc_handler_low.S, arm_exc_interrupt.S:
        Define CPU_HAS_HARDWARE_INTERRUPT_STACK to FALSE.  Use
        ARM_MULTILIB_ARCH_V4 and ARM_MULTILIB_ARCH_V7M.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/ChangeLog.diff?r1=text&tr1=1.131&r2=text&tr2=1.132&diff_format=h">M</a></td><td width='1%'>1.132</td><td width='100%'>cpukit/score/cpu/arm/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/Makefile.am.diff?r1=text&tr1=1.42&r2=text&tr2=1.43&diff_format=h">M</a></td><td width='1%'>1.43</td><td width='100%'>cpukit/score/cpu/arm/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/arm_exc_abort.S.diff?r1=text&tr1=1.5&r2=text&tr2=1.6&diff_format=h">M</a></td><td width='1%'>1.6</td><td width='100%'>cpukit/score/cpu/arm/arm_exc_abort.S</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/arm_exc_handler_high.c.diff?r1=text&tr1=1.4&r2=text&tr2=1.5&diff_format=h">M</a></td><td width='1%'>1.5</td><td width='100%'>cpukit/score/cpu/arm/arm_exc_handler_high.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/arm_exc_handler_low.S.diff?r1=text&tr1=1.5&r2=text&tr2=1.6&diff_format=h">M</a></td><td width='1%'>1.6</td><td width='100%'>cpukit/score/cpu/arm/arm_exc_handler_low.S</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/arm_exc_interrupt.S.diff?r1=text&tr1=1.6&r2=text&tr2=1.7&diff_format=h">M</a></td><td width='1%'>1.7</td><td width='100%'>cpukit/score/cpu/arm/arm_exc_interrupt.S</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/armv7m-context-initialize.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/cpu/arm/armv7m-context-initialize.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/armv7m-context-restore.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/cpu/arm/armv7m-context-restore.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/armv7m-context-switch.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/cpu/arm/armv7m-context-switch.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/armv7m-exception-handler-get.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/cpu/arm/armv7m-exception-handler-get.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/armv7m-exception-handler-set.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/cpu/arm/armv7m-exception-handler-set.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/armv7m-exception-priority-get.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/cpu/arm/armv7m-exception-priority-get.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/armv7m-exception-priority-set.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/cpu/arm/armv7m-exception-priority-set.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/armv7m-initialize.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/cpu/arm/armv7m-initialize.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/armv7m-isr-dispatch.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/cpu/arm/armv7m-isr-dispatch.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/armv7m-isr-enter-leave.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/cpu/arm/armv7m-isr-enter-leave.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/armv7m-isr-level-get.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/cpu/arm/armv7m-isr-level-get.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/armv7m-isr-level-set.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/cpu/arm/armv7m-isr-level-set.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/armv7m-isr-vector-install.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/cpu/arm/armv7m-isr-vector-install.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/armv7m-multitasking-start-stop.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/cpu/arm/armv7m-multitasking-start-stop.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/cpu.c.diff?r1=text&tr1=1.32&r2=text&tr2=1.33&diff_format=h">M</a></td><td width='1%'>1.33</td><td width='100%'>cpukit/score/cpu/arm/cpu.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/cpu_asm.S.diff?r1=text&tr1=1.13&r2=text&tr2=1.14&diff_format=h">M</a></td><td width='1%'>1.14</td><td width='100%'>cpukit/score/cpu/arm/cpu_asm.S</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/preinstall.am.diff?r1=text&tr1=1.6&r2=text&tr2=1.7&diff_format=h">M</a></td><td width='1%'>1.7</td><td width='100%'>cpukit/score/cpu/arm/preinstall.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/rtems/score/arm.h.diff?r1=text&tr1=1.20&r2=text&tr2=1.21&diff_format=h">M</a></td><td width='1%'>1.21</td><td width='100%'>cpukit/score/cpu/arm/rtems/score/arm.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/rtems/score/armv7m.h?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/cpu/arm/rtems/score/armv7m.h</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/cpu/arm/rtems/score/cpu.h.diff?r1=text&tr1=1.48&r2=text&tr2=1.49&diff_format=h">M</a></td><td width='1%'>1.49</td><td width='100%'>cpukit/score/cpu/arm/rtems/score/cpu.h</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/score/cpu/arm/ChangeLog:1.131 rtems/cpukit/score/cpu/arm/ChangeLog:1.132
--- rtems/cpukit/score/cpu/arm/ChangeLog:1.131  Fri Sep 16 04:47:09 2011
+++ rtems/cpukit/score/cpu/arm/ChangeLog        Sat Sep 24 07:56:50 2011
</font><font color='#997700'>@@ -1,3 +1,21 @@
</font><font color='#000088'>+2011-09-24    Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+       * rtems/score/armv7m.h, armv7m-context-initialize.c,
+       armv7m-context-restore.c, armv7m-context-switch.c,
+       armv7m-exception-handler-get.c, armv7m-exception-handler-set.c,
+       armv7m-exception-priority-get.c, armv7m-exception-priority-set.c,
+       armv7m-initialize.c, armv7m-isr-dispatch.c, armv7m-isr-enter-leave.c,
+       armv7m-isr-level-get.c, armv7m-isr-level-set.c,
+       armv7m-isr-vector-install.c, armv7m-multitasking-start-stop.c: New
+       files.
+       * Makefile.am, preinstall.am: Reflect changes above.
+       * rtems/score/arm.h: Define ARM_MULTILIB_ARCH_V4 and
+       ARM_MULTILIB_ARCH_V7M.
+       * rtems/score/cpu.h, cpu_asm.S, cpu.c, arm_exc_abort.S,
+       arm_exc_handler_high.c, arm_exc_handler_low.S, arm_exc_interrupt.S:
+       Define CPU_HAS_HARDWARE_INTERRUPT_STACK to FALSE.  Use
+       ARM_MULTILIB_ARCH_V4 and ARM_MULTILIB_ARCH_V7M.
+
</font> 2011-09-16        Sebastian Huber <sebastian.huber@embedded-brains.de>
 
        * rtems/score/arm.h: More CPU_MODEL_NAME variants.

<font color='#006600'>diff -u rtems/cpukit/score/cpu/arm/Makefile.am:1.42 rtems/cpukit/score/cpu/arm/Makefile.am:1.43
--- rtems/cpukit/score/cpu/arm/Makefile.am:1.42 Wed May 18 00:18:22 2011
+++ rtems/cpukit/score/cpu/arm/Makefile.am      Sat Sep 24 07:56:50 2011
</font><font color='#997700'>@@ -9,16 +9,32 @@
</font> include_rtems_score_HEADERS = rtems/score/cpu.h
 include_rtems_score_HEADERS += rtems/score/cpu_asm.h
 include_rtems_score_HEADERS += rtems/score/arm.h
<font color='#000088'>+include_rtems_score_HEADERS += rtems/score/armv7m.h
</font> include_rtems_score_HEADERS += rtems/score/types.h
 
 noinst_LIBRARIES = libscorecpu.a
 libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)
<font color='#880000'>-libscorecpu_a_SOURCES = cpu.c \
-       cpu_asm.S \
-       arm_exc_abort.S \
-       arm_exc_interrupt.S \
-       arm_exc_handler_low.S \
-       arm_exc_handler_high.c
</font><font color='#000088'>+libscorecpu_a_SOURCES =
+libscorecpu_a_SOURCES += cpu.c
+libscorecpu_a_SOURCES += cpu_asm.S
+libscorecpu_a_SOURCES += arm_exc_abort.S
+libscorecpu_a_SOURCES += arm_exc_interrupt.S
+libscorecpu_a_SOURCES += arm_exc_handler_low.S
+libscorecpu_a_SOURCES += arm_exc_handler_high.c
+libscorecpu_a_SOURCES += armv7m-context-initialize.c
+libscorecpu_a_SOURCES += armv7m-context-restore.c
+libscorecpu_a_SOURCES += armv7m-context-switch.c
+libscorecpu_a_SOURCES += armv7m-exception-handler-get.c
+libscorecpu_a_SOURCES += armv7m-exception-handler-set.c
+libscorecpu_a_SOURCES += armv7m-exception-priority-get.c
+libscorecpu_a_SOURCES += armv7m-exception-priority-set.c
+libscorecpu_a_SOURCES += armv7m-initialize.c
+libscorecpu_a_SOURCES += armv7m-isr-dispatch.c
+libscorecpu_a_SOURCES += armv7m-isr-enter-leave.c
+libscorecpu_a_SOURCES += armv7m-isr-level-get.c
+libscorecpu_a_SOURCES += armv7m-isr-level-set.c
+libscorecpu_a_SOURCES += armv7m-isr-vector-install.c
+libscorecpu_a_SOURCES += armv7m-multitasking-start-stop.c
</font> 
 include $(srcdir)/preinstall.am
 include $(top_srcdir)/automake/local.am

<font color='#006600'>diff -u rtems/cpukit/score/cpu/arm/arm_exc_abort.S:1.5 rtems/cpukit/score/cpu/arm/arm_exc_abort.S:1.6
--- rtems/cpukit/score/cpu/arm/arm_exc_abort.S:1.5      Tue Nov 23 09:59:18 2010
+++ rtems/cpukit/score/cpu/arm/arm_exc_abort.S  Sat Sep 24 07:56:50 2011
</font><font color='#997700'>@@ -26,6 +26,8 @@
</font> #include <rtems/asm.h>
 #include <rtems/system.h>
 
<font color='#000088'>+#ifdef ARM_MULTILIB_ARCH_V4
+
</font> .extern rtems_fatal_error_occurred
 
 .globl arm_exc_data_abort_set_handler
<font color='#997700'>@@ -133,3 +135,5 @@
</font> call_handler:
        bx      r2
 #endif /* __thumb__ */
<font color='#000088'>+
+#endif /* ARM_MULTILIB_ARCH_V4 */
</font>
<font color='#006600'>diff -u rtems/cpukit/score/cpu/arm/arm_exc_handler_high.c:1.4 rtems/cpukit/score/cpu/arm/arm_exc_handler_high.c:1.5
--- rtems/cpukit/score/cpu/arm/arm_exc_handler_high.c:1.4       Thu Apr  8 05:13:46 2010
+++ rtems/cpukit/score/cpu/arm/arm_exc_handler_high.c   Sat Sep 24 07:56:50 2011
</font><font color='#997700'>@@ -36,6 +36,8 @@
</font> #include <rtems/score/thread.h>
 #include <rtems/score/cpu.h>
 
<font color='#000088'>+#ifdef ARM_MULTILIB_ARCH_V4
+
</font> static void _defaultExcHandler (CPU_Exception_frame *ctx)
 {
     printk("\n\r");
<font color='#997700'>@@ -119,3 +121,5 @@
</font> 
       _CPU_ISR_Enable(level);
 }
<font color='#000088'>+
+#endif /* ARM_MULTILIB_ARCH_V4 */
</font>
<font color='#006600'>diff -u rtems/cpukit/score/cpu/arm/arm_exc_handler_low.S:1.5 rtems/cpukit/score/cpu/arm/arm_exc_handler_low.S:1.6
--- rtems/cpukit/score/cpu/arm/arm_exc_handler_low.S:1.5        Thu Apr  8 05:13:46 2010
+++ rtems/cpukit/score/cpu/arm/arm_exc_handler_low.S    Sat Sep 24 07:56:50 2011
</font><font color='#997700'>@@ -33,6 +33,8 @@
</font> #include <rtems/asm.h>
 #include <rtems/score/cpu_asm.h>
 
<font color='#000088'>+#ifdef ARM_MULTILIB_ARCH_V4
+
</font>         .text
 
 /* FIXME:       _Exception_Handler_Undef_Swi is untested */
<font color='#997700'>@@ -162,3 +164,5 @@
</font>   subs    pc, r14, #4
 #endif
                                                /* _AFTER_ the aborted one */
<font color='#000088'>+
+#endif /* ARM_MULTILIB_ARCH_V4 */
</font>
<font color='#006600'>diff -u rtems/cpukit/score/cpu/arm/arm_exc_interrupt.S:1.6 rtems/cpukit/score/cpu/arm/arm_exc_interrupt.S:1.7
--- rtems/cpukit/score/cpu/arm/arm_exc_interrupt.S:1.6  Mon Jun 28 19:31:02 2010
+++ rtems/cpukit/score/cpu/arm/arm_exc_interrupt.S      Sat Sep 24 07:56:50 2011
</font><font color='#997700'>@@ -32,6 +32,8 @@
</font> #include <rtems/asm.h>
 #include <rtems/score/percpu.h>
 
<font color='#000088'>+#ifdef ARM_MULTILIB_ARCH_V4
+
</font> #define EXCHANGE_LR r4
 #define EXCHANGE_SPSR r5
 #define EXCHANGE_CPSR r6
<font color='#997700'>@@ -175,3 +177,5 @@
</font> 
        /* Return from interrupt */
        subs    pc, lr, #4
<font color='#000088'>+
+#endif /* ARM_MULTILIB_ARCH_V4 */
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/cpu/arm/armv7m-context-initialize.c:1.1
--- /dev/null   Sat Sep 24 08:11:59 2011
+++ rtems/cpukit/score/cpu/arm/armv7m-context-initialize.c      Sat Sep 24 07:56:50 2011
</font><font color='#997700'>@@ -0,0 +1,44 @@
</font><font color='#000088'>+/*
+ * Copyright (c) 2011 Sebastian Huber.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <string.h>
+
+#include <rtems/score/thread.h>
+
+#ifdef ARM_MULTILIB_ARCH_V7M
+
+#include <rtems/score/armv7m.h>
+
+void _CPU_Context_Initialize(
+  Context_Control *context,
+  void *stack_area_begin,
+  size_t stack_area_size,
+  uint32_t new_level,
+  void (*entry_point)( void ),
+  bool is_fp
+)
+{
+  char *stack_area_end = (char *) stack_area_begin + stack_area_size;
+
+  memset(context, 0, sizeof(*context));
+
+  context->register_lr = entry_point;
+  context->register_sp = stack_area_end;
+}
+
+#endif /* ARM_MULTILIB_ARCH_V7M */
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/cpu/arm/armv7m-context-restore.c:1.1
--- /dev/null   Sat Sep 24 08:12:00 2011
+++ rtems/cpukit/score/cpu/arm/armv7m-context-restore.c Sat Sep 24 07:56:50 2011
</font><font color='#997700'>@@ -0,0 +1,45 @@
</font><font color='#000088'>+/*
+ * Copyright (c) 2011 Sebastian Huber.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <rtems/score/percpu.h>
+
+#ifdef ARM_MULTILIB_ARCH_V7M
+
+#include <rtems/score/armv7m.h>
+
+void __attribute__((naked)) _CPU_Context_restore(
+  Context_Control *heir
+)
+{
+  __asm__ volatile (
+    "movw r2, #:lower16:_Per_CPU_Information\n"
+    "movt r2, #:upper16:_Per_CPU_Information\n"
+    "ldr r3, [r0, %[isrctxoff]]\n"
+    "ldr sp, [r0, %[spctxoff]]\n"
+    "ldm r0, {r4-r11, lr}\n"
+    "str r3, [r2, %[isrpcpuoff]]\n"
+    "bx lr\n"
+    :
+    : [spctxoff] "J" (offsetof(Context_Control, register_sp)),
+      [isrctxoff] "J" (offsetof(Context_Control, isr_nest_level)),
+      [isrpcpuoff] "J" (offsetof(Per_CPU_Control, isr_nest_level))
+  );
+  __builtin_unreachable();
+}
+
+#endif /* ARM_MULTILIB_ARCH_V7M */
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/cpu/arm/armv7m-context-switch.c:1.1
--- /dev/null   Sat Sep 24 08:12:00 2011
+++ rtems/cpukit/score/cpu/arm/armv7m-context-switch.c  Sat Sep 24 07:56:50 2011
</font><font color='#997700'>@@ -0,0 +1,49 @@
</font><font color='#000088'>+/*
+ * Copyright (c) 2011 Sebastian Huber.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <rtems/score/percpu.h>
+
+#ifdef ARM_MULTILIB_ARCH_V7M
+
+#include <rtems/score/armv7m.h>
+
+void __attribute__((naked)) _CPU_Context_switch(
+  Context_Control *executing,
+  Context_Control *heir
+)
+{
+  __asm__ volatile (
+    "movw r2, #:lower16:_Per_CPU_Information\n"
+    "movt r2, #:upper16:_Per_CPU_Information\n"
+    "ldr r3, [r2, %[isrpcpuoff]]\n"
+    "stm r0, {r4-r11, lr}\n"
+    "str sp, [r0, %[spctxoff]]\n"
+    "str r3, [r0, %[isrctxoff]]\n"
+    "ldr r3, [r1, %[isrctxoff]]\n"
+    "ldr sp, [r1, %[spctxoff]]\n"
+    "ldm r1, {r4-r11, lr}\n"
+    "str r3, [r2, %[isrpcpuoff]]\n"
+    "bx lr\n"
+    :
+    : [spctxoff] "J" (offsetof(Context_Control, register_sp)),
+      [isrctxoff] "J" (offsetof(Context_Control, isr_nest_level)),
+      [isrpcpuoff] "J" (offsetof(Per_CPU_Control, isr_nest_level))
+  );
+}
+
+#endif /* ARM_MULTILIB_ARCH_V7M */
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/cpu/arm/armv7m-exception-handler-get.c:1.1
--- /dev/null   Sat Sep 24 08:12:00 2011
+++ rtems/cpukit/score/cpu/arm/armv7m-exception-handler-get.c   Sat Sep 24 07:56:50 2011
</font><font color='#997700'>@@ -0,0 +1,30 @@
</font><font color='#000088'>+/*
+ * Copyright (c) 2011 Sebastian Huber.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <rtems/score/cpu.h>
+
+#ifdef ARM_MULTILIB_ARCH_V7M
+
+#include <rtems/score/armv7m.h>
+
+ARMV7M_Exception_handler _ARMV7M_Get_exception_handler( int index )
+{
+  return _ARMV7M_SCB->vtor [index];
+}
+
+#endif /* ARM_MULTILIB_ARCH_V7M */
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/cpu/arm/armv7m-exception-handler-set.c:1.1
--- /dev/null   Sat Sep 24 08:12:00 2011
+++ rtems/cpukit/score/cpu/arm/armv7m-exception-handler-set.c   Sat Sep 24 07:56:50 2011
</font><font color='#997700'>@@ -0,0 +1,35 @@
</font><font color='#000088'>+/*
+ * Copyright (c) 2011 Sebastian Huber.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <rtems/score/cpu.h>
+
+#ifdef ARM_MULTILIB_ARCH_V7M
+
+#include <rtems/score/armv7m.h>
+
+void _ARMV7M_Set_exception_handler(
+  int index,
+  ARMV7M_Exception_handler handler
+)
+{
+  if ( _ARMV7M_SCB->vtor [index] != handler ) {
+    _ARMV7M_SCB->vtor [index] = handler;
+  }
+}
+
+#endif /* ARM_MULTILIB_ARCH_V7M */
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/cpu/arm/armv7m-exception-priority-get.c:1.1
--- /dev/null   Sat Sep 24 08:12:00 2011
+++ rtems/cpukit/score/cpu/arm/armv7m-exception-priority-get.c  Sat Sep 24 07:56:50 2011
</font><font color='#997700'>@@ -0,0 +1,36 @@
</font><font color='#000088'>+/*
+ * Copyright (c) 2011 Sebastian Huber.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <rtems/score/cpu.h>
+
+#ifdef ARM_MULTILIB_ARCH_V7M
+
+#include <rtems/score/armv7m.h>
+
+int _ARMV7M_Get_exception_priority( int vector )
+{
+  if (vector >= ARMV7M_VECTOR_IRQ(0)) {
+    return _ARMV7M_NVIC->ipr [vector - ARMV7M_VECTOR_IRQ(0)];
+  } else if (vector >= ARMV7M_VECTOR_MEM_MANAGE) {
+    return _ARMV7M_SCB->shpr [vector - 4];
+  } else {
+    return vector - 4;
+  }
+}
+
+#endif /* ARM_MULTILIB_ARCH_V7M */
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/cpu/arm/armv7m-exception-priority-set.c:1.1
--- /dev/null   Sat Sep 24 08:12:00 2011
+++ rtems/cpukit/score/cpu/arm/armv7m-exception-priority-set.c  Sat Sep 24 07:56:50 2011
</font><font color='#997700'>@@ -0,0 +1,34 @@
</font><font color='#000088'>+/*
+ * Copyright (c) 2011 Sebastian Huber.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <rtems/score/cpu.h>
+
+#ifdef ARM_MULTILIB_ARCH_V7M
+
+#include <rtems/score/armv7m.h>
+
+void _ARMV7M_Set_exception_priority( int vector, int priority )
+{
+  if (vector >= ARMV7M_VECTOR_IRQ(0)) {
+    _ARMV7M_NVIC->ipr [vector - ARMV7M_VECTOR_IRQ(0)] = (uint8_t) priority;
+  } else if (vector >= ARMV7M_VECTOR_MEM_MANAGE) {
+    _ARMV7M_SCB->shpr [vector - 4] = (uint8_t) priority;
+  }
+}
+
+#endif /* ARM_MULTILIB_ARCH_V7M */
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/cpu/arm/armv7m-initialize.c:1.1
--- /dev/null   Sat Sep 24 08:12:00 2011
+++ rtems/cpukit/score/cpu/arm/armv7m-initialize.c      Sat Sep 24 07:56:50 2011
</font><font color='#997700'>@@ -0,0 +1,46 @@
</font><font color='#000088'>+/*
+ * Copyright (c) 2011 Sebastian Huber.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <rtems/score/cpu.h>
+
+#ifdef ARM_MULTILIB_ARCH_V7M
+
+#include <rtems/score/armv7m.h>
+
+void _CPU_Initialize( void )
+{
+  /*
+   * The exception handler used to carry out the thead dispatching must have
+   * the lowest priority possible.  No other exception handlers must have this
+   * priority if they use services that may lead to a thread dispatch.  See
+   * also "ARMv7-M Architecture Reference Manual, Issue D" section B1.5.4
+   * "Exception priorities and preemption".
+   */
+  _ARMV7M_Set_exception_priority( ARMV7M_VECTOR_SVC, 0xff );
+  _ARMV7M_Set_exception_priority( ARMV7M_VECTOR_PENDSV, 0xff );
+  _ARMV7M_Set_exception_handler(
+    ARMV7M_VECTOR_SVC,
+    _ARMV7M_Supervisor_call
+  );
+  _ARMV7M_Set_exception_handler(
+    ARMV7M_VECTOR_PENDSV,
+    _ARMV7M_Pendable_service_call
+  );
+}
+
+#endif /* ARM_MULTILIB_ARCH_V7M */
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/cpu/arm/armv7m-isr-dispatch.c:1.1
--- /dev/null   Sat Sep 24 08:12:00 2011
+++ rtems/cpukit/score/cpu/arm/armv7m-isr-dispatch.c    Sat Sep 24 07:56:50 2011
</font><font color='#997700'>@@ -0,0 +1,65 @@
</font><font color='#000088'>+/*
+ * Copyright (c) 2011 Sebastian Huber.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <rtems/score/percpu.h>
+
+#ifdef ARM_MULTILIB_ARCH_V7M
+
+#include <rtems/score/armv7m.h>
+
+static void __attribute__((naked)) _ARMV7M_Thread_dispatch( void )
+{
+  __asm__ volatile (
+    "bl _Thread_Dispatch\n"
+    /* FIXME: SVC, binutils bug */
+    ".short 0xdf00\n"
+    "nop\n"
+  );
+}
+
+void _ARMV7M_Pendable_service_call( void )
+{
+  _ISR_Nest_level = 1;
+  _ARMV7M_SCB->icsr = ARMV7M_SCB_ICSR_PENDSVCLR;
+  ARMV7M_Exception_frame *ef = (ARMV7M_Exception_frame *) _ARMV7M_Get_PSP();
+  --ef;
+  _ARMV7M_Set_PSP((uint32_t) ef);
+
+  /*
+   * According to "ARMv7-M Architecture Reference Manual" section B1.5.6
+   * "Exception entry behavior" the return address is half-word aligned.
+   */
+  ef->register_pc = (void *)
+    ((uintptr_t) _ARMV7M_Thread_dispatch & ~((uintptr_t) 1));
+
+  ef->register_xpsr = 0x01000000U;
+}
+
+void _ARMV7M_Supervisor_call( void )
+{
+  ARMV7M_Exception_frame *ef = (ARMV7M_Exception_frame *) _ARMV7M_Get_PSP();
+  ++ef;
+  _ARMV7M_Set_PSP((uint32_t) ef);
+  _ISR_Nest_level = 0;
+  RTEMS_COMPILER_MEMORY_BARRIER();
+  if ( _Thread_Dispatch_necessary ) {
+    _ARMV7M_Pendable_service_call();
+  }
+}
+
+#endif /* ARM_MULTILIB_ARCH_V7M */
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/cpu/arm/armv7m-isr-enter-leave.c:1.1
--- /dev/null   Sat Sep 24 08:12:00 2011
+++ rtems/cpukit/score/cpu/arm/armv7m-isr-enter-leave.c Sat Sep 24 07:56:50 2011
</font><font color='#997700'>@@ -0,0 +1,44 @@
</font><font color='#000088'>+/*
+ * Copyright (c) 2011 Sebastian Huber.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <rtems/score/thread.h>
+
+#ifdef ARM_MULTILIB_ARCH_V7M
+
+#include <rtems/score/armv7m.h>
+
+void _ARMV7M_Interrupt_service_enter( void )
+{
+  ++_Thread_Dispatch_disable_level;
+  ++_ISR_Nest_level;
+}
+
+void _ARMV7M_Interrupt_service_leave( void )
+{
+  --_ISR_Nest_level;
+  --_Thread_Dispatch_disable_level;
+  if (
+    _ISR_Nest_level == 0
+      && _Thread_Dispatch_disable_level == 0
+      && _Thread_Dispatch_necessary
+  ) {
+    _ARMV7M_SCB->icsr = ARMV7M_SCB_ICSR_PENDSVSET;
+  }
+}
+
+#endif /* ARM_MULTILIB_ARCH_V7M */
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/cpu/arm/armv7m-isr-level-get.c:1.1
--- /dev/null   Sat Sep 24 08:12:00 2011
+++ rtems/cpukit/score/cpu/arm/armv7m-isr-level-get.c   Sat Sep 24 07:56:51 2011
</font><font color='#997700'>@@ -0,0 +1,30 @@
</font><font color='#000088'>+/*
+ * Copyright (c) 2011 Sebastian Huber.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <rtems/score/cpu.h>
+
+#ifdef ARM_MULTILIB_ARCH_V7M
+
+#include <rtems/score/armv7m.h>
+
+uint32_t _CPU_ISR_Get_level( void )
+{
+  return 0;
+}
+
+#endif /* ARM_MULTILIB_ARCH_V7M */
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/cpu/arm/armv7m-isr-level-set.c:1.1
--- /dev/null   Sat Sep 24 08:12:00 2011
+++ rtems/cpukit/score/cpu/arm/armv7m-isr-level-set.c   Sat Sep 24 07:56:51 2011
</font><font color='#997700'>@@ -0,0 +1,30 @@
</font><font color='#000088'>+/*
+ * Copyright (c) 2011 Sebastian Huber.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <rtems/score/cpu.h>
+
+#ifdef ARM_MULTILIB_ARCH_V7M
+
+#include <rtems/score/armv7m.h>
+
+void _CPU_ISR_Set_level( uint32_t level )
+{
+  _ARMV7M_Set_basepri( 0 );
+}
+
+#endif /* ARM_MULTILIB_ARCH_V7M */
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/cpu/arm/armv7m-isr-vector-install.c:1.1
--- /dev/null   Sat Sep 24 08:12:01 2011
+++ rtems/cpukit/score/cpu/arm/armv7m-isr-vector-install.c      Sat Sep 24 07:56:51 2011
</font><font color='#997700'>@@ -0,0 +1,41 @@
</font><font color='#000088'>+/*
+ * Copyright (c) 2011 Sebastian Huber.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <rtems/score/isr.h>
+
+#ifdef ARM_MULTILIB_ARCH_V7M
+
+#include <rtems/score/armv7m.h>
+
+void _CPU_ISR_install_vector(
+  uint32_t vector,
+  proc_ptr new_handler,
+  proc_ptr *old_handler
+)
+{
+  uint32_t level;
+
+  _ISR_Disable( level );
+  if ( old_handler != NULL ) {
+    *old_handler = _ARMV7M_Get_exception_handler( (int) vector );
+  }
+  _ARMV7M_Set_exception_handler( (int) vector, new_handler );
+  _ISR_Enable( level );
+}
+
+#endif /* ARM_MULTILIB_ARCH_V7M */
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/cpu/arm/armv7m-multitasking-start-stop.c:1.1
--- /dev/null   Sat Sep 24 08:12:01 2011
+++ rtems/cpukit/score/cpu/arm/armv7m-multitasking-start-stop.c Sat Sep 24 07:56:51 2011
</font><font color='#997700'>@@ -0,0 +1,71 @@
</font><font color='#000088'>+/*
+ * Copyright (c) 2011 Sebastian Huber.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <rtems/score/cpu.h>
+
+#ifdef ARM_MULTILIB_ARCH_V7M
+
+#include <rtems/score/armv7m.h>
+
+void __attribute__((naked)) _ARMV7M_Start_multitasking(
+  Context_Control *bsp,
+  Context_Control *heir
+)
+{
+  __asm__ volatile (
+    /* Store BSP context */
+    "stm r0, {r4-r11, lr}\n"
+    "str sp, [r0, %[spctxoff]]\n"
+    /* Restore heir context */
+    "ldr r2, [r1, %[spctxoff]]\n"
+    "msr psp, r2\n"
+    "ldm r1, {r4-r11, lr}\n"
+    /* Enable process stack pointer (PSP) */
+    "mrs r2, control\n"
+    "orr r2, #0x2\n"
+    "msr control, r2\n"
+    /* Return to heir */
+    "bx lr\n"
+    :
+    : [spctxoff] "J" (offsetof(Context_Control, register_sp))
+  );
+}
+
+void __attribute__((naked)) _ARMV7M_Stop_multitasking( Context_Control *bsp )
+{
+  __asm__ volatile (
+    /* Disable interrupts */
+    "mov r2, #0x80\n"
+    "msr basepri_max, r2\n"
+    /* Restore BSP context */
+    "ldr r2, [r0, %[spctxoff]]\n"
+    "msr msp, r2\n"
+    "ldm r0, {r4-r11, lr}\n"
+    /* Disable process stack pointer (PSP) */
+    "mrs r2, control\n"
+    "bic r2, #0x2\n"
+    "msr control, r2\n"
+    /* Return to BSP */
+    "bx lr\n"
+    :
+    : [spctxoff] "J" (offsetof(Context_Control, register_sp))
+  );
+  __builtin_unreachable();
+}
+
+#endif /* ARM_MULTILIB_ARCH_V7M */
</font>
<font color='#006600'>diff -u rtems/cpukit/score/cpu/arm/cpu.c:1.32 rtems/cpukit/score/cpu/arm/cpu.c:1.33
--- rtems/cpukit/score/cpu/arm/cpu.c:1.32       Fri Feb 11 03:08:14 2011
+++ rtems/cpukit/score/cpu/arm/cpu.c    Sat Sep 24 07:56:51 2011
</font><font color='#997700'>@@ -15,7 +15,7 @@
</font>  *
  *  Copyright (c) 2007 Ray xu <rayx.cn@gmail.com>
  *
<font color='#880000'>- *  Copyright (c) 2009 embedded brains GmbH
</font><font color='#000088'>+ *  Copyright (c) 2009-2011 embedded brains GmbH
</font>  *
  *  The license and distribution terms for this file may be
  *  found in the file LICENSE in this distribution or at
<font color='#997700'>@@ -36,6 +36,8 @@
</font> #include <rtems/score/thread.h>
 #include <rtems/score/cpu.h>
 
<font color='#000088'>+#ifdef ARM_MULTILIB_ARCH_V4
+
</font> /*
  * This variable can be used to change the running mode of the execution
  * contexts.
<font color='#997700'>@@ -44,14 +46,14 @@
</font> 
 void _CPU_Context_Initialize(
   Context_Control *the_context,
<font color='#880000'>-  uint32_t *stack_base,
-  uint32_t size,
</font><font color='#000088'>+  void *stack_area_begin,
+  size_t stack_area_size,
</font>   uint32_t new_level,
<font color='#880000'>-  void *entry_point,
</font><font color='#000088'>+  void (*entry_point)( void ),
</font>   bool is_fp
 )
 {
<font color='#880000'>-  the_context->register_sp = (uint32_t) stack_base + size ;
</font><font color='#000088'>+  the_context->register_sp = (uint32_t) stack_area_begin + stack_area_size;
</font>   the_context->register_lr = (uint32_t) entry_point;
   the_context->register_cpsr = new_level | arm_cpu_mode;
 }
<font color='#997700'>@@ -114,12 +116,9 @@
</font>   }
 }
 
<font color='#880000'>-void _CPU_Install_interrupt_stack( void )
-{
-  /* This function is empty since the BSP must set up the interrupt stacks */
-}
-
</font> void _CPU_Initialize( void )
 {
   /* Do nothing */
 }
<font color='#000088'>+
+#endif /* ARM_MULTILIB_ARCH_V4 */
</font>
<font color='#006600'>diff -u rtems/cpukit/score/cpu/arm/cpu_asm.S:1.13 rtems/cpukit/score/cpu/arm/cpu_asm.S:1.14
--- rtems/cpukit/score/cpu/arm/cpu_asm.S:1.13   Thu Apr  8 05:13:46 2010
+++ rtems/cpukit/score/cpu/arm/cpu_asm.S        Sat Sep 24 07:56:51 2011
</font><font color='#997700'>@@ -34,6 +34,8 @@
</font> #include <rtems/asm.h>
 #include <rtems/score/cpu_asm.h>
 
<font color='#000088'>+#ifdef ARM_MULTILIB_ARCH_V4
+
</font>         .text
 
 /*
<font color='#997700'>@@ -78,3 +80,5 @@
</font> DEFINE_FUNCTION_ARM(_CPU_Context_restore)
         mov     r1, r0
         b       _restore
<font color='#000088'>+
+#endif /* ARM_MULTILIB_ARCH_V4 */
</font>
<font color='#006600'>diff -u rtems/cpukit/score/cpu/arm/preinstall.am:1.6 rtems/cpukit/score/cpu/arm/preinstall.am:1.7
--- rtems/cpukit/score/cpu/arm/preinstall.am:1.6        Mon Jan  8 02:43:28 2007
+++ rtems/cpukit/score/cpu/arm/preinstall.am    Sat Sep 24 07:56:51 2011
</font><font color='#997700'>@@ -39,6 +39,10 @@
</font>   $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/arm.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/arm.h
 
<font color='#000088'>+$(PROJECT_INCLUDE)/rtems/score/armv7m.h: rtems/score/armv7m.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
+       $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/armv7m.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/armv7m.h
+
</font> $(PROJECT_INCLUDE)/rtems/score/types.h: rtems/score/types.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/types.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/types.h

<font color='#006600'>diff -u rtems/cpukit/score/cpu/arm/rtems/score/arm.h:1.20 rtems/cpukit/score/cpu/arm/rtems/score/arm.h:1.21
--- rtems/cpukit/score/cpu/arm/rtems/score/arm.h:1.20   Fri Sep 16 04:47:09 2011
+++ rtems/cpukit/score/cpu/arm/rtems/score/arm.h        Sat Sep 24 07:56:51 2011
</font><font color='#997700'>@@ -44,40 +44,52 @@
</font>  */
 #if defined(__ARM_ARCH_4__)
 #  define CPU_MODEL_NAME  "ARMv4"
<font color='#000088'>+#  define ARM_MULTILIB_ARCH_V4
</font> 
 #elif defined(__ARM_ARCH_4T__)
 #  define CPU_MODEL_NAME  "ARMv4T"
<font color='#000088'>+#  define ARM_MULTILIB_ARCH_V4
</font> 
 #elif defined(__ARM_ARCH_5__)
 #  define CPU_MODEL_NAME  "ARMv5"
<font color='#000088'>+#  define ARM_MULTILIB_ARCH_V4
</font> 
 #elif defined(__ARM_ARCH_5T__)
 #  define CPU_MODEL_NAME  "ARMv5T"
<font color='#000088'>+#  define ARM_MULTILIB_ARCH_V4
</font> 
 #elif defined(__ARM_ARCH_5E__)
 #  define CPU_MODEL_NAME  "ARMv5E"
<font color='#000088'>+#  define ARM_MULTILIB_ARCH_V4
</font> 
 #elif defined(__ARM_ARCH_5TE__)
 #  define CPU_MODEL_NAME  "ARMv5TE"
<font color='#000088'>+#  define ARM_MULTILIB_ARCH_V4
</font> 
 #elif defined(__ARM_ARCH_5TEJ__)
 #  define CPU_MODEL_NAME  "ARMv5TEJ"
<font color='#000088'>+#  define ARM_MULTILIB_ARCH_V4
</font> 
 #elif defined(__ARM_ARCH_6J__)
 #  define CPU_MODEL_NAME  "ARMv6J"
 
 #elif defined(__ARM_ARCH_6M__)
 #  define CPU_MODEL_NAME  "ARMv6M"
<font color='#000088'>+#  define ARM_MULTILIB_ARCH_V7M
</font> 
 #elif defined(__ARM_ARCH_7__)
 #  define CPU_MODEL_NAME  "ARMv7"
 
<font color='#880000'>-#elif defined(__ARM_ARCH_7M__)
-#  define CPU_MODEL_NAME  "ARMv7M"
-
</font> #elif defined(__ARM_ARCH_7A__)
 #  define CPU_MODEL_NAME  "ARMv7A"
 
<font color='#000088'>+#elif defined(__ARM_ARCH_7R__)
+#  define CPU_MODEL_NAME  "ARMv7R"
+
+#elif defined(__ARM_ARCH_7M__)
+#  define CPU_MODEL_NAME  "ARMv7M"
+#  define ARM_MULTILIB_ARCH_V7M
+
</font> #else
 #  error "Unsupported CPU Model"
 

<font color='#006600'>diff -u /dev/null rtems/cpukit/score/cpu/arm/rtems/score/armv7m.h:1.1
--- /dev/null   Sat Sep 24 08:12:01 2011
+++ rtems/cpukit/score/cpu/arm/rtems/score/armv7m.h     Sat Sep 24 07:56:51 2011
</font><font color='#997700'>@@ -0,0 +1,236 @@
</font><font color='#000088'>+/*
+ * Copyright (c) 2011 Sebastian Huber.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#ifndef RTEMS_SCORE_ARMV7M_H
+#define RTEMS_SCORE_ARMV7M_H
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+typedef struct {
+  uint32_t reserved_0;
+  uint32_t ictr;
+  uint32_t actlr;
+  uint32_t reserved_1;
+} ARMV7M_Interrupt_type;
+
+typedef void (*ARMV7M_Exception_handler)(void);
+
+typedef struct {
+  uint32_t register_r0;
+  uint32_t register_r1;
+  uint32_t register_r2;
+  uint32_t register_r3;
+  uint32_t register_r12;
+  void *register_lr;
+  void *register_pc;
+  uint32_t register_xpsr;
+} ARMV7M_Exception_frame;
+
+typedef struct {
+  uint32_t cpuid;
+
+#define ARMV7M_SCB_ICSR_NMIPENDSET (1U << 31)
+#define ARMV7M_SCB_ICSR_PENDSVSET (1U << 28)
+#define ARMV7M_SCB_ICSR_PENDSVCLR (1U << 27)
+#define ARMV7M_SCB_ICSR_PENDSTSET (1U << 26)
+#define ARMV7M_SCB_ICSR_PENDSTCLR (1U << 25)
+#define ARMV7M_SCB_ICSR_ISRPREEMPT (1U << 23)
+#define ARMV7M_SCB_ICSR_ISRPENDING (1U << 22)
+#define ARMV7M_SCB_ICSR_VECTPENDING(reg) (((reg) >> 12) & 0x1ffU)
+#define ARMV7M_SCB_ICSR_RETTOBASE (1U << 11)
+#define ARMV7M_SCB_ICSR_VECTACTIVE(reg) ((reg) & 0x1ffU)
+  uint32_t icsr;
+
+  ARMV7M_Exception_handler *vtor;
+  uint32_t aircr;
+  uint32_t scr;
+  uint32_t ccr;
+  uint8_t shpr [12];
+  uint32_t shcsr;
+  uint32_t cfsr;
+  uint32_t hfsr;
+  uint32_t dfsr;
+  uint32_t mmfar;
+  uint32_t bfar;
+  uint32_t afsr;
+} ARMV7M_SCB;
+
+typedef struct {
+#define ARMV7M_SYSTICK_CSR_COUNTFLAG (1U << 16)
+#define ARMV7M_SYSTICK_CSR_CLKSOURCE (1U << 2)
+#define ARMV7M_SYSTICK_CSR_TICKINT (1U << 1)
+#define ARMV7M_SYSTICK_CSR_ENABLE (1U << 0)
+  uint32_t csr;
+
+  uint32_t rvr;
+  uint32_t cvr;
+
+#define ARMV7M_SYSTICK_CALIB_NOREF (1U << 31)
+#define ARMV7M_SYSTICK_CALIB_SKEW (1U << 30)
+#define ARMV7M_SYSTICK_CALIB_TENMS(reg) ((reg) & 0xffffffU)
+  uint32_t calib;
+} ARMV7M_Systick;
+
+typedef struct {
+  uint32_t iser [8];
+  uint32_t reserved_0 [24];
+  uint32_t icer [8];
+  uint32_t reserved_1 [24];
+  uint32_t ispr [8];
+  uint32_t reserved_2 [24];
+  uint32_t icpr [8];
+  uint32_t reserved_3 [24];
+  uint32_t iabr [8];
+  uint32_t reserved_4 [56];
+  uint8_t  ipr [240];
+  uint32_t reserved_5 [644];
+  uint32_t stir;
+} ARMV7M_NVIC;
+
+#define ARMV7M_SCS_BASE 0xe000e000
+#define ARMV7M_SYSTICK_BASE (ARMV7M_SCS_BASE + 0x10)
+#define ARMV7M_NVIC_BASE (ARMV7M_SCS_BASE + 0x100)
+#define ARMV7M_SCB_BASE (ARMV7M_SCS_BASE + 0xd00)
+
+#define _ARMV7M_Interrupt_type \
+  ((volatile ARMV7M_Interrupt_type *) ARMV7M_SCS_BASE)
+#define _ARMV7M_SCB \
+  ((volatile ARMV7M_SCB *) ARMV7M_SCB_BASE)
+#define _ARMV7M_Systick \
+  ((volatile ARMV7M_Systick *) ARMV7M_SYSTICK_BASE)
+#define _ARMV7M_NVIC \
+  ((volatile ARMV7M_NVIC *) ARMV7M_NVIC_BASE)
+
+#define ARMV7M_VECTOR_MSP 0
+#define ARMV7M_VECTOR_RESET 1
+#define ARMV7M_VECTOR_NMI 2
+#define ARMV7M_VECTOR_HARD_FAULT 3
+#define ARMV7M_VECTOR_MEM_MANAGE 4
+#define ARMV7M_VECTOR_BUS_FAULT 5
+#define ARMV7M_VECTOR_USAGE_FAULT 6
+#define ARMV7M_VECTOR_SVC 11
+#define ARMV7M_VECTOR_DEBUG_MONITOR 12
+#define ARMV7M_VECTOR_PENDSV 14
+#define ARMV7M_VECTOR_SYSTICK 15
+#define ARMV7M_VECTOR_IRQ(n) (16 + (n))
+
+static inline uint32_t _ARMV7M_Get_basepri(void)
+{
+  uint32_t val;
+  __asm__ volatile ("mrs %[val], basepri\n" : [val] "=&r" (val));
+  return val;
+}
+
+static inline void _ARMV7M_Set_basepri(uint32_t val)
+{
+  __asm__ volatile ("msr basepri, %[val]\n" : : [val] "r" (val));
+}
+
+static inline uint32_t _ARMV7M_Get_primask(void)
+{
+  uint32_t val;
+  __asm__ volatile ("mrs %[val], primask\n" : [val] "=&r" (val));
+  return val;
+}
+
+static inline void _ARMV7M_Set_primask(uint32_t val)
+{
+  __asm__ volatile ("msr primask, %[val]\n" : : [val] "r" (val));
+}
+
+static inline uint32_t _ARMV7M_Get_faultmask(void)
+{
+  uint32_t val;
+  __asm__ volatile ("mrs %[val], faultmask\n" : [val] "=&r" (val));
+  return val;
+}
+
+static inline void _ARMV7M_Set_faultmask(uint32_t val)
+{
+  __asm__ volatile ("msr faultmask, %[val]\n" : : [val] "r" (val));
+}
+
+static inline uint32_t _ARMV7M_Get_control(void)
+{
+  uint32_t val;
+  __asm__ volatile ("mrs %[val], control\n" : [val] "=&r" (val));
+  return val;
+}
+
+static inline void _ARMV7M_Set_control(uint32_t val)
+{
+  __asm__ volatile ("msr control, %[val]\n" : : [val] "r" (val));
+}
+
+static inline uint32_t _ARMV7M_Get_MSP(void)
+{
+  uint32_t val;
+  __asm__ volatile ("mrs %[val], msp\n" : [val] "=&r" (val));
+  return val;
+}
+
+static inline void _ARMV7M_Set_MSP(uint32_t val)
+{
+  __asm__ volatile ("msr msp, %[val]\n" : : [val] "r" (val));
+}
+
+static inline uint32_t _ARMV7M_Get_PSP(void)
+{
+  uint32_t val;
+  __asm__ volatile ("mrs %[val], psp\n" : [val] "=&r" (val));
+  return val;
+}
+
+static inline void _ARMV7M_Set_PSP(uint32_t val)
+{
+  __asm__ volatile ("msr psp, %[val]\n" : : [val] "r" (val));
+}
+
+static inline uint32_t _ARMV7M_Get_XPSR(void)
+{
+  uint32_t val;
+  __asm__ volatile ("mrs %[val], xpsr\n" : [val] "=&r" (val));
+  return val;
+}
+
+int _ARMV7M_Get_exception_priority( int vector );
+
+void _ARMV7M_Set_exception_priority( int vector, int priority );
+
+ARMV7M_Exception_handler _ARMV7M_Get_exception_handler( int index );
+
+void _ARMV7M_Set_exception_handler(
+  int index,
+  ARMV7M_Exception_handler handler
+);
+
+void _ARMV7M_Interrupt_service_enter( void );
+
+void _ARMV7M_Interrupt_service_leave( void );
+
+void _ARMV7M_Pendable_service_call( void );
+
+void _ARMV7M_Supervisor_call( void );
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* RTEMS_SCORE_ARMV7M_H */
</font>
<font color='#006600'>diff -u rtems/cpukit/score/cpu/arm/rtems/score/cpu.h:1.48 rtems/cpukit/score/cpu/arm/rtems/score/cpu.h:1.49
--- rtems/cpukit/score/cpu/arm/rtems/score/cpu.h:1.48   Fri Apr 15 03:06:16 2011
+++ rtems/cpukit/score/cpu/arm/rtems/score/cpu.h        Sat Sep 24 07:56:51 2011
</font><font color='#997700'>@@ -12,7 +12,7 @@
</font>  *  This include file contains information pertaining to the ARM
  *  processor.
  *
<font color='#880000'>- *  Copyright (c) 2009-2010 embedded brains GmbH.
</font><font color='#000088'>+ *  Copyright (c) 2009-2011 embedded brains GmbH.
</font>  *
  *  Copyright (c) 2007 Ray Xu <Rayx.cn@gmail.com>
  *
<font color='#997700'>@@ -36,6 +36,8 @@
</font> #include <rtems/score/types.h>
 #include <rtems/score/arm.h>
 
<font color='#000088'>+#if defined(ARM_MULTILIB_ARCH_V4)
+
</font> /**
  * @defgroup ScoreCPUARM ARM Specific Support
  *
<font color='#997700'>@@ -93,6 +95,8 @@
</font> 
 /** @} */
 
<font color='#000088'>+#endif /* defined(ARM_MULTILIB_ARCH_V4) */
+
</font> /**
  * @addtogroup ScoreCPU
  *
<font color='#997700'>@@ -120,7 +124,7 @@
</font> 
 #define CPU_HAS_SOFTWARE_INTERRUPT_STACK FALSE
 
<font color='#880000'>-#define CPU_HAS_HARDWARE_INTERRUPT_STACK TRUE
</font><font color='#000088'>+#define CPU_HAS_HARDWARE_INTERRUPT_STACK FALSE
</font> 
 #define CPU_ALLOCATE_INTERRUPT_STACK FALSE
 
<font color='#997700'>@@ -216,6 +220,7 @@
</font>  */
 
 typedef struct {
<font color='#000088'>+#if defined(ARM_MULTILIB_ARCH_V4)
</font>   uint32_t register_cpsr;
   uint32_t register_r4;
   uint32_t register_r5;
<font color='#997700'>@@ -228,6 +233,19 @@
</font>   uint32_t register_sp;
   uint32_t register_lr;
   uint32_t register_pc;
<font color='#000088'>+#elif defined(ARM_MULTILIB_ARCH_V7M)
+  uint32_t register_r4;
+  uint32_t register_r5;
+  uint32_t register_r6;
+  uint32_t register_r7;
+  uint32_t register_r8;
+  uint32_t register_r9;
+  uint32_t register_r10;
+  uint32_t register_r11;
+  void *register_lr;
+  void *register_sp;
+  uint32_t isr_nest_level;
+#endif
</font> } Context_Control;
 
 typedef struct {
<font color='#997700'>@@ -240,6 +258,7 @@
</font> 
 static inline uint32_t arm_interrupt_disable( void )
 {
<font color='#000088'>+#if defined(ARM_MULTILIB_ARCH_V4)
</font>   uint32_t arm_switch_reg;
   uint32_t level;
 
<font color='#997700'>@@ -253,10 +272,24 @@
</font>   );
 
   return level;
<font color='#000088'>+#elif defined(ARM_MULTILIB_ARCH_V7M)
+  uint32_t level;
+  uint32_t basepri = 0x80;
+
+  __asm__ volatile (
+    "mrs %[level], basepri\n"
+    "msr basepri_max, %[basepri]\n"
+    : [level] "=&r" (level)
+    : [basepri] "r" (basepri)
+  );
+
+  return level;
+#endif
</font> }
 
 static inline void arm_interrupt_enable( uint32_t level )
 {
<font color='#000088'>+#if defined(ARM_MULTILIB_ARCH_V4)
</font>   ARM_SWITCH_REGISTERS;
 
   __asm__ volatile (
<font color='#997700'>@@ -266,10 +299,18 @@
</font>     : ARM_SWITCH_OUTPUT
     : [level] "r" (level)
   );
<font color='#000088'>+#elif defined(ARM_MULTILIB_ARCH_V7M)
+  __asm__ volatile (
+    "msr basepri, %[level]\n"
+    :
+    : [level] "r" (level)
+  );
+#endif
</font> }
 
 static inline void arm_interrupt_flash( uint32_t level )
 {
<font color='#000088'>+#if defined(ARM_MULTILIB_ARCH_V4)
</font>   uint32_t arm_switch_reg;
 
   __asm__ volatile (
<font color='#997700'>@@ -281,6 +322,17 @@
</font>     : [arm_switch_reg] "=&r" (arm_switch_reg)
     : [level] "r" (level)
   );
<font color='#000088'>+#elif defined(ARM_MULTILIB_ARCH_V7M)
+  uint32_t basepri;
+
+  __asm__ volatile (
+    "mrs %[basepri], basepri\n"
+    "msr basepri, %[level]\n"
+    "msr basepri, %[basepri]\n"
+    : [basepri] "=&r" (basepri)
+    : [level] "r" (level)
+  );
+#endif
</font> }
 
 #define _CPU_ISR_Disable( _isr_cookie ) \
<font color='#997700'>@@ -300,10 +352,10 @@
</font> 
 void _CPU_Context_Initialize(
   Context_Control *the_context,
<font color='#880000'>-  uint32_t *stack_base,
-  uint32_t size,
</font><font color='#000088'>+  void *stack_area_begin,
+  size_t stack_area_size,
</font>   uint32_t new_level,
<font color='#880000'>-  void *entry_point,
</font><font color='#000088'>+  void (*entry_point)( void ),
</font>   bool is_fp
 );
 
<font color='#997700'>@@ -343,12 +395,18 @@
</font>   proc_ptr *old_handler
 );
 
<font color='#880000'>-void _CPU_Install_interrupt_stack( void );
-
</font> void _CPU_Context_switch( Context_Control *run, Context_Control *heir );
 
 void _CPU_Context_restore( Context_Control *new_context )
<font color='#880000'>-       RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
</font><font color='#000088'>+  RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
+
+#if defined(ARM_MULTILIB_ARCH_V7M)
+  void _ARMV7M_Start_multitasking( Context_Control *bsp, Context_Control *heir );
+  void _ARMV7M_Stop_multitasking( Context_Control *bsp )
+    RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
+  #define _CPU_Start_multitasking _ARMV7M_Start_multitasking
+  #define _CPU_Stop_multitasking _ARMV7M_Stop_multitasking
+#endif
</font> 
 void _CPU_Context_save_fp( Context_Control_fp **fp_context_ptr );
 
<font color='#997700'>@@ -356,7 +414,14 @@
</font> 
 static inline uint32_t CPU_swap_u32( uint32_t value )
 {
<font color='#880000'>-#if defined(__thumb__)
</font><font color='#000088'>+#if defined(__thumb2__)
+  __asm__ volatile (
+    "rev %0, %0"
+    : "=r" (value)
+    : "0" (value)
+  );
+  return value;
+#elif defined(__thumb__)
</font>   uint32_t byte1, byte2, byte3, byte4, swapped;
 
   byte4 = (value >> 24) & 0xff;
<font color='#997700'>@@ -380,11 +445,22 @@
</font> 
 static inline uint16_t CPU_swap_u16( uint16_t value )
 {
<font color='#000088'>+#if defined(__thumb2__)
+  __asm__ volatile (
+    "rev16 %0, %0"
+    : "=r" (value)
+    : "0" (value)
+  );
+  return value;
+#else
</font>   return (uint16_t) (((value & 0xffU) << 8) | ((value >> 8) & 0xffU));
<font color='#000088'>+#endif
</font> }
 
 /** @} */
 
<font color='#000088'>+#if defined(ARM_MULTILIB_ARCH_V4)
+
</font> /**
  * @addtogroup ScoreCPUARM
  *
<font color='#997700'>@@ -487,6 +563,12 @@
</font> 
 typedef CPU_Exception_frame CPU_Interrupt_frame;
 
<font color='#000088'>+#elif defined(ARM_MULTILIB_ARCH_V7M)
+
+typedef void CPU_Interrupt_frame;
+
+#endif /* defined(ARM_MULTILIB_ARCH_V7M) */
+
</font> #ifdef __cplusplus
 }
 #endif
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>