forked from Imagelibrary/rtems
bsp/mpc55xx: Add mpc55xx_wait_for_interrupt()
Use mpc55xx_wait_for_interrupt().
This commit is contained in:
@@ -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_level level;
|
||||||
|
|
||||||
rtems_interrupt_disable( level);
|
rtems_interrupt_disable( level);
|
||||||
|
|
||||||
printk( "%s PANIC ERROR %u\n", _RTEMS_version, n);
|
while (true) {
|
||||||
|
mpc55xx_wait_for_interrupt();
|
||||||
while (1) {
|
|
||||||
/* Do nothing */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,14 +22,12 @@
|
|||||||
|
|
||||||
#include <bsp.h>
|
#include <bsp.h>
|
||||||
|
|
||||||
#include <mpc55xx/regs.h>
|
#include <mpc55xx/mpc55xx.h>
|
||||||
|
|
||||||
void *bsp_idle_thread(uintptr_t arg)
|
void *bsp_idle_thread(uintptr_t arg)
|
||||||
{
|
{
|
||||||
while (true) {
|
while (true) {
|
||||||
#ifdef MPC55XX_HAS_WAIT_INSTRUCTION
|
mpc55xx_wait_for_interrupt();
|
||||||
__asm__ volatile ("wait");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -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
|
* embedded brains GmbH
|
||||||
* Obere Lagerstr. 30
|
* Obere Lagerstr. 30
|
||||||
@@ -43,7 +43,12 @@
|
|||||||
#define LIBCPU_POWERPC_MPC55XX_H
|
#define LIBCPU_POWERPC_MPC55XX_H
|
||||||
|
|
||||||
#include <stddef.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(void *dest, const void *src, size_t nbytes);
|
||||||
int mpc55xx_flash_copy_op(void *rdest, 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;
|
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 */
|
#endif /* LIBCPU_POWERPC_MPC55XX_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user