RTEMS
schedulerident.c
1 /*
2  * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
3  *
4  * embedded brains GmbH
5  * Dornierstr. 4
6  * 82178 Puchheim
7  * Germany
8  * <rtems@embedded-brains.de>
9  *
10  * The license and distribution terms for this file may be
11  * found in the file LICENSE in this distribution or at
12  * http://www.rtems.org/license/LICENSE.
13  */
14 
15 #ifdef HAVE_CONFIG_H
16 #include "config.h"
17 #endif
18 
19 #include <rtems/rtems/tasks.h>
21 
23  rtems_name name,
24  rtems_id *id
25 )
26 {
28 
29  if ( id != NULL ) {
30  size_t n = _Scheduler_Count;
31  size_t i;
32 
33  sc = RTEMS_INVALID_NAME;
34 
35  for ( i = 0 ; i < n && sc == RTEMS_INVALID_NAME ; ++i ) {
36  const Scheduler_Control *scheduler = &_Scheduler_Table[ i ];
37 
38  if ( scheduler->name == name ) {
39  *id = _Scheduler_Build_id( i );
40  sc = RTEMS_SUCCESSFUL;
41  }
42  }
43  } else {
45  }
46 
47  return sc;
48 }
uint32_t rtems_name
This type is used to represent a Classic API object name.
Definition: types.h:227
Inlined Routines Associated with the Manipulation of the Scheduler.
uint32_t name
The scheduler name.
Definition: scheduler.h:286
This status code indicates successful completion.
Definition: status.h:86
rtems_status_code rtems_scheduler_ident(rtems_name name, rtems_id *id)
Identifies a scheduler instance by its name.
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:82
This header file defines the main parts of the Tasks Manager API.
const Scheduler_Control _Scheduler_Table[]
This table contains the configured schedulers.
This status code indicates that a specified address was invalid.
Definition: status.h:133
static __inline__ Objects_Id _Scheduler_Build_id(uint32_t scheduler_index)
Builds an object build id.
Objects_Id rtems_id
Values of this type identify an RTEMS object.
Definition: types.h:99
const size_t _Scheduler_Count
This constant contains the count of configured schedulers.
Scheduler control.
Definition: scheduler.h:264
This status code indicates that an object name was invalid.
Definition: status.h:101