[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


  • To: Costin Lupu <costin.lupu@xxxxxxxxx>, "minios-devel@xxxxxxxxxxxxx" <minios-devel@xxxxxxxxxxxxx>
  • From: Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
  • Date: Thu, 31 Oct 2019 17:48:13 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=stud.acs.upb.ro; dmarc=pass action=none header.from=stud.acs.upb.ro; dkim=pass header.d=stud.acs.upb.ro; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=X/VBccI8DSmx7WUzyGkq2c42ohgkEEkBAGCuE1ZY64k=; b=masx7e8RdmukKdAsbKCu/QUC6QqHVefDUchODZHrRLxoEFbiCu0S+zqX6f46dC8sj+ZFSVzMYAChEhQtbIKwN0/C/KszCpGN/N9iyI0ChMNOYqzC31EfPcPemXfysY61Nd9o9+/eOjpHuVNHsY0WiQUFOfrpKQNxofelTwQDD9MMVXVsSiHSj+MBGCzK5bRAo+HLHbOWebO+gh5WfAkZlbQzpljbhKmZ+2IJp1MdhdMt5KjIGCNRbgZl7TtjcVlqAUEFowkynVJ8FQSLtA3996zAkeUmZy5t+aR1N1l0DXZmqVrpZ4NKxAmP66RW42H21fyU2D2lFLfki3KIbaoEqg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c5U+UmCrT5PDccXJrKM5xDUn7FC71PfR13ik/FozmyFG71yrsP3bkFk+zIfh2adUFV1eiwT8PrSrlpyASraZWK4rl3ODf3yfSLBoT4JTeYgNTltQW+6m8ZYuo18InQc2gjcLMUGcgCiQSap6p17v+COIacZqYj6QKdETuXrRrAy6+mBHJfZdDbGGCbPboqewKNRCjRNUoFBxtS7sPIyt3tNr3Ox/5Zmn1WwaERXNu7EheBVX8Rjq7iSrc0BM5eu6LUGIJ+OTpfkcmaDWpM3Os61qtZb1y7ko9VFpr1dBx9OulZi0CaCwUnDsnFtH4E9sBJTpPUH2UNuxc66JU4GAfA==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=vlad_andrei.badoiu@xxxxxxxxxxxxxxx;
  • Cc: "felipe.huici@xxxxxxxxx" <felipe.huici@xxxxxxxxx>, "simon.kuenzer@xxxxxxxxx" <simon.kuenzer@xxxxxxxxx>
  • Delivery-date: Thu, 31 Oct 2019 17:48:23 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Thread-index: AQHVj9L14TCAhrWXlkCMQ4nzgyFaUad1BxOA
  • Thread-topic: [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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.