Changeset 6e4c01e in rtems for cpukit/sapi


Ignore:
Timestamp:
08/23/13 04:56:36 (11 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.11, 5, master
Children:
38ec8af
Parents:
c9b66f5
Message:

posix: Update to the pthread_once changes.

Implement the reeview changes.
Add a POSIX Fatal error domain.
Fix confdefs.h to correctly handle the internal POSIX mutexes.

Location:
cpukit/sapi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/include/confdefs.h

    rc9b66f5 r6e4c01e  
    955955
    956956/**
     957 * Zero of one returns 0 if the parameter is 0 else 1 is returned.
     958 */
     959#define _Configure_Zero_or_One(_number) ((_number) ? 1 : 0)
     960
     961/**
    957962 * This is a helper macro used in calculations in this file.  It is used
    958963 * to noted when an element is allocated from the RTEMS Workspace and adds
     
    961966 */
    962967#define _Configure_From_workspace(_size) \
    963   (ssize_t)((_size) + HEAP_BLOCK_HEADER_SIZE + CPU_HEAP_ALIGNMENT - 1)
     968   (ssize_t) (_Configure_Zero_or_One(_size) * \
     969     ((_size) + HEAP_BLOCK_HEADER_SIZE + CPU_HEAP_ALIGNMENT - 1))
    964970
    965971/**
     
    981987 */
    982988#define _Configure_Max_Objects(_max) \
    983   rtems_resource_maximum_per_allocation(_max)
     989  (_Configure_Zero_or_One(_max) * rtems_resource_maximum_per_allocation(_max))
    984990
    985991/**
     
    993999  ( _Configure_From_workspace(_Configure_Max_Objects(_number) * (_size)) + \
    9941000    _Configure_From_workspace( \
    995       ((_Configure_Max_Objects(_number) + 1) * sizeof(Objects_Control *)) + \
    996       (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) \
     1001      (_Configure_Zero_or_One(_number) * \
     1002       (_Configure_Max_Objects(_number) + 1) * sizeof(Objects_Control *)) + \
     1003      (_Configure_Zero_or_One(_number) * \
     1004       (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *))) \
    9971005    ) \
    9981006  )
     
    17311739
    17321740  #ifndef CONFIGURE_MAXIMUM_POSIX_THREADS
    1733     #define CONFIGURE_MAXIMUM_POSIX_THREADS      0
     1741    #define CONFIGURE_MAXIMUM_POSIX_THREADS 0
    17341742  #endif
    17351743
     
    17381746
    17391747  #ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES
    1740     #define CONFIGURE_MAXIMUM_POSIX_MUTEXES              0
    1741     #define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) 0
    1742   #else
    1743     #define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \
    1744       _Configure_Object_RAM(_mutexes, sizeof(POSIX_Mutex_Control) )
    1745   #endif
     1748    #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 0
     1749  #endif
     1750  #define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \
     1751    _Configure_Object_RAM(_mutexes, sizeof(POSIX_Mutex_Control) )
    17461752
    17471753  #ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES
    1748     #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES               0
    1749     #define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condvars) 0
    1750   #else
    1751     #define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condvars) \
    1752         _Configure_Object_RAM(_condvars, \
    1753                             sizeof(POSIX_Condition_variables_Control) )
    1754   #endif
     1754    #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 0
     1755  #endif
     1756  #define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condvars) \
     1757      _Configure_Object_RAM(_condvars, \
     1758                          sizeof(POSIX_Condition_variables_Control) )
    17551759
    17561760  #ifndef CONFIGURE_MAXIMUM_POSIX_KEYS
    1757     #define CONFIGURE_MAXIMUM_POSIX_KEYS           0
    1758     #define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS      0
    1759     #define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys, _key_value_pairs) 0
     1761    #define CONFIGURE_MAXIMUM_POSIX_KEYS            0
     1762    #define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS 0
    17601763  #else
    17611764    #ifndef CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS
     
    17641767        * (CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_TASKS)
    17651768    #endif
    1766   #define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys, _key_value_pairs)       \
    1767       (_Configure_Object_RAM(_keys, sizeof(POSIX_Keys_Control) ) \
    1768   + _Configure_From_workspace(_key_value_pairs * sizeof(POSIX_Keys_Key_value_pair)))
    1769   #endif
     1769  #endif
     1770  #define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys, _key_value_pairs) \
     1771     (_Configure_Object_RAM(_keys, sizeof(POSIX_Keys_Control) ) \
     1772      + _Configure_From_workspace(_key_value_pairs * sizeof(POSIX_Keys_Key_value_pair)))
    17701773
    17711774  #ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS
    1772     #define CONFIGURE_MAXIMUM_POSIX_TIMERS             0
    1773     #define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) 0
    1774   #else
    1775     #define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) \
    1776       _Configure_Object_RAM(_timers, sizeof(POSIX_Timer_Control) )
    1777   #endif
     1775    #define CONFIGURE_MAXIMUM_POSIX_TIMERS 0
     1776  #endif
     1777  #define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) \
     1778    _Configure_Object_RAM(_timers, sizeof(POSIX_Timer_Control) )
    17781779
    17791780  #ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
    1780     #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS                     0
    1781     #define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) 0
    1782   #else
    1783     #define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \
    1784       _Configure_From_workspace( \
    1785         (_queued_signals) * (sizeof(POSIX_signals_Siginfo_node)) )
    1786   #endif
     1781    #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0
     1782  #endif
     1783  #define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \
     1784    _Configure_From_workspace( \
     1785      (_queued_signals) * (sizeof(POSIX_signals_Siginfo_node)) )
    17871786
    17881787  #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
    17891788    #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES                     0
    1790     #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) 0
    17911789    #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS          0
    1792     #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUE_DESCRIPTORS(_fds) 0
    1793   #else
    1794     #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \
    1795       _Configure_POSIX_Named_Object_RAM( \
    1796          _message_queues, sizeof(POSIX_Message_queue_Control) )
    1797 
     1790  #else
    17981791    /* default to same number */
    17991792    #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS
     
    18011794               CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
    18021795    #endif
    1803 
    1804     #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUE_DESCRIPTORS(_mqueue_fds) \
    1805       _Configure_Object_RAM( \
    1806          _mqueue_fds, sizeof(POSIX_Message_queue_Control_fd) )
    1807   #endif
     1796  #endif
     1797
     1798  #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \
     1799    _Configure_POSIX_Named_Object_RAM( \
     1800       _message_queues, sizeof(POSIX_Message_queue_Control) )
     1801
     1802  #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUE_DESCRIPTORS(_mqueue_fds) \
     1803    _Configure_Object_RAM( \
     1804       _mqueue_fds, sizeof(POSIX_Message_queue_Control_fd) )
    18081805
    18091806  #ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
    1810     #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES                 0
    1811     #define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) 0
    1812   #else
    1813     #define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \
    1814       _Configure_POSIX_Named_Object_RAM( \
    1815          _semaphores, sizeof(POSIX_Semaphore_Control) )
    1816   #endif
     1807    #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 0
     1808  #endif
     1809  #define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \
     1810    _Configure_POSIX_Named_Object_RAM( \
     1811       _semaphores, sizeof(POSIX_Semaphore_Control) )
    18171812
    18181813  #ifndef CONFIGURE_MAXIMUM_POSIX_BARRIERS
    1819     #define CONFIGURE_MAXIMUM_POSIX_BARRIERS               0
    1820     #define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) 0
    1821   #else
    1822     #define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) \
    1823       _Configure_Object_RAM(_barriers, sizeof(POSIX_Barrier_Control) )
    1824   #endif
     1814    #define CONFIGURE_MAXIMUM_POSIX_BARRIERS 0
     1815  #endif
     1816  #define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) \
     1817    _Configure_Object_RAM(_barriers, sizeof(POSIX_Barrier_Control) )
    18251818
    18261819  #ifndef CONFIGURE_MAXIMUM_POSIX_SPINLOCKS
    1827     #define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS                0
    1828     #define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) 0
    1829   #else
    1830     #define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) \
    1831       _Configure_Object_RAM(_spinlocks, sizeof(POSIX_Spinlock_Control) )
    1832   #endif
     1820    #define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS 0
     1821  #endif
     1822  #define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) \
     1823    _Configure_Object_RAM(_spinlocks, sizeof(POSIX_Spinlock_Control) )
    18331824
    18341825  #ifndef CONFIGURE_MAXIMUM_POSIX_RWLOCKS
    1835     #define CONFIGURE_MAXIMUM_POSIX_RWLOCKS              0
    1836     #define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) 0
    1837   #else
    1838     #define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) \
    1839       _Configure_Object_RAM(_rwlocks, sizeof(POSIX_RWLock_Control) )
    1840   #endif
     1826    #define CONFIGURE_MAXIMUM_POSIX_RWLOCKS 0
     1827  #endif
     1828  #define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) \
     1829    _Configure_Object_RAM(_rwlocks, sizeof(POSIX_RWLock_Control) )
    18411830
    18421831  #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
     
    25792568    /* POSIX API Pieces */
    25802569    CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES +
     2570      CONFIGURE_MAXIMUM_POSIX_INTERNAL_MUTEXES +
    25812571      CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_MUTEXES),
    25822572    CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(
  • cpukit/sapi/src/posixapi.c

    rc9b66f5 r6e4c01e  
    4545#include <rtems/posix/time.h>
    4646
     47void _POSIX_Fatal_error( POSIX_Fatal_domain domain, int eno )
     48{
     49  uint32_t code = ( domain << 8 ) | ( ( uint32_t ) eno & 0xffU );
     50
     51  _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, false, code );
     52}
     53
    4754Objects_Information *_POSIX_Objects[ OBJECTS_POSIX_CLASSES_LAST + 1 ];
    4855
Note: See TracChangeset for help on using the changeset viewer.