diff options
Diffstat (limited to 'cpukit/posix/src/ptimer.c')
-rw-r--r-- | cpukit/posix/src/ptimer.c | 94 |
1 files changed, 32 insertions, 62 deletions
diff --git a/cpukit/posix/src/ptimer.c b/cpukit/posix/src/ptimer.c index f3af1710b8..311bc0b909 100644 --- a/cpukit/posix/src/ptimer.c +++ b/cpukit/posix/src/ptimer.c @@ -1,77 +1,47 @@ /** * @file * - * @brief Process Timer - * @ingroup POSIXAPI + * @ingroup POSIX_INTERNAL_TIMERS + * + * @brief POSIX Timer 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 <time.h> -#include <errno.h> -#include <limits.h> /* _POSIX_PATH_MAX */ - -#include <rtems/system.h> -#include <rtems/config.h> -#include <rtems/score/isr.h> -#include <rtems/score/thread.h> - - -/************************************/ -/* These includes are now necessary */ -/************************************/ - -#include <unistd.h> -#include <rtems/sysinit.h> -#include <rtems/rtems/status.h> -#include <rtems/rtems/types.h> -#include <rtems/rtems/timer.h> -#include <rtems/rtems/clock.h> -#include <rtems/score/wkspace.h> -#include <pthread.h> -#include <stdio.h> -#include <signal.h> - -#include <rtems/posix/timerimpl.h> - -Objects_Information _POSIX_Timer_Information; - -/* - * _POSIX_Timer_Manager_initialization - * - * Description: - * - * Initialize the internal structure in which the data of all - * the timers are stored - */ - -static void _POSIX_Timer_Manager_initialization(void) -{ - _Objects_Initialize_information( - &_POSIX_Timer_Information, /* object information table */ - OBJECTS_POSIX_API, /* object API */ - OBJECTS_POSIX_TIMERS, /* object class */ - _Configuration_POSIX_Maximum_timers, - sizeof( POSIX_Timer_Control ), - /* size of this object's control block */ - OBJECTS_NO_STRING_NAME, /* maximum length of an object name */ - NULL /* Proxy extraction support callout */ - ); -} +#include <rtems/posix/timer.h> -RTEMS_SYSINIT_ITEM( - _POSIX_Timer_Manager_initialization, - RTEMS_SYSINIT_POSIX_TIMER, - RTEMS_SYSINIT_ORDER_MIDDLE +OBJECTS_INFORMATION_DEFINE_ZERO( + _POSIX_Timer, + OBJECTS_POSIX_API, + OBJECTS_POSIX_TIMERS, + OBJECTS_NO_STRING_NAME ); |