[PATCH v1 1/3] cpukit: Add signal mapping support

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Apr 16 07:19:46 UTC 2021


Hello Kinsey,

why don't you use a fatal error extension for this? You can save all the 
processor state to a structure and use it to jump to previous or next 
instruction it if needed in a custom fatal error handler which deals 
with RTEMS_FATAL_EXCEPTION. I think libdebugger uses this approach.

On 14/04/2021 17:46, Kinsey Moore wrote:
> This adds a confdef option allowing an application to request mapping
> machine exceptions to POSIX signals. This is required for some languages
> such as Ada.

[...]

> diff --git a/cpukit/include/rtems/exceptions.h b/cpukit/include/rtems/exceptions.h
> new file mode 100644
> index 0000000000..5e43827d11
> --- /dev/null
> +++ b/cpukit/include/rtems/exceptions.h
> @@ -0,0 +1,57 @@
> +/* SPDX-License-Identifier: BSD-2-Clause */
> +
> +/**
> + * @file
> + *
> + * @brief Exception mapping
> + *
> + * This file describes the hooks necessary for mapping machine exceptions to
> + * POSIX signals.
> + */
> +
> +/*
> + * Copyright (C) 2021 On-Line Applications Research
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *    notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *    notice, this list of conditions and the following disclaimer in the
> + *    documentation and/or other materials provided with the distribution.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
> + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
> + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
> + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
> + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
> + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
> + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
> + * POSSIBILITY OF SUCH DAMAGE.
> + */
> +
> +#ifndef _RTEMS_EXCEPTIONS_H
> +#define _RTEMS_EXCEPTIONS_H
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +/**
> + * @brief Configures the desired mapping for machine exceptions to POSIX
> + * signals.
> + *
> + * See CONFIGURE_APPLICATION_NEEDS_EXCEPTION_TO_SIGNAL_MAPPING documentation in the
> + * "RTEMS Classic API Guide".
> + */
> +void _Exception_initialize_signal_mapping( void );
> +
> +#ifdef __cplusplus
> +}
> +#endif
The #include <rtems/*.h> location should be used for header files which 
provide API elements. API elements should be in the rtems_* namespace.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/



More information about the devel mailing list