irqserver in rtems master version and libbsd

葡萄 29171383 at qq.com
Sun Jul 3 11:11:04 UTC 2016


I migrate from rtems 4.11 and libbsd 4.11 to rtems git head and libbsd git head, I find when I start up my application ,system crashed,  the crash point when use rtems irq services, I track code, find when libbsd use rtems irq service ,the system crash, in rtems/c/src/lib/libbsp/shared/src/irq_service.c

static rtems_status_code bsp_interrupt_server_call_helper(
  rtems_vector_number vector,
  rtems_option options,
  rtems_interrupt_handler handler,
  void *arg,
  void (*helper)(void *)
)
{
  bsp_interrupt_server_helper_data hd = {
    .vector = vector,
    .options = options,
    .handler = handler,
    .arg = arg,
    .task = rtems_task_self()
  };
  bsp_interrupt_server_action a = {
    .handler = helper,
    .arg = &hd
  };
  bsp_interrupt_server_entry e = {
    .vector = BSP_INTERRUPT_VECTOR_MAX + 1,
    .actions = &a
  };
 /* this line confuse me*/
  bsp_interrupt_server_trigger(&e);
  rtems_event_transient_receive(RTEMS_WAIT, RTEMS_NO_TIMEOUT);


  return hd.sc;
}



static void bsp_interrupt_server_trigger(void *arg)
{
  rtems_interrupt_lock_context lock_context;
  bsp_interrupt_server_entry *e = arg;


  bsp_interrupt_vector_disable(e->vector);


  rtems_interrupt_lock_acquire(&bsp_interrupt_server_lock, &lock_context);


  if (rtems_chain_is_node_off_chain(&e->node)) {
    rtems_chain_append_unprotected(&bsp_interrupt_server_chain, &e->node);
  } else {
    ++bsp_interrupt_server_errors;
  }


  rtems_interrupt_lock_release(&bsp_interrupt_server_lock, &lock_context);


  rtems_event_system_send(bsp_interrupt_server_id, RTEMS_EVENT_SYSTEM_SERVER);
}





in  /*this line confuse me*/
1. in bsp_interrupt_server_trigger functon , bsp_interrupt_vector_disable(e->vector) often provided by bsp,in many bsp code,operation hardware register direct,the but the e->vector num is BSP_INTERRUPT_VECTOR_MAX + 1,not vertor in parmeter
2. e is store in stack, but rtems_chain_is_node_off_chain(&e->node)  used??


another question, I find the head version of libbsd and head version of rtems will crash when use bsd command  ,just bsd commond to list all bsd thread and irq, ifconfig  netstate ping work fine




regards
yao0718
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20160703/8c56584d/attachment.html>


More information about the users mailing list