some questions and bugs about the super core:

doclzs doclzs at 163.com
Tue Feb 24 16:06:32 UTC 2004


Hi, here are some questions i have not understood
well:

(1)address.inl

RTEMS_INLINE_ROUTINE unsigned32 _Addresses_Subtract (
  void *left,
  void *right
)
{
  return ((char *) left - (char *) right);
}

RTEMS_INLINE_ROUTINE boolean _Addresses_Is_in_range (
  void *address,
  void *base,
  void *limit
)
{
  return ( address >= base && address <= limit );
}

question: 
in function "_Addresses_Subtract",the address
is converted into type (char*) but in function
"_Addresses_Is_in_range" not. why?

(2)bitfield.h

#define _Bitfield_Find_first_bit( _value, _bit_number ) \
  { \
    register unsigned32 __value = (unsigned32) (_value); \
    register const unsigned char *__p = __log2table; \
    \
    if ( __value < 0x100 ) \
      (_bit_number) = __p[ __value ] + 8; \
    else \
      (_bit_number) = __p[ __value >> 8 ]; \
  }

bug: 
register unsigned32 __value = (unsigned32) (_value); \
i think should be
register unsigned16 __value = (unsigned16) (_value); 

(3)coremsg.h

typedef struct {
    unsigned32  size;
    unsigned32  buffer[1];
} CORE_message_queue_Buffer;

question:
typedef struct {
    unsigned32  size;
    unsigned32  *buffer;
} CORE_message_queue_Buffer;
is it right?

(4)heapallocate.c

...
if ( size >= (-1 - HEAP_BLOCK_USED_OVERHEAD) )
    return( NULL );
excess   = size % the_heap->page_size;
the_size = size + the_heap->page_size + HEAP_BLOCK_USED_OVERHEAD;
...

bug:
"size >= (-1 - HEAP_BLOCK_USED_OVERHEAD)",it is sure,right?
"the_size = size + the_heap->page_size + HEAP_BLOCK_USED_OVERHEAD",
i think it should be
"the_size = size + HEAP_BLOCK_USED_OVERHEAD"

(5)heapfree.c  line 55

next_block = _Heap_Block_at( the_block, the_size );

bug:
it should be

next_block = _Heap_Next_block( the_block );

(6)priority.h  line 61

SCORE_EXTERN Priority_Bit_map_control 
               _Priority_Bit_map[16] CPU_STRUCTURE_ALIGNMENT;

bug:
it should be

SCORE_EXTERN Priority_Bit_map_control _Priority_Bit_map[16];

(7)

the control block used to manage each watchdog timer
as follows:

typedef struct {
  Chain_Node                      Node;
  Watchdog_States                 state;
  Watchdog_Interval               initial;
  Watchdog_Interval               delta_interval;
  Watchdog_Interval               start_time;
  Watchdog_Interval               stop_time;
  Watchdog_Service_routine_entry  routine;
  Objects_Id                      id;
  void                           *user_data;
}   Watchdog_Control;

question:
what is meaning of the variable "initial",
"delta_interval", "start_time" and "stop_time"?
what is the relation between
a watchdog's position on the chain and
the variable "delta_interval"?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
网易VIP收费邮箱两周年超值优惠! 满1赠6!!           http://vip.163.com

中国最大的免费邮箱在等你 25兆空间4兆附件!      http://mail.163.com

点击网易泡泡惊喜无限 全免费手机短信任你发!      http://popo.163.com


More information about the users mailing list