bsp/mpc55xx: Add mpc55xx_wait_for_interrupt()

Use mpc55xx_wait_for_interrupt().
This commit is contained in:
Sebastian Huber
2012-11-15 16:57:02 +01:00
parent 2d561b9cdf
commit 67338ed870
3 changed files with 25 additions and 11 deletions

View File

@@ -61,16 +61,14 @@ void BSP_panic( char *s)
}
}
void _BSP_Fatal_error( unsigned n)
void _BSP_Fatal_error(unsigned n)
{
rtems_interrupt_level level;
rtems_interrupt_disable( level);
printk( "%s PANIC ERROR %u\n", _RTEMS_version, n);
while (1) {
/* Do nothing */
while (true) {
mpc55xx_wait_for_interrupt();
}
}

View File

@@ -22,14 +22,12 @@
#include <bsp.h>
#include <mpc55xx/regs.h>
#include <mpc55xx/mpc55xx.h>
void *bsp_idle_thread(uintptr_t arg)
{
while (true) {
#ifdef MPC55XX_HAS_WAIT_INSTRUCTION
__asm__ volatile ("wait");
#endif
mpc55xx_wait_for_interrupt();
}
return NULL;

View File

@@ -7,7 +7,7 @@
*/
/*
* Copyright (c) 2008-2011 embedded brains GmbH. All rights reserved.
* Copyright (c) 2008-2012 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Obere Lagerstr. 30
@@ -43,7 +43,12 @@
#define LIBCPU_POWERPC_MPC55XX_H
#include <stddef.h>
#include <stdint.h>
#include <mpc55xx/regs.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
int mpc55xx_flash_copy(void *dest, const void *src, size_t nbytes);
int mpc55xx_flash_copy_op(void *rdest, const void *src, size_t nbytes,
@@ -124,4 +129,17 @@ static inline uint32_t mpc55xx_count_leading_zeros( uint32_t value)
return count;
}
static inline mpc55xx_wait_for_interrupt(void)
{
#ifdef MPC55XX_HAS_WAIT_INSTRUCTION
__asm__ volatile ("wait");
#else
__asm__ volatile ("");
#endif
}
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* LIBCPU_POWERPC_MPC55XX_H */