Changeset 6e4c01e in rtems for cpukit/sapi
- Timestamp:
- 08/23/13 04:56:36 (11 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 38ec8af
- Parents:
- c9b66f5
- Location:
- cpukit/sapi
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/sapi/include/confdefs.h
rc9b66f5 r6e4c01e 955 955 956 956 /** 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 /** 957 962 * This is a helper macro used in calculations in this file. It is used 958 963 * to noted when an element is allocated from the RTEMS Workspace and adds … … 961 966 */ 962 967 #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)) 964 970 965 971 /** … … 981 987 */ 982 988 #define _Configure_Max_Objects(_max) \ 983 rtems_resource_maximum_per_allocation(_max)989 (_Configure_Zero_or_One(_max) * rtems_resource_maximum_per_allocation(_max)) 984 990 985 991 /** … … 993 999 ( _Configure_From_workspace(_Configure_Max_Objects(_number) * (_size)) + \ 994 1000 _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 *))) \ 997 1005 ) \ 998 1006 ) … … 1731 1739 1732 1740 #ifndef CONFIGURE_MAXIMUM_POSIX_THREADS 1733 #define CONFIGURE_MAXIMUM_POSIX_THREADS 1741 #define CONFIGURE_MAXIMUM_POSIX_THREADS 0 1734 1742 #endif 1735 1743 … … 1738 1746 1739 1747 #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) ) 1746 1752 1747 1753 #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) ) 1755 1759 1756 1760 #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 1760 1763 #else 1761 1764 #ifndef CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS … … 1764 1767 * (CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_TASKS) 1765 1768 #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 #endif1769 #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))) 1770 1773 1771 1774 #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) ) 1778 1779 1779 1780 #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)) ) 1787 1786 1788 1787 #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 1789 1788 #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 0 1790 #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) 01791 1789 #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 1798 1791 /* default to same number */ 1799 1792 #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS … … 1801 1794 CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 1802 1795 #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) ) 1808 1805 1809 1806 #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) ) 1817 1812 1818 1813 #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) ) 1825 1818 1826 1819 #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) ) 1833 1824 1834 1825 #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) ) 1841 1830 1842 1831 #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE … … 2579 2568 /* POSIX API Pieces */ 2580 2569 CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES + 2570 CONFIGURE_MAXIMUM_POSIX_INTERNAL_MUTEXES + 2581 2571 CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_MUTEXES), 2582 2572 CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( -
cpukit/sapi/src/posixapi.c
rc9b66f5 r6e4c01e 45 45 #include <rtems/posix/time.h> 46 46 47 void _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 47 54 Objects_Information *_POSIX_Objects[ OBJECTS_POSIX_CLASSES_LAST + 1 ]; 48 55
Note: See TracChangeset
for help on using the changeset viewer.