change log for rtems (2011-09-02)
rtems-vc at rtems.org
rtems-vc at rtems.org
Fri Sep 2 08:10:12 UTC 2011
*sh*:
2011-09-02 Sebastian Huber <sebastian.huber at embedded-brains.de>
* rtems/score/nios2-utility.h: Avoid redefines with Altera HAL.
Declare _Nios2_ISR_Set_level().
* nios2-context-initialize.c: Use _Nios2_ISR_Set_level().
* nios2-isr-set-level.c: Define _Nios2_ISR_Set_level().
M 1.37 cpukit/score/cpu/nios2/ChangeLog
M 1.2 cpukit/score/cpu/nios2/nios2-context-initialize.c
M 1.2 cpukit/score/cpu/nios2/nios2-isr-set-level.c
M 1.2 cpukit/score/cpu/nios2/rtems/score/nios2-utility.h
diff -u rtems/cpukit/score/cpu/nios2/ChangeLog:1.36 rtems/cpukit/score/cpu/nios2/ChangeLog:1.37
--- rtems/cpukit/score/cpu/nios2/ChangeLog:1.36 Thu Sep 1 10:52:12 2011
+++ rtems/cpukit/score/cpu/nios2/ChangeLog Fri Sep 2 02:52:30 2011
@@ -1,3 +1,10 @@
+2011-09-02 Sebastian Huber <sebastian.huber at embedded-brains.de>
+
+ * rtems/score/nios2-utility.h: Avoid redefines with Altera HAL.
+ Declare _Nios2_ISR_Set_level().
+ * nios2-context-initialize.c: Use _Nios2_ISR_Set_level().
+ * nios2-isr-set-level.c: Define _Nios2_ISR_Set_level().
+
2011-09-01 Sebastian Huber <sebastian.huber at embedded-brains.de>
* cpu.c, cpu_asm.S: Removed files.
diff -u rtems/cpukit/score/cpu/nios2/nios2-context-initialize.c:1.1 rtems/cpukit/score/cpu/nios2/nios2-context-initialize.c:1.2
--- rtems/cpukit/score/cpu/nios2/nios2-context-initialize.c:1.1 Thu Sep 1 10:52:12 2011
+++ rtems/cpukit/score/cpu/nios2/nios2-context-initialize.c Fri Sep 2 02:52:30 2011
@@ -17,9 +17,11 @@
#include "config.h"
#endif
-#include <rtems/score/cpu.h>
#include <string.h>
+#include <rtems/score/cpu.h>
+#include <rtems/score/nios2-utility.h>
+
void _CPU_Context_Initialize(
Context_Control *context,
void *stack_area_begin,
@@ -34,8 +36,7 @@
memset(context, 0, sizeof(*context));
context->fp = stack;
+ context->status = _Nios2_ISR_Set_level( new_level, NIOS2_STATUS_PIE );
context->sp = stack;
context->ra = (uint32_t) entry_point;
- /* @todo Add EIC support. */
- context->status = new_level ? 0 : 1;
}
diff -u rtems/cpukit/score/cpu/nios2/nios2-isr-set-level.c:1.1 rtems/cpukit/score/cpu/nios2/nios2-isr-set-level.c:1.2
--- rtems/cpukit/score/cpu/nios2/nios2-isr-set-level.c:1.1 Thu Sep 1 10:52:12 2011
+++ rtems/cpukit/score/cpu/nios2/nios2-isr-set-level.c Fri Sep 2 02:52:30 2011
@@ -21,10 +21,8 @@
#include <rtems/score/interr.h>
#include <rtems/score/nios2-utility.h>
-void _CPU_ISR_Set_level( uint32_t new_level )
+uint32_t _Nios2_ISR_Set_level( uint32_t new_level, uint32_t status )
{
- uint32_t status = _Nios2_Get_ctlreg_status();
-
switch ( _Nios2_Get_ISR_status_mask() ) {
case NIOS2_ISR_STATUS_MASK_IIC:
if ( new_level == 0 ) {
@@ -50,5 +48,14 @@
break;
}
+ return status;
+}
+
+void _CPU_ISR_Set_level( uint32_t new_level )
+{
+ uint32_t status = _Nios2_Get_ctlreg_status();
+
+ status = _Nios2_ISR_Set_level( new_level, status );
+
_Nios2_Set_ctlreg_status( status );
}
diff -u rtems/cpukit/score/cpu/nios2/rtems/score/nios2-utility.h:1.1 rtems/cpukit/score/cpu/nios2/rtems/score/nios2-utility.h:1.2
--- rtems/cpukit/score/cpu/nios2/rtems/score/nios2-utility.h:1.1 Thu Sep 1 10:52:12 2011
+++ rtems/cpukit/score/cpu/nios2/rtems/score/nios2-utility.h Fri Sep 2 02:52:30 2011
@@ -103,16 +103,36 @@
#define NIOS2_MPUBASE_BASE_OFFSET 5
#define NIOS2_MPUBASE_BASE_MASK (0x1ffffff << NIOS2_MPUBASE_BASE_OFFSET)
#define NIOS2_MPUBASE_INDEX_OFFSET 1
-#define NIOS2_MPUBASE_INDEX_MASK (0x1f << NIOS2_MPUBASE_INDEX_OFFSET)
+
+/* Avoid redefines with Altera HAL */
+#ifndef NIOS2_MPUBASE_INDEX_MASK
+ #define NIOS2_MPUBASE_INDEX_MASK (0x1f << NIOS2_MPUBASE_INDEX_OFFSET)
+#endif
+
#define NIOS2_MPUBASE_D (1 << 0)
#define NIOS2_MPUACC_MASK_OFFSET 6
-#define NIOS2_MPUACC_MASK_MASK (0x1ffffff << NIOS2_MPUACC_MASK_OFFSET)
+
+/* Avoid redefines with Altera HAL */
+#ifndef NIOS2_MPUACC_MASK_MASK
+ #define NIOS2_MPUACC_MASK_MASK (0x1ffffff << NIOS2_MPUACC_MASK_OFFSET)
+#endif
+
#define NIOS2_MPUACC_LIMIT_OFFSET 6
-#define NIOS2_MPUACC_LIMIT_MASK (0x3ffffff << NIOS2_MPUACC_LIMIT_OFFSET)
+
+/* Avoid redefines with Altera HAL */
+#ifndef NIOS2_MPUACC_LIMIT_MASK
+ #define NIOS2_MPUACC_LIMIT_MASK (0x3ffffff << NIOS2_MPUACC_LIMIT_OFFSET)
+#endif
+
#define NIOS2_MPUACC_C (1 << 5)
#define NIOS2_MPUACC_PERM_OFFSET 2
-#define NIOS2_MPUACC_PERM_MASK (0x7 << NIOS2_MPUACC_PERM_OFFSET)
+
+/* Avoid redefines with Altera HAL */
+#ifndef NIOS2_MPUACC_PERM_MASK
+ #define NIOS2_MPUACC_PERM_MASK (0x7 << NIOS2_MPUACC_PERM_OFFSET)
+#endif
+
#define NIOS2_MPUACC_RD (1 << 1)
#define NIOS2_MPUACC_WR (1 << 0)
@@ -286,11 +306,11 @@
static inline bool _Nios2_Has_internal_interrupt_controller( void )
{
- uint32_t isr_status_mask = _Nios2_Get_ISR_status_mask();
-
- return isr_status_mask == NIOS2_ISR_STATUS_MASK_IIC;
+ return _Nios2_Get_ISR_status_mask() == NIOS2_ISR_STATUS_MASK_IIC;
}
+uint32_t _Nios2_ISR_Set_level( uint32_t new_level, uint32_t status );
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
--
Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20110902/2081600f/attachment.html>
More information about the vc
mailing list