mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-25 07:40:53 +08:00
2008-12-21 Joel Sherrill <joel.sherrill@oarcorp.com>
* score/inline/rtems/score/object.inl, score/src/objectgetbyindex.c: Fix issues when using 16-bit object Ids.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2008-12-21 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* score/inline/rtems/score/object.inl, score/src/objectgetbyindex.c:
|
||||
Fix issues when using 16-bit object Ids.
|
||||
|
||||
2008-12-19 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* itron/include/itronsys/types.h: Derive ITRON ID type from Objects_Id
|
||||
|
||||
@@ -45,7 +45,9 @@ RTEMS_INLINE_ROUTINE Objects_Id _Objects_Build_id(
|
||||
{
|
||||
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
|
||||
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
|
||||
(( (Objects_Id) node ) << OBJECTS_NODE_START_BIT) |
|
||||
#if !defined(RTEMS_USE_16_BIT_OBJECT)
|
||||
(( (Objects_Id) node ) << OBJECTS_NODE_START_BIT) |
|
||||
#endif
|
||||
(( (Objects_Id) index ) << OBJECTS_INDEX_START_BIT);
|
||||
}
|
||||
|
||||
@@ -87,7 +89,15 @@ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_node(
|
||||
Objects_Id id
|
||||
)
|
||||
{
|
||||
return (id >> OBJECTS_NODE_START_BIT) & OBJECTS_NODE_VALID_BITS;
|
||||
/*
|
||||
* If using 16-bit Ids, then there is no node field and it MUST
|
||||
* be a single processor system.
|
||||
*/
|
||||
#if defined(RTEMS_USE_16_BIT_OBJECT)
|
||||
return 1;
|
||||
#else
|
||||
return (id >> OBJECTS_NODE_START_BIT) & OBJECTS_NODE_VALID_BITS;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -50,11 +50,14 @@
|
||||
|
||||
Objects_Control *_Objects_Get_by_index(
|
||||
Objects_Information *information,
|
||||
uint32_t index,
|
||||
Objects_Id id,
|
||||
Objects_Locations *location
|
||||
)
|
||||
{
|
||||
Objects_Control *the_object;
|
||||
uint16_t index;
|
||||
|
||||
index = _Objects_Get_index( id );
|
||||
|
||||
if ( information->maximum >= index ) {
|
||||
_Thread_Disable_dispatch();
|
||||
|
||||
Reference in New Issue
Block a user