Changeset e7ee719f in rtems


Ignore:
Timestamp:
Jul 11, 2017, 6:25:09 AM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
a961e198
Parents:
ecabd384
git-author:
Sebastian Huber <sebastian.huber@…> (07/11/17 06:25:09)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/12/17 05:46:40)
Message:

Create one interrupt server per processor

This allows load balancing of interrupt processing in SMP
configurations.

Update #3071.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/shared/src/irq-server.c

    recabd384 re7ee719f  
    3131#define BSP_INTERRUPT_SERVER_MANAGEMENT_VECTOR (BSP_INTERRUPT_VECTOR_MAX + 1)
    3232
    33 RTEMS_INTERRUPT_LOCK_DEFINE(
    34   static,
    35   bsp_interrupt_server_lock,
    36   "Interrupt Server"
    37 )
    38 
    39 static rtems_id bsp_interrupt_server_id = RTEMS_ID_NONE;
    40 
    41 static RTEMS_CHAIN_DEFINE_EMPTY(bsp_interrupt_server_chain);
    42 
    43 static rtems_status_code bsp_interrupt_server_is_initialized(void)
    44 {
    45   if (bsp_interrupt_server_id != RTEMS_ID_NONE) {
    46     return RTEMS_SUCCESSFUL;
    47   } else {
    48     return RTEMS_INCORRECT_STATE;
    49   }
    50 }
    51 
    52 static unsigned bsp_interrupt_server_errors;
     33typedef struct {
     34  RTEMS_INTERRUPT_LOCK_MEMBER(lock);
     35  rtems_chain_control entries;
     36  rtems_id server;
     37  unsigned errors;
     38} bsp_interrupt_server_context;
     39
     40#if defined(RTEMS_SMP)
     41static bsp_interrupt_server_context *bsp_interrupt_server_instances;
     42#else
     43static bsp_interrupt_server_context bsp_interrupt_server_instance;
     44#endif
     45
     46static bsp_interrupt_server_context *bsp_interrupt_server_get_context(
     47  uint32_t server_index,
     48  rtems_status_code *sc
     49)
     50{
     51#if defined(RTEMS_SMP)
     52  if (bsp_interrupt_server_instances == NULL) {
     53    *sc = RTEMS_INCORRECT_STATE;
     54    return NULL;
     55  }
     56#else
     57  if (bsp_interrupt_server_instance.server == RTEMS_ID_NONE) {
     58    *sc = RTEMS_INCORRECT_STATE;
     59    return NULL;
     60  }
     61#endif
     62
     63  if (server_index >= rtems_get_processor_count()) {
     64    *sc = RTEMS_INVALID_ID;
     65    return NULL;
     66  }
     67
     68  *sc = RTEMS_SUCCESSFUL;
     69#if defined(RTEMS_SMP)
     70  return &bsp_interrupt_server_instances[server_index];
     71#else
     72  return &bsp_interrupt_server_instance;
     73#endif
     74}
    5375
    5476static void bsp_interrupt_server_trigger(void *arg)
     
    5678  rtems_interrupt_lock_context lock_context;
    5779  rtems_interrupt_server_entry *e = arg;
     80  bsp_interrupt_server_context *s = e->server;
    5881
    5982  if (bsp_interrupt_is_valid_vector(e->vector)) {
     
    6184  }
    6285
    63   rtems_interrupt_lock_acquire(&bsp_interrupt_server_lock, &lock_context);
     86  rtems_interrupt_lock_acquire(&s->lock, &lock_context);
    6487
    6588  if (rtems_chain_is_node_off_chain(&e->node)) {
    66     rtems_chain_append_unprotected(&bsp_interrupt_server_chain, &e->node);
     89    rtems_chain_append_unprotected(&s->entries, &e->node);
    6790  } else {
    68     ++bsp_interrupt_server_errors;
    69   }
    70 
    71   rtems_interrupt_lock_release(&bsp_interrupt_server_lock, &lock_context);
    72 
    73   rtems_event_system_send(bsp_interrupt_server_id, RTEMS_EVENT_SYSTEM_SERVER);
     91    ++s->errors;
     92  }
     93
     94  rtems_interrupt_lock_release(&s->lock, &lock_context);
     95
     96  rtems_event_system_send(s->server, RTEMS_EVENT_SYSTEM_SERVER);
    7497}
    7598
     
    115138
    116139typedef struct {
     140  bsp_interrupt_server_context *server;
    117141  rtems_vector_number vector;
    118142  rtems_option options;
     
    147171    e = calloc(1, sizeof(*e));
    148172    if (e != NULL) {
     173      e->server = hd->server;
    149174      e->vector = hd->vector;
    150175      e->actions = a;
     
    163188      sc = RTEMS_NO_MEMORY;
    164189    }
     190#if defined(RTEMS_SMP)
     191  } else if (e->server != hd->server) {
     192    sc = RTEMS_RESOURCE_IN_USE;
     193#endif
    165194  } else if (
    166195    RTEMS_INTERRUPT_IS_UNIQUE(hd->options)
     
    253282
    254283static rtems_status_code bsp_interrupt_server_call_helper(
     284  bsp_interrupt_server_context *s,
    255285  rtems_vector_number vector,
    256286  rtems_option options,
     
    261291{
    262292  bsp_interrupt_server_helper_data hd = {
     293    .server = s,
    263294    .vector = vector,
    264295    .options = options,
     
    272303  };
    273304  rtems_interrupt_server_entry e = {
     305    .server = s,
    274306    .vector = BSP_INTERRUPT_SERVER_MANAGEMENT_VECTOR,
    275307    .actions = &a
     
    282314}
    283315
    284 static rtems_interrupt_server_entry *bsp_interrupt_server_get_entry(void)
     316static rtems_interrupt_server_entry *bsp_interrupt_server_get_entry(
     317  bsp_interrupt_server_context *s
     318)
    285319{
    286320  rtems_interrupt_lock_context lock_context;
    287321  rtems_interrupt_server_entry *e;
    288   rtems_chain_control *chain;
    289 
    290   rtems_interrupt_lock_acquire(&bsp_interrupt_server_lock, &lock_context);
    291   chain = &bsp_interrupt_server_chain;
    292 
    293   if (!rtems_chain_is_empty(chain)) {
     322
     323  rtems_interrupt_lock_acquire(&s->lock, &lock_context);
     324
     325  if (!rtems_chain_is_empty(&s->entries)) {
    294326    e = (rtems_interrupt_server_entry *)
    295       rtems_chain_get_first_unprotected(chain);
     327      rtems_chain_get_first_unprotected(&s->entries);
    296328    rtems_chain_set_off_chain(&e->node);
    297329  } else {
     
    299331  }
    300332
    301   rtems_interrupt_lock_release(&bsp_interrupt_server_lock, &lock_context);
     333  rtems_interrupt_lock_release(&s->lock, &lock_context);
    302334
    303335  return e;
     
    306338static void bsp_interrupt_server_task(rtems_task_argument arg)
    307339{
     340  bsp_interrupt_server_context *s = (bsp_interrupt_server_context *) arg;
     341
    308342  while (true) {
    309343    rtems_event_set events;
     
    317351    );
    318352
    319     while ((e = bsp_interrupt_server_get_entry()) != NULL) {
     353    while ((e = bsp_interrupt_server_get_entry(s)) != NULL) {
    320354      rtems_interrupt_server_action *action = e->actions;
    321355      rtems_vector_number vector = e->vector;
     
    335369
    336370rtems_status_code rtems_interrupt_server_handler_install(
    337   rtems_id server,
     371  uint32_t server_index,
    338372  rtems_vector_number vector,
    339373  const char *info,
     
    344378{
    345379  rtems_status_code sc;
    346 
    347   sc = bsp_interrupt_server_is_initialized();
    348   if (sc != RTEMS_SUCCESSFUL) {
     380  bsp_interrupt_server_context *s;
     381
     382  s = bsp_interrupt_server_get_context(server_index, &sc);
     383  if (s == NULL) {
    349384    return sc;
    350385  }
    351386
    352   if (server != RTEMS_ID_NONE) {
    353     return RTEMS_NOT_IMPLEMENTED;
    354   }
    355 
    356387  return bsp_interrupt_server_call_helper(
     388    s,
    357389    vector,
    358390    options,
     
    364396
    365397rtems_status_code rtems_interrupt_server_handler_remove(
    366   rtems_id server,
     398  uint32_t server_index,
    367399  rtems_vector_number vector,
    368400  rtems_interrupt_handler handler,
     
    371403{
    372404  rtems_status_code sc;
    373 
    374   sc = bsp_interrupt_server_is_initialized();
    375   if (sc != RTEMS_SUCCESSFUL) {
     405  bsp_interrupt_server_context *s;
     406
     407  s = bsp_interrupt_server_get_context(server_index, &sc);
     408  if (s == NULL) {
    376409    return sc;
    377410  }
    378411
    379   if (server != RTEMS_ID_NONE) {
    380     return RTEMS_NOT_IMPLEMENTED;
    381   }
    382 
    383412  return bsp_interrupt_server_call_helper(
     413    s,
    384414    vector,
    385415    0,
     
    427457
    428458rtems_status_code rtems_interrupt_server_handler_iterate(
    429   rtems_id server,
     459  uint32_t server_index,
    430460  rtems_vector_number vector,
    431461  rtems_interrupt_per_handler_routine routine,
     
    435465  rtems_status_code sc;
    436466  bsp_interrupt_server_handler_iterate_helper_data hihd;
    437 
    438   sc = bsp_interrupt_server_is_initialized();
    439   if (sc != RTEMS_SUCCESSFUL) {
     467  bsp_interrupt_server_context *s;
     468
     469  s = bsp_interrupt_server_get_context(server_index, &sc);
     470  if (s == NULL) {
    440471    return sc;
    441   }
    442 
    443   if (server != RTEMS_ID_NONE) {
    444     return RTEMS_NOT_IMPLEMENTED;
    445472  }
    446473
     
    452479  hihd.arg = arg;
    453480  return bsp_interrupt_server_call_helper(
     481    s,
    454482    vector,
    455483    0,
     
    465493  rtems_mode modes,
    466494  rtems_attribute attributes,
    467   rtems_id *server
    468 )
    469 {
    470   rtems_status_code sc = RTEMS_SUCCESSFUL;
    471 
    472   if (server != NULL) {
    473     return RTEMS_NOT_IMPLEMENTED;
    474   }
    475 
    476   sc = rtems_task_create(
    477     rtems_build_name('I', 'R', 'Q', 'S'),
    478     priority,
    479     stack_size,
    480     modes,
    481     attributes,
    482     &bsp_interrupt_server_id
    483   );
    484   if (sc != RTEMS_SUCCESSFUL) {
    485     return RTEMS_TOO_MANY;
    486   }
    487 
    488   sc = rtems_task_start(
    489     bsp_interrupt_server_id,
    490     bsp_interrupt_server_task,
    491     0
    492   );
    493   _Assert(sc == RTEMS_SUCCESSFUL);
     495  uint32_t *server_count
     496)
     497{
     498  uint32_t cpu_index;
     499  uint32_t cpu_count;
     500  uint32_t dummy;
     501  bsp_interrupt_server_context *instances;
     502
     503  if (server_count == NULL) {
     504    server_count = &dummy;
     505  }
     506
     507  cpu_count = rtems_get_processor_count();
     508
     509#if defined(RTEMS_SMP)
     510  instances = calloc(cpu_count, sizeof(*instances));
     511  if (instances == NULL) {
     512    return RTEMS_NO_MEMORY;
     513  }
     514#else
     515  instances = &bsp_interrupt_server_instance;
     516#endif
     517
     518  for (cpu_index = 0; cpu_index < cpu_count; ++cpu_index) {
     519    bsp_interrupt_server_context *s = &instances[cpu_index];
     520    rtems_status_code sc;
     521#if defined(RTEMS_SMP)
     522    rtems_id scheduler;
     523    cpu_set_t cpu;
     524#endif
     525
     526    rtems_interrupt_lock_initialize(&s->lock, "Interrupt Server");
     527    rtems_chain_initialize_empty(&s->entries);
     528
     529    sc = rtems_task_create(
     530      rtems_build_name('I', 'R', 'Q', 'S'),
     531      priority,
     532      stack_size,
     533      modes,
     534      attributes,
     535      &s->server
     536    );
     537    if (sc != RTEMS_SUCCESSFUL) {
     538      *server_count = cpu_index;
     539
     540#if defined(RTEMS_SMP)
     541      if (cpu_index > 0) {
     542        return RTEMS_SUCCESSFUL;
     543      }
     544
     545      free(instances);
     546#endif
     547
     548      return RTEMS_TOO_MANY;
     549    }
     550
     551#if defined(RTEMS_SMP)
     552    sc = rtems_scheduler_ident_by_processor(cpu_index, &scheduler);
     553    _Assert(sc == RTEMS_SUCCESSFUL);
     554
     555    sc = rtems_task_set_scheduler(s->server, scheduler, priority);
     556    _Assert(sc == RTEMS_SUCCESSFUL);
     557
     558    CPU_ZERO(&cpu);
     559    CPU_SET(cpu_index, &cpu);
     560    sc = rtems_task_set_affinity(s->server, sizeof(cpu), &cpu);
     561    _Assert(sc == RTEMS_SUCCESSFUL);
     562#endif
     563
     564    sc = rtems_task_start(
     565      s->server,
     566      bsp_interrupt_server_task,
     567      (rtems_task_argument) s
     568    );
     569    _Assert(sc == RTEMS_SUCCESSFUL);
     570  }
     571
     572#if defined(RTEMS_SMP)
     573  bsp_interrupt_server_instances = instances;
     574#endif
     575  *server_count = cpu_index;
    494576
    495577  return RTEMS_SUCCESSFUL;
     
    497579
    498580static void bsp_interrupt_server_entry_initialize(
    499   rtems_interrupt_server_entry *entry
     581  rtems_interrupt_server_entry *entry,
     582  bsp_interrupt_server_context *s
    500583)
    501584{
    502585  rtems_chain_set_off_chain(&entry->node);
     586  entry->server = s;
    503587  entry->vector = BSP_INTERRUPT_SERVER_MANAGEMENT_VECTOR;
    504588  entry->actions = NULL;
     
    518602}
    519603
    520 void rtems_interrupt_server_entry_initialize(
     604rtems_status_code rtems_interrupt_server_entry_initialize(
     605  uint32_t                      server_index,
    521606  rtems_interrupt_server_entry *entry
    522607)
    523608{
    524   bsp_interrupt_server_entry_initialize(entry);
     609  rtems_status_code sc;
     610  bsp_interrupt_server_context *s;
     611
     612  s = bsp_interrupt_server_get_context(server_index, &sc);
     613  if (s == NULL) {
     614    return sc;
     615  }
     616
     617  bsp_interrupt_server_entry_initialize(entry, s);
     618  return RTEMS_SUCCESSFUL;
    525619}
    526620
     
    536630
    537631void rtems_interrupt_server_entry_submit(
    538   rtems_id                      server,
    539632  rtems_interrupt_server_entry *entry
    540633)
     
    551644
    552645void rtems_interrupt_server_entry_destroy(
    553   rtems_id                      server,
    554646  rtems_interrupt_server_entry *entry
    555647)
    556648{
     649  bsp_interrupt_server_context *s;
    557650  rtems_interrupt_lock_context lock_context;
    558651
    559   rtems_interrupt_lock_acquire(&bsp_interrupt_server_lock, &lock_context);
     652  s = entry->server;
     653  rtems_interrupt_lock_acquire(&s->lock, &lock_context);
    560654
    561655  if (!rtems_chain_is_node_off_chain(&entry->node)) {
     
    564658  }
    565659
    566   rtems_interrupt_lock_release(&bsp_interrupt_server_lock, &lock_context);
     660  rtems_interrupt_lock_release(&s->lock, &lock_context);
    567661
    568662  bsp_interrupt_server_call_helper(
     663    s,
    569664    BSP_INTERRUPT_SERVER_MANAGEMENT_VECTOR,
    570665    0,
     
    575670}
    576671
    577 void rtems_interrupt_server_request_initialize(
     672rtems_status_code rtems_interrupt_server_request_initialize(
     673  uint32_t                        server_index,
    578674  rtems_interrupt_server_request *request,
    579675  rtems_interrupt_handler         handler,
     
    581677)
    582678{
    583   bsp_interrupt_server_entry_initialize(&request->entry);
     679  rtems_status_code sc;
     680  bsp_interrupt_server_context *s;
     681
     682  s = bsp_interrupt_server_get_context(server_index, &sc);
     683  if (s == NULL) {
     684    return sc;
     685  }
     686
     687  bsp_interrupt_server_entry_initialize(&request->entry, s);
    584688  bsp_interrupt_server_action_prepend(
    585689    &request->entry,
     
    588692    arg
    589693  );
    590 }
     694  return RTEMS_SUCCESSFUL;
     695}
  • cpukit/include/rtems/irq-extension.h

    recabd384 re7ee719f  
    117117 * This function may block.
    118118 *
    119  * @retval RTEMS_SUCCESSFUL Shall be returned in case of success.
     119 * @retval RTEMS_SUCCESSFUL Successful operation.
    120120 * @retval RTEMS_CALLED_FROM_ISR If this function is called from interrupt
    121121 * context this shall be returned.
     
    150150 * This function may block.
    151151 *
    152  * @retval RTEMS_SUCCESSFUL Shall be returned in case of success.
     152 * @retval RTEMS_SUCCESSFUL Successful operation.
    153153 * @retval RTEMS_CALLED_FROM_ISR If this function is called from interrupt
    154154 * context this shall be returned.
     
    190190 * within the iteration routine.  This may result in a deadlock.
    191191 *
    192  * @retval RTEMS_SUCCESSFUL Shall be returned in case of success.
     192 * @retval RTEMS_SUCCESSFUL Successful operation.
    193193 * @retval RTEMS_CALLED_FROM_ISR If this function is called from interrupt
    194194 * context this shall be returned.
     
    219219
    220220/**
     221 * @brief The interrupt server index of the default interrupt server.
     222 */
     223#define RTEMS_INTERRUPT_SERVER_DEFAULT 0
     224
     225/**
    221226 * @brief An interrupt server entry.
    222227 *
     
    231236typedef struct {
    232237  rtems_chain_node               node;
     238  void                          *server;
    233239  rtems_vector_number            vector;
    234240  rtems_interrupt_server_action *actions;
     
    251257
    252258/**
    253  * @brief Initializes an interrupt server task.
    254  *
    255  * The task will have the priority @a priority, the stack size @a stack_size,
    256  * the modes @a modes and the attributes @a attributes.  The identifier of the
    257  * server task will be returned in @a server.  Interrupt handlers can be
    258  * installed on the server with rtems_interrupt_server_handler_install() and
    259  * removed with rtems_interrupt_server_handler_remove() using this identifier.
    260  * In case of an interrupt the request will be forwarded to the server.  The
    261  * handlers are executed within the server context.  If one handler blocks on
    262  * something this may delay the processing of other handlers.
    263  *
    264  * The server identifier pointer @a server may be @a NULL to initialize the
    265  * default server.
     259 * @brief Initializes the interrupt server tasks.
     260 *
     261 * This function tries to create an interrupt server task for each processor in
     262 * the system.  The tasks will have the priority @a priority, the stack size @a
     263 * stack_size, the modes @a modes and the attributes @a attributes.  The count
     264 * of server tasks will be returned in @a server_count.  Interrupt handlers can
     265 * be installed on an interrupt server with
     266 * rtems_interrupt_server_handler_install() and removed with
     267 * rtems_interrupt_server_handler_remove() using a server index.  In case of an
     268 * interrupt, the request will be forwarded to the interrupt server.  The
     269 * handlers are executed within the interrupt server context.  If one handler
     270 * blocks on something this may delay the processing of other handlers.
     271 *
     272 * The server count pointer @a server_count may be @a NULL.
    266273 *
    267274 * This function may block.
     
    269276 * @see rtems_task_create().
    270277 *
    271  * @retval RTEMS_SUCCESSFUL Shall be returned in case of success.
    272  * @retval RTEMS_INCORRECT_STATE If the default server is already initialized
    273  * this shall be returned.
    274  * @retval RTEMS_TOO_MANY No free task available to create the server task.
     278 * @retval RTEMS_SUCCESSFUL Successful operation.
     279 * @retval RTEMS_INCORRECT_STATE The interrupt servers are not initialized.
     280 * @retval RTEMS_NO_MEMORY Not enough memory.
     281 * @retval RTEMS_TOO_MANY No free task available to create at least one server task.
    275282 * @retval RTEMS_UNSATISFIED Task stack size too large.
    276283 * @retval RTEMS_INVALID_PRIORITY Invalid task priority.
     
    281288  rtems_mode modes,
    282289  rtems_attribute attributes,
    283   rtems_id *server
     290  uint32_t *server_count
    284291);
    285292
     
    289296 *
    290297 * The handler routine will be executed on the corresponding interrupt server
    291  * task.  A server identifier @a server of @c RTEMS_ID_NONE may be used to
    292  * install the handler on the default server.
     298 * task.  A server index @a server_index of @c RTEMS_INTERRUPT_SERVER_DEFAULT
     299 * may be used to install the handler on the default server.
    293300 *
    294301 * This function may block.
     
    296303 * @see rtems_interrupt_handler_install().
    297304 *
    298  * @retval RTEMS_SUCCESSFUL Shall be returned in case of success.
    299  * @retval RTEMS_INCORRECT_STATE If the interrupt handler server is not
    300  * initialized this shall be returned.
     305 * @retval RTEMS_SUCCESSFUL Successful operation.
     306 * @retval RTEMS_INCORRECT_STATE The interrupt servers are not initialized.
     307 * @retval RTEMS_INVALID_ID If the interrupt server index is invalid.
    301308 * @retval * For other errors see rtems_interrupt_handler_install().
    302309 */
    303310rtems_status_code rtems_interrupt_server_handler_install(
    304   rtems_id server,
     311  uint32_t server_index,
    305312  rtems_vector_number vector,
    306313  const char *info,
     
    314321 * for the interrupt vector with number @a vector from the server @a server.
    315322 *
    316  * A server identifier @a server of @c RTEMS_ID_NONE may be used to remove the
    317  * handler from the default server.
     323 * A server index @a server_index of @c RTEMS_INTERRUPT_SERVER_DEFAULT may be
     324 * used to remove the handler from the default server.
    318325 *
    319326 * This function may block.
     
    321328 * @see rtems_interrupt_handler_remove().
    322329 *
    323  * @retval RTEMS_SUCCESSFUL Shall be returned in case of success.
    324  * @retval RTEMS_INCORRECT_STATE If the interrupt handler server is not
    325  * initialized this shall be returned.
     330 * @retval RTEMS_SUCCESSFUL Successful operation.
     331 * @retval RTEMS_INCORRECT_STATE The interrupt servers are not initialized.
     332 * @retval RTEMS_INVALID_ID If the interrupt server index is invalid.
    326333 * @retval * For other errors see rtems_interrupt_handler_remove().
    327334 */
    328335rtems_status_code rtems_interrupt_server_handler_remove(
    329   rtems_id server,
     336  uint32_t server_index,
    330337  rtems_vector_number vector,
    331338  rtems_interrupt_handler handler,
     
    338345 * @a server.
    339346 *
    340  * A server identifier @a server of @c RTEMS_ID_NONE may be used to specify the
    341  * default server.
     347 * A server index @a server_index of @c RTEMS_INTERRUPT_SERVER_DEFAULT may be
     348 * used to specify the default server.
    342349 *
    343350 * @see rtems_interrupt_handler_iterate()
    344351 *
    345  * @retval RTEMS_SUCCESSFUL Shall be returned in case of success.
    346  * @retval RTEMS_INCORRECT_STATE If the interrupt handler server is not
    347  * initialized this shall be returned.
     352 * @retval RTEMS_SUCCESSFUL Successful operation.
     353 * @retval RTEMS_INCORRECT_STATE The interrupt servers are not initialized.
     354 * @retval RTEMS_INVALID_ID If the interrupt server index is invalid.
    348355 * @retval * For other errors see rtems_interrupt_handler_iterate().
    349356 */
    350357rtems_status_code rtems_interrupt_server_handler_iterate(
    351   rtems_id server,
     358  uint32_t server_index,
    352359  rtems_vector_number vector,
    353360  rtems_interrupt_per_handler_routine routine,
     
    358365 * @brief Initializes the specified interrupt server entry.
    359366 *
     367 * @param[in] server_index The interrupt server index.  Use
     368 *   @c RTEMS_INTERRUPT_SERVER_DEFAULT to specify the default server.
    360369 * @param[in] entry The interrupt server entry to initialize.
    361370 *
    362371 * @see rtems_interrupt_server_action_prepend().
    363  */
    364 void rtems_interrupt_server_entry_initialize(
     372 *
     373 * @retval RTEMS_SUCCESSFUL Successful operation.
     374 * @retval RTEMS_INCORRECT_STATE The interrupt servers are not initialized.
     375 * @retval RTEMS_INVALID_ID If the interrupt server index is invalid.
     376 */
     377rtems_status_code rtems_interrupt_server_entry_initialize(
     378  uint32_t                      server_index,
    365379  rtems_interrupt_server_entry *entry
    366380);
     
    398412 * block.  No error checking is performed.
    399413 *
    400  * @param[in] server The server identifier.  Use @c RTEMS_ID_NONE to specify
    401  *   the default server.
    402414 * @param[in] entry The interrupt server entry must be initialized before the
    403415 *   first call to this function via rtems_interrupt_server_entry_initialize()
     
    407419 */
    408420void rtems_interrupt_server_entry_submit(
    409   rtems_id                      server,
    410421  rtems_interrupt_server_entry *entry
    411422);
     
    414425 * @brief Destroys the specified interrupt server entry.
    415426 *
    416  * This function must be called from thread context.  It may block.  No error
    417  * checking is performed.
    418  *
    419  * @param[in] server The server identifier.  Use @c RTEMS_ID_NONE to specify
    420  *   the default server.
     427 * This function must be called from thread context.  It may block.  Calling
     428 * this function within the context of an interrupt server is undefined
     429 * behaviour.  No error checking is performed.
     430 *
     431 * @param[in] server_index The interrupt server index.  Use
     432 *   @c RTEMS_INTERRUPT_SERVER_DEFAULT to specify the default server.
    421433 * @param[in] entry The interrupt server entry to destroy.  It must have been
    422434 *   initialized via rtems_interrupt_server_entry_initialize().
    423435 */
    424436void rtems_interrupt_server_entry_destroy(
    425   rtems_id                      server,
    426437  rtems_interrupt_server_entry *entry
    427438);
     
    430441 * @brief Initializes the specified interrupt server request.
    431442 *
    432  * No error checking is performed.
    433  *
     443 * @param[in] server_index The interrupt server index.  Use
     444 *   @c RTEMS_INTERRUPT_SERVER_DEFAULT to specify the default server.
    434445 * @param[in] request The interrupt server request to initialize.
    435446 * @param[in] handler The interrupt handler for the request action.
    436447 * @param[in] arg The interrupt handler argument for the request action.
    437  */
    438 void rtems_interrupt_server_request_initialize(
     448 *
     449 * @retval RTEMS_SUCCESSFUL Successful operation.
     450 * @retval RTEMS_INCORRECT_STATE The interrupt servers are not initialized.
     451 * @retval RTEMS_INVALID_ID If the interrupt server index is invalid.
     452 */
     453rtems_status_code rtems_interrupt_server_request_initialize(
     454  uint32_t                        server_index,
    439455  rtems_interrupt_server_request *request,
    440456  rtems_interrupt_handler         handler,
     
    453469 * block.  No error checking is performed.
    454470 *
    455  * @param[in] server The server identifier.  Use @c RTEMS_ID_NONE to specify
    456  *   the default server.
    457471 * @param[in] request The interrupt server request must be initialized before the
    458472 *   first call to this function via
     
    462476 */
    463477RTEMS_INLINE_ROUTINE void rtems_interrupt_server_request_submit(
    464   rtems_id                        server,
    465478  rtems_interrupt_server_request *request
    466479)
    467480{
    468   rtems_interrupt_server_entry_submit( server, &request->entry );
     481  rtems_interrupt_server_entry_submit( &request->entry );
    469482}
    470483
     
    472485 * @brief Destroys the specified interrupt server request.
    473486 *
    474  * This function must be called from thread context.  It may block.  No error
    475  * checking is performed.
    476  *
    477  * @param[in] server The server identifier.  Use @c RTEMS_ID_NONE to specify
    478  *   the default server.
     487 * This function must be called from thread context.  It may block.  Calling
     488 * this function within the context of an interrupt server is undefined
     489 * behaviour.  No error checking is performed.
     490 *
    479491 * @param[in] request The interrupt server request to destroy.  It must have
    480492 *   been initialized via rtems_interrupt_server_request_initialize().
    481493 */
    482494RTEMS_INLINE_ROUTINE void rtems_interrupt_server_request_destroy(
    483   rtems_id                        server,
    484495  rtems_interrupt_server_request *request
    485496)
    486497{
    487   rtems_interrupt_server_entry_destroy( server, &request->entry );
     498  rtems_interrupt_server_entry_destroy( &request->entry );
    488499}
    489500
Note: See TracChangeset for help on using the changeset viewer.