[rtems commit] bsp/leon3: Add and use fatal codes
Chris Johns
chrisj at rtems.org
Sat Feb 22 21:49:25 UTC 2014
On 19/02/2014 7:52 pm, Sebastian Huber wrote:
> Module: rtems
> Branch: master
> Commit: 46d7fa5cd336a7cf892e7ec8cd60c27882cb1225
> Changeset: http://git.rtems.org/rtems/commit/?id=46d7fa5cd336a7cf892e7ec8cd60c27882cb1225
>
> Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
> Date: Mon Feb 17 11:54:35 2014 +0100
>
> bsp/leon3: Add and use fatal codes
>
> ---
>
> c/src/lib/libbsp/shared/include/fatal.h | 2 ++
> c/src/lib/libbsp/sparc/leon3/amba/amba.c | 3 ++-
> c/src/lib/libbsp/sparc/leon3/console/console.c | 5 +++--
> 3 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/c/src/lib/libbsp/shared/include/fatal.h b/c/src/lib/libbsp/shared/include/fatal.h
> index 16d20b8..0bf0608 100644
> --- a/c/src/lib/libbsp/shared/include/fatal.h
> +++ b/c/src/lib/libbsp/shared/include/fatal.h
> @@ -48,6 +48,8 @@ typedef enum {
>
> /* LEON3 fatal codes */
> LEON3_FATAL_CPU_COUNTER_INIT = BSP_FATAL_CODE_BLOCK(2),
> + LEON3_FATAL_NO_IRQMP_CONTROLLER,
> + LEON3_FATAL_CONSOLE_REGISTER_DEV,
>
> /* LPC24XX fatal codes */
> LPC24XX_FATAL_PL111_SET_UP = BSP_FATAL_CODE_BLOCK(3),
> diff --git a/c/src/lib/libbsp/sparc/leon3/amba/amba.c b/c/src/lib/libbsp/sparc/leon3/amba/amba.c
> index eb7b0f2..a4745d4 100644
> --- a/c/src/lib/libbsp/sparc/leon3/amba/amba.c
> +++ b/c/src/lib/libbsp/sparc/leon3/amba/amba.c
> @@ -12,6 +12,7 @@
> */
>
> #include <bsp.h>
> +#include <bsp/fatal.h>
> #include <ambapp.h>
>
> /* AMBA Plug&Play information description.
> @@ -58,7 +59,7 @@ void amba_initialize(void)
> *
> * What else can we do but stop ...
> */
> - asm volatile( "mov 1, %g1; ta 0x0" );
> + bsp_fatal(LEON3_FATAL_NO_IRQMP_CONTROLLER);
> }
>
> LEON3_IrqCtrl_Regs = (volatile struct irqmp_regs *)DEV_TO_APB(adev)->start;
> diff --git a/c/src/lib/libbsp/sparc/leon3/console/console.c b/c/src/lib/libbsp/sparc/leon3/console/console.c
> index 7e72633..368c274 100644
> --- a/c/src/lib/libbsp/sparc/leon3/console/console.c
> +++ b/c/src/lib/libbsp/sparc/leon3/console/console.c
> @@ -27,6 +27,7 @@
> */
>
> #include <bsp.h>
> +#include <bsp/fatal.h>
> #include <rtems/libio.h>
> #include <stdlib.h>
> #include <assert.h>
> @@ -297,14 +298,14 @@ rtems_device_driver console_initialize(
> if (syscon_uart_index < uarts) {
> status = rtems_io_register_name("/dev/console", major, 0);
> if (status != RTEMS_SUCCESSFUL)
> - rtems_fatal_error_occurred(status);
> + bsp_fatal(LEON3_FATAL_CONSOLE_REGISTER_DEV);
> }
> strcpy(console_name,"/dev/console_a");
> for (i = 0; i < uarts; i++) {
> if (i == syscon_uart_index)
> continue; /* skip UART that is registered as /dev/console */
> console_name[13] = 'a' + i;
> - status = rtems_io_register_name( console_name, major, i+1);
> + rtems_io_register_name( console_name, major, i+1);
Why is the result not checked ?
> }
>
> return RTEMS_SUCCESSFUL;
>
> _______________________________________________
> rtems-vc mailing list
> rtems-vc at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-vc
>
More information about the devel
mailing list