|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCH] include/uk: Introduce <ctors_prio.h> header for constructors priority values
Hey Costin,
Thanks for the patch! My comment is that I see this as a temporal
solution and we shouldn't have macros related to specific external
libraries inside the kernel.
Reviewed-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
On 31.10.2019 12:07, Costin Lupu wrote:
> We introduce the <ctors_prio.h> header as a way for centralizing all the
> values
> for constructor priorities. Whenever we will want to change the values we will
> do it here.
>
> It's not obvious from the beginning which values we should assign to the
> constructors in the system, so we expect this file to be prone to many changes
> in the future.
>
> Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
> ---
> include/uk/ctors_prio.h | 65 +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 65 insertions(+)
> create mode 100644 include/uk/ctors_prio.h
>
> diff --git a/include/uk/ctors_prio.h b/include/uk/ctors_prio.h
> new file mode 100644
> index 00000000..5ce9c95d
> --- /dev/null
> +++ b/include/uk/ctors_prio.h
> @@ -0,0 +1,65 @@
> +/* SPDX-License-Identifier: BSD-3-Clause */
> +/*
> + * Authors: Costin Lupu <costin.lupu@xxxxxxxxx>
> + *
> + * Copyright (c) 2019, University Politehnica of Bucharest. All rights
> reserved.
> + *
> + * 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.
> + * 3. Neither the name of the copyright holder nor the names of its
> + * contributors may be used to endorse or promote products derived from
> + * this software without specific prior written permission.
> + *
> + * 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 HOLDER 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.
> + *
> + * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY.
> + */
> +
> +#ifndef __UK_CTORS__PRIO_H__
> +#define __UK_CTORS__PRIO_H__
> +
> +#include <uk/essentials.h>
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +#ifdef __GNUC__
> +
> +/* Constructor attribute */
> +#define UK_CTOR_ATTR(value) __attribute__((constructor(value)))
> +
> +
> +/*
> + * Constructors priority values
> + */
> +#define UK_CTOR_PRIO_PTHREAD_EMBEDDED 101
> +
> +
> +
> +#else
> +#error "Please define constructor priorities for your compiler!"
> +#endif
> +
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +#endif /* __UK_CTORS__PRIO_H__ */
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |