From 21275b58a5a69c3c838082ffc8a7a3641f32ea9a Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 22 Nov 2018 19:14:51 +0100 Subject: score: Static Objects_Information initialization Statically allocate the objects information together with the initial set of objects either via . Provide default object informations with zero objects via librtemscpu.a. This greatly simplifies the workspace size estimate. RTEMS applications which do not use the unlimited objects option are easier to debug since all objects reside now in statically allocated objects of the right types. Close #3621. --- cpukit/posix/src/mqueue.c | 81 +++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 49 deletions(-) (limited to 'cpukit/posix/src/mqueue.c') diff --git a/cpukit/posix/src/mqueue.c b/cpukit/posix/src/mqueue.c index 192d853c35..21c5feb8be 100644 --- a/cpukit/posix/src/mqueue.c +++ b/cpukit/posix/src/mqueue.c @@ -1,66 +1,49 @@ /** * @file * - * @brief Initializes message_queue Manager Related Data Structures - * @ingroup POSIX_MQUEUE_P Message Queues Private Support Information + * @ingroup POSIX_MQUEUE_P + * + * @brief POSIX Message Queue Information with Zero Objects */ /* - * COPYRIGHT (c) 1989-2008. - * On-Line Applications Research Corporation (OAR). + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (C) 2018 embedded brains GmbH * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. + * 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. */ #if HAVE_CONFIG_H #include "config.h" #endif -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include #include -Objects_Information _POSIX_Message_queue_Information; - -/* - * _POSIX_Message_queue_Manager_initialization - * - * This routine initializes all message_queue manager related data structures. - * - * Input parameters: NONE - * - * Output parameters: NONE - */ - -static void _POSIX_Message_queue_Manager_initialization(void) -{ - _Objects_Initialize_information( - &_POSIX_Message_queue_Information, /* object information table */ - OBJECTS_POSIX_API, /* object API */ - OBJECTS_POSIX_MESSAGE_QUEUES, /* object class */ - _Configuration_POSIX_Maximum_message_queues, - sizeof( POSIX_Message_queue_Control ), - /* size of this object's control block */ - _POSIX_PATH_MAX, /* maximum length of each object's name */ - NULL /* Proxy extraction support callout */ - ); -} +#include -RTEMS_SYSINIT_ITEM( - _POSIX_Message_queue_Manager_initialization, - RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE, - RTEMS_SYSINIT_ORDER_MIDDLE +OBJECTS_INFORMATION_DEFINE_ZERO( + _POSIX_Message_queue, + OBJECTS_POSIX_API, + OBJECTS_POSIX_MESSAGE_QUEUES, + _POSIX_PATH_MAX ); -- cgit v1.2.3