Changeset d184140 in rtems


Ignore:
Timestamp:
Jul 11, 2017, 7:08:15 AM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
ccc87c8b
Parents:
a961e198
git-author:
Sebastian Huber <sebastian.huber@…> (07/11/17 07:08:15)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/12/17 05:46:52)
Message:

Add interrupt server set affinity

Update #3071.

Files:
2 edited

Legend:

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

    ra961e198 rd184140  
    751751  return RTEMS_SUCCESSFUL;
    752752}
     753
     754rtems_status_code rtems_interrupt_server_set_affinity(
     755  uint32_t            server_index,
     756  size_t              affinity_size,
     757  const cpu_set_t    *affinity,
     758  rtems_task_priority priority
     759)
     760{
     761  rtems_status_code sc;
     762  bsp_interrupt_server_context *s;
     763  rtems_id scheduler;
     764
     765  s = bsp_interrupt_server_get_context(server_index, &sc);
     766  if (s == NULL) {
     767    return sc;
     768  }
     769
     770  sc = rtems_scheduler_ident_by_processor_set(
     771    affinity_size,
     772    affinity,
     773    &scheduler
     774  );
     775  if (sc != RTEMS_SUCCESSFUL) {
     776    return sc;
     777  }
     778
     779  sc = rtems_task_set_scheduler(s->server, scheduler, priority);
     780  if (sc != RTEMS_SUCCESSFUL) {
     781    return sc;
     782  }
     783
     784  return rtems_task_set_affinity(s->server, affinity_size, affinity);
     785}
  • cpukit/include/rtems/irq-extension.h

    ra961e198 rd184140  
    402402
    403403/**
     404 * @brief Sets the processor affinity of the specified interrupt server.
     405 *
     406 * The scheduler is set determined by the highest numbered processor in the
     407 * specified affinity set.
     408 *
     409 * This operation is only reliable in case the specified interrupt was
     410 * suspended via rtems_interrupt_server_suspend().
     411 *
     412 * @param[in] server_index The interrupt server index.  Use
     413 *   @c RTEMS_INTERRUPT_SERVER_DEFAULT to specify the default server.
     414 * @param[in] affinity_size The storage size of the affinity set.
     415 * @param[in] affinity The desired processor affinity set for the specified
     416 *   interrupt server.
     417 * @param[in] priority The task priority with respect to the corresponding
     418 *   scheduler instance.
     419 *
     420 * @retval RTEMS_SUCCESSFUL Successful operation
     421 * @retval RTEMS_INCORRECT_STATE The interrupt servers are not initialized.
     422 * @retval RTEMS_INVALID_ID If the interrupt server index is invalid.
     423 * @retval RTEMS_INVALID_SIZE Invalid affinity set size.
     424 * @retval RTEMS_INVALID_NAME The affinity set contains no online processor.
     425 * @retval RTEMS_INCORRECT_STATE The highest numbered online processor in the
     426 *   specified affinity set is not owned by a scheduler.
     427 * @retval RTEMS_INVALID_PRIORITY Invalid priority.
     428 * @retval RTEMS_RESOURCE_IN_USE The interrupt server owns resources which deny
     429 *   a scheduler change.
     430 * @retval RTEMS_INVALID_NUMBER Invalid processor affinity set.
     431 */
     432rtems_status_code rtems_interrupt_server_set_affinity(
     433  uint32_t            server_index,
     434  size_t              affinity_size,
     435  const cpu_set_t    *affinity,
     436  rtems_task_priority priority
     437);
     438
     439/**
    404440 * @brief Initializes the specified interrupt server entry.
    405441 *
Note: See TracChangeset for help on using the changeset viewer.