summaryrefslogtreecommitdiffstats
path: root/c/src/exec/score/macros/rtems
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1995-09-11 19:35:39 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1995-09-11 19:35:39 +0000
commit3a4ae6c210bcc37754767966f1128ae23c77b6af (patch)
tree8804983e5b92bec788d548df13db7513118d351d /c/src/exec/score/macros/rtems
parentnew file -- split from inlines (diff)
downloadrtems-3a4ae6c210bcc37754767966f1128ae23c77b6af.tar.bz2
The word "RTEMS" almost completely removed from the core.
Configuration Table Template file added and all tests modified to use this. All gvar.h and conftbl.h files removed from test directories. Configuration parameter maximum_devices added. Core semaphore and mutex handlers added and RTEMS API Semaphore Manager updated to reflect this. Initialization sequence changed to invoke API specific initialization routines. Initialization tasks table now owned by RTEMS Tasks Manager. Added user extension for post-switch. Utilized user extensions to implement API specific functionality like signal dispatching. Added extensions to the System Initialization Thread so that an API can register a function to be invoked while the system is being initialized. These are largely equivalent to the pre-driver and post-driver hooks. Added the Modules file oar-go32_p5, modified oar-go32, and modified the file make/custom/go32.cfg to look at an environment varable which determines what CPU model is being used. All BSPs updated to reflect named devices and clock driver's IOCTL used by the Shared Memory Driver. Also merged clock isr into main file and removed ckisr.c where possible. Updated spsize to reflect new and moved variables. Makefiles for the executive source and include files updated to show break down of files into Core, RTEMS API, and Neither. Header and inline files installed into subdirectory based on whether logically in the Core or a part of the RTEMS API.
Diffstat (limited to 'c/src/exec/score/macros/rtems')
-rw-r--r--c/src/exec/score/macros/rtems/score/address.inl15
-rw-r--r--c/src/exec/score/macros/rtems/score/coremutex.inl77
-rw-r--r--c/src/exec/score/macros/rtems/score/coresem.inl40
-rw-r--r--c/src/exec/score/macros/rtems/score/heap.inl2
-rw-r--r--c/src/exec/score/macros/rtems/score/isr.inl12
-rw-r--r--c/src/exec/score/macros/rtems/score/object.inl18
-rw-r--r--c/src/exec/score/macros/rtems/score/priority.inl10
-rw-r--r--c/src/exec/score/macros/rtems/score/stack.inl2
-rw-r--r--c/src/exec/score/macros/rtems/score/states.inl11
-rw-r--r--c/src/exec/score/macros/rtems/score/sysstate.inl15
-rw-r--r--c/src/exec/score/macros/rtems/score/thread.inl8
-rw-r--r--c/src/exec/score/macros/rtems/score/userext.inl83
-rw-r--r--c/src/exec/score/macros/rtems/score/watchdog.inl2
-rw-r--r--c/src/exec/score/macros/rtems/score/wkspace.inl21
14 files changed, 199 insertions, 117 deletions
diff --git a/c/src/exec/score/macros/rtems/score/address.inl b/c/src/exec/score/macros/rtems/score/address.inl
index f2672f2500..c0d45c3c6b 100644
--- a/c/src/exec/score/macros/rtems/score/address.inl
+++ b/c/src/exec/score/macros/rtems/score/address.inl
@@ -24,7 +24,7 @@
*/
#define _Addresses_Add_offset( _base, _offset ) \
- ((void *)(_base) + (_offset))
+ ((void *)((char *)(_base) + (_offset)))
/*PAGE
*
@@ -33,18 +33,7 @@
*/
#define _Addresses_Subtract_offset( _base, _offset ) \
- ((void *)(_base) - (_offset))
-
-/*PAGE
- *
- * _Addresses_Add
- *
- * NOTE: The cast of an address to an unsigned32 makes this code
- * dependent on an addresses being thirty two bits.
- */
-
-#define _Addresses_Add( _left, _right ) \
- ((void *)(_left) + (unsigned32)(_right))
+ ((void *)((char *)(_base) - (_offset)))
/*PAGE
*
diff --git a/c/src/exec/score/macros/rtems/score/coremutex.inl b/c/src/exec/score/macros/rtems/score/coremutex.inl
new file mode 100644
index 0000000000..e8dbc9322c
--- /dev/null
+++ b/c/src/exec/score/macros/rtems/score/coremutex.inl
@@ -0,0 +1,77 @@
+/* macros/coremutex.h
+ *
+ * This include file contains all of the inlined routines associated
+ * with core mutexes.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#ifndef __MACROS_CORE_MUTEX_h
+#define __MACROS_CORE_MUTEX_h
+
+
+/*PAGE
+ *
+ * _CORE_mutex_Is_locked
+ *
+ */
+
+#define _CORE_mutex_Is_locked( _the_mutex ) \
+ ( (_the_mutex)->lock == CORE_MUTEX_LOCKED )
+
+/*PAGE
+ *
+ * _CORE_mutex_Is_fifo
+ *
+ */
+
+#define _CORE_mutex_Is_fifo( _the_attribute ) \
+ ( (_the_attribute)->discipline == CORE_MUTEX_DISCIPLINES_FIFO )
+
+/*PAGE
+ *
+ * _CORE_mutex_Is_priority
+ *
+ */
+
+#define _CORE_mutex_Is_priority( _the_attribute ) \
+ ( (_the_attribute)->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY )
+
+/*PAGE
+ *
+ * _CORE_mutex_Is_inherit_priority
+ *
+ */
+
+#define _CORE_mutex_Is_inherit_priority( _the_attribute ) \
+ ( (_the_attribute)->discipline == \
+ CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT )
+
+/*PAGE
+ *
+ * _CORE_mutex_Is_priority_ceiling
+ *
+ */
+
+#define _CORE_mutex_Is_priority_ceiling( _the_attribute )\
+ ( (_the_attribute)->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING )
+
+/*PAGE
+ *
+ * _CORE_mutex_Is_nesting_allowed
+ *
+ */
+
+#define _CORE_mutex_Is_nesting_allowed( _the_attribute ) \
+ ( (_the_attribute)->allow_nesting == TRUE )
+
+#endif
+/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/coresem.inl b/c/src/exec/score/macros/rtems/score/coresem.inl
new file mode 100644
index 0000000000..499b4a1433
--- /dev/null
+++ b/c/src/exec/score/macros/rtems/score/coresem.inl
@@ -0,0 +1,40 @@
+/* macros/coresem.h
+ *
+ * This include file contains all of the inlined routines associated
+ * with core semaphores.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#ifndef __MACROS_CORE_SEMAPHORE_h
+#define __MACROS_CORE_SEMAPHORE_h
+
+/*PAGE
+ *
+ * _CORE_semaphore_Is_priority
+ *
+ */
+
+#define _CORE_semaphore_Is_priority( _the_attribute ) \
+ ( (_the_attribute)->discipline == CORE_SEMAPHORE_DISCIPLINES_PRIORITY )
+
+/*PAGE
+ *
+ * _Core_semaphore_Get_count
+ *
+ */
+
+#define _Core_semaphore_Get_count( _the_semaphore ) \
+ ( (_the_semaphore)->count )
+
+
+#endif
+/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/heap.inl b/c/src/exec/score/macros/rtems/score/heap.inl
index 4966aab385..1023a77fc5 100644
--- a/c/src/exec/score/macros/rtems/score/heap.inl
+++ b/c/src/exec/score/macros/rtems/score/heap.inl
@@ -17,7 +17,7 @@
#ifndef __HEAP_inl
#define __HEAP_inl
-#include <rtems/address.h>
+#include <rtems/core/address.h>
/*PAGE
*
diff --git a/c/src/exec/score/macros/rtems/score/isr.inl b/c/src/exec/score/macros/rtems/score/isr.inl
index 93f234c7ff..975487c98b 100644
--- a/c/src/exec/score/macros/rtems/score/isr.inl
+++ b/c/src/exec/score/macros/rtems/score/isr.inl
@@ -19,18 +19,6 @@
/*PAGE
*
- * _ISR_Handler_initialization
- *
- */
-
-#define _ISR_Handler_initialization() \
- { \
- _ISR_Signals_to_thread_executing = FALSE; \
- _ISR_Nest_level = 0; \
- }
-
-/*PAGE
- *
* _ISR_Is_in_progress
*
*/
diff --git a/c/src/exec/score/macros/rtems/score/object.inl b/c/src/exec/score/macros/rtems/score/object.inl
index 7a346af720..8a5a0a3411 100644
--- a/c/src/exec/score/macros/rtems/score/object.inl
+++ b/c/src/exec/score/macros/rtems/score/object.inl
@@ -30,29 +30,29 @@
/*PAGE
*
- * rtems_get_class
+ * _Objects_Get_class
*/
-#define rtems_get_class( _id ) \
+#define _Objects_Get_class( _id ) \
(Objects_Classes) \
(((_id) >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS)
/*PAGE
*
- * rtems_get_node
+ * _Objects_Get_node
*
*/
-#define rtems_get_node( _id ) \
+#define _Objects_Get_node( _id ) \
(((_id) >> OBJECTS_NODE_START_BIT) & OBJECTS_NODE_VALID_BITS)
/*PAGE
*
- * rtems_get_index
+ * _Objects_Get_index
*
*/
-#define rtems_get_index( _id ) \
+#define _Objects_Get_index( _id ) \
(((_id) >> OBJECTS_INDEX_START_BIT) & OBJECTS_INDEX_VALID_BITS)
/*PAGE
@@ -80,7 +80,7 @@
*/
#define _Objects_Is_local_id( _id ) \
- _Objects_Is_local_node( rtems_get_node(_id) )
+ _Objects_Is_local_node( _Objects_Get_node(_id) )
/*PAGE
*
@@ -119,7 +119,7 @@
{ \
unsigned32 _index; \
\
- _index = rtems_get_index( (_the_object)->id ); \
+ _index = _Objects_Get_index( (_the_object)->id ); \
(_information)->local_table[ _index ] = (_the_object); \
\
if ( (_information)->is_string ) \
@@ -139,7 +139,7 @@
{ \
unsigned32 _index; \
\
- _index = rtems_get_index( (_the_object)->id ); \
+ _index = _Objects_Get_index( (_the_object)->id ); \
(_information)->local_table[ _index ] = NULL; \
_Objects_Clear_name( (_the_object)->name, (_information)->name_length ); \
}
diff --git a/c/src/exec/score/macros/rtems/score/priority.inl b/c/src/exec/score/macros/rtems/score/priority.inl
index 0efec0050e..d78e2a0628 100644
--- a/c/src/exec/score/macros/rtems/score/priority.inl
+++ b/c/src/exec/score/macros/rtems/score/priority.inl
@@ -17,7 +17,7 @@
#ifndef __PRIORITY_inl
#define __PRIORITY_inl
-#include <rtems/bitfield.h>
+#include <rtems/core/bitfield.h>
/*PAGE
*
@@ -40,9 +40,13 @@
*
*/
+ /*
+ * Since PRIORITY_MINIMUM is 0 and priorities are stored unsigned,
+ * then checking for less than 0 is unnecessary.
+ */
+
#define _Priority_Is_valid( _the_priority ) \
- ( ( (_the_priority) >= RTEMS_MINIMUM_PRIORITY ) && \
- ( (_the_priority) <= RTEMS_MAXIMUM_PRIORITY ) )
+ ( (_the_priority) <= PRIORITY_MAXIMUM )
/*PAGE
*
diff --git a/c/src/exec/score/macros/rtems/score/stack.inl b/c/src/exec/score/macros/rtems/score/stack.inl
index 208503b45f..d20eebd0b9 100644
--- a/c/src/exec/score/macros/rtems/score/stack.inl
+++ b/c/src/exec/score/macros/rtems/score/stack.inl
@@ -36,7 +36,7 @@
*/
#define _Stack_Is_enough( _size ) \
- ( (_size) >= RTEMS_MINIMUM_STACK_SIZE )
+ ( (_size) >= STACK_MINIMUM_SIZE )
/*PAGE
*
diff --git a/c/src/exec/score/macros/rtems/score/states.inl b/c/src/exec/score/macros/rtems/score/states.inl
index f69c4ba042..4fa138d107 100644
--- a/c/src/exec/score/macros/rtems/score/states.inl
+++ b/c/src/exec/score/macros/rtems/score/states.inl
@@ -1,7 +1,7 @@
/* states.inl
*
* This file contains the macro implementation of the inlined
- * routines associated with RTEMS state information.
+ * routines associated with thread state information.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
@@ -127,6 +127,15 @@
/*PAGE
*
+ * _States_Is_waiting_for_mutex
+ *
+ */
+
+#define _States_Is_waiting_for_mutex( _the_states ) \
+ ( (_the_states) & STATES_WAITING_FOR_MUTEX )
+
+/*PAGE
+ *
* _States_Is_waiting_for_semaphore
*
*/
diff --git a/c/src/exec/score/macros/rtems/score/sysstate.inl b/c/src/exec/score/macros/rtems/score/sysstate.inl
index ed13494d30..d0cb932924 100644
--- a/c/src/exec/score/macros/rtems/score/sysstate.inl
+++ b/c/src/exec/score/macros/rtems/score/sysstate.inl
@@ -19,11 +19,24 @@
/*PAGE
*
+ * _System_state_Handler_initialization
+ */
+
+#define _System_state_Handler_initialization( _is_multiprocessing ) \
+ do { \
+ _System_state_Current = SYSTEM_STATE_BEFORE_INITIALIZATION; \
+ _System_state_Is_multiprocessing = (_is_multiprocessing); \
+ } while ( 0 )
+
+/*PAGE
+ *
* _System_state_Set
*/
#define _System_state_Set( _state ) \
- _System_state_Current = (_state)
+ do { \
+ _System_state_Current = (_state); \
+ } while ( 0 )
/*PAGE
*
diff --git a/c/src/exec/score/macros/rtems/score/thread.inl b/c/src/exec/score/macros/rtems/score/thread.inl
index d7d37cb218..3f7afb054b 100644
--- a/c/src/exec/score/macros/rtems/score/thread.inl
+++ b/c/src/exec/score/macros/rtems/score/thread.inl
@@ -189,5 +189,13 @@ void _Thread_Enable_dispatch( void );
#define _Thread_Is_null( _the_thread ) \
( (_the_thread) == NULL )
+/*
+ * _Thread_Is_proxy_blocking
+ *
+ */
+
+#define _Thread_Is_proxy_blocking( _code ) \
+ ( (_code) == THREAD_STATUS_PROXY_BLOCKING )
+
#endif
/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/userext.inl b/c/src/exec/score/macros/rtems/score/userext.inl
index 781f30ad40..2daa37494d 100644
--- a/c/src/exec/score/macros/rtems/score/userext.inl
+++ b/c/src/exec/score/macros/rtems/score/userext.inl
@@ -40,11 +40,20 @@
*/
#define _User_extensions_Add_set( _the_extension, _extension_table ) \
- { \
+ do { \
(_the_extension)->Callouts = *(_extension_table); \
\
_Chain_Append( &_User_extensions_List, &(_the_extension)->Node ); \
- }
+ } while ( 0 )
+
+/*PAGE
+ *
+ * _User_extensions_Add_API_set
+ */
+
+#define _User_extensions_Add_API_set( _the_extension ) \
+ _Chain_Prepend( &_User_extensions_List, &(_the_extension)->Node )
+
/*PAGE
*
@@ -106,79 +115,21 @@
/*PAGE
*
- * _User_extensions_Task_create
- *
- */
-
-#define _User_extensions_Task_create( _the_thread ) \
- _User_extensions_Run_list_forward(rtems_task_create, \
- (_Thread_Executing, _the_thread) )
-
-/*PAGE
- *
- * _User_extensions_Task_delete
- *
- */
-
-#define _User_extensions_Task_delete( _the_thread ) \
- _User_extensions_Run_list_backward(rtems_task_delete, \
- (_Thread_Executing, _the_thread) )
-
-/*PAGE
- *
- * _User_extensions_Task_start
- *
- */
-
-#define _User_extensions_Task_start( _the_thread ) \
- _User_extensions_Run_list_forward(rtems_task_start, \
- (_Thread_Executing, _the_thread) )
-
-/*PAGE
- *
- * _User_extensions_Task_restart
- *
- */
-
-#define _User_extensions_Task_restart( _the_thread ) \
- _User_extensions_Run_list_forward(rtems_task_restart,\
- (_Thread_Executing, _the_thread) )
-
-/*PAGE
- *
- * _User_extensions_Task_switch
- *
- */
-
-#define _User_extensions_Task_switch( _executing, _heir ) \
- _User_extensions_Run_list_forward(task_switch, (_executing, _heir) )
-
-/*PAGE
- *
- * _User_extensions_Task_begin
- *
- */
-
-#define _User_extensions_Task_begin( _executing ) \
- _User_extensions_Run_list_forward(task_begin, (_executing) )
-
-/*PAGE
- *
- * _User_extensions_Task_exitted
+ * _User_extensions_Thread_switch
*
*/
-#define _User_extensions_Task_exitted( _executing ) \
- _User_extensions_Run_list_backward(task_exitted, (_executing) )
+#define _User_extensions_Thread_switch( _executing, _heir ) \
+ _User_extensions_Run_list_forward(thread_switch, (_executing, _heir) )
/*PAGE
*
- * _User_extensions_Fatal
+ * _User_extensions_Thread_post_switch
*
*/
-#define _User_extensions_Fatal( _the_error ) \
- _User_extensions_Run_list_backward(fatal, (_the_error) )
+#define _User_extensions_Thread_post_switch( _executing ) \
+ _User_extensions_Run_list_forward(thread_post_switch, (_executing) )
#endif
/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/watchdog.inl b/c/src/exec/score/macros/rtems/score/watchdog.inl
index 4e965420ce..15023722c6 100644
--- a/c/src/exec/score/macros/rtems/score/watchdog.inl
+++ b/c/src/exec/score/macros/rtems/score/watchdog.inl
@@ -17,7 +17,7 @@
#ifndef __WATCHDOG_inl
#define __WATCHDOG_inl
-#include <rtems/object.h>
+#include <rtems/core/object.h>
/*PAGE
*
diff --git a/c/src/exec/score/macros/rtems/score/wkspace.inl b/c/src/exec/score/macros/rtems/score/wkspace.inl
index 1139e188db..aa6ccc0440 100644
--- a/c/src/exec/score/macros/rtems/score/wkspace.inl
+++ b/c/src/exec/score/macros/rtems/score/wkspace.inl
@@ -1,7 +1,7 @@
/* wkspace.inl
*
* This file contains the macro implementation of the inlined routines
- * from the RTEMS RAM Workspace Handler.
+ * from the RAM Workspace Handler.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
@@ -17,10 +17,6 @@
#ifndef __WORKSPACE_inl
#define __WORKSPACE_inl
-#include <rtems/heap.h>
-#include <rtems/fatal.h>
-#include <rtems/status.h>
-
/*PAGE
*
* _Workspace_Handler_initialization
@@ -33,9 +29,12 @@
unsigned32 index; \
unsigned32 memory_available; \
\
- if ( ((_starting_address) == NULL) || \
- !_Addresses_Is_aligned( (_starting_address) ) ) \
- rtems_fatal_error_occurred( RTEMS_INVALID_ADDRESS ); \
+ if ( !(_starting_address) || !_Addresses_Is_aligned( (_starting_address) ) ) \
+ _Internal_error_Occurred( \
+ INTERNAL_ERROR_CORE, \
+ TRUE, \
+ INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS \
+ ); \
\
if ( _CPU_Table.do_zero_of_workspace ) { \
for( zero_out_array = (unsigned32 *) (_starting_address), index = 0 ; \
@@ -52,7 +51,11 @@
); \
\
if ( memory_available == 0 ) \
- rtems_fatal_error_occurred( RTEMS_UNSATISFIED ); \
+ _Internal_error_Occurred( \
+ INTERNAL_ERROR_CORE, \
+ TRUE, \
+ INTERNAL_ERROR_TOO_LITTLE_WORKSPACE \
+ ); \
}
/*PAGE