source: rtems/cpukit/rtems/src/tasksetnote.c @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 2.5 KB
Line 
1/*
2 *  RTEMS Task Manager
3 *
4 *  COPYRIGHT (c) 1989-2009.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 */
11
12#if HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <rtems/system.h>
17#include <rtems/config.h>
18#include <rtems/rtems/status.h>
19#include <rtems/rtems/support.h>
20#include <rtems/rtems/modes.h>
21#include <rtems/score/object.h>
22#include <rtems/score/stack.h>
23#include <rtems/score/states.h>
24#include <rtems/rtems/tasks.h>
25#include <rtems/score/thread.h>
26#include <rtems/score/threadq.h>
27#include <rtems/score/tod.h>
28#include <rtems/score/userext.h>
29#include <rtems/score/wkspace.h>
30#include <rtems/score/apiext.h>
31#include <rtems/score/sysstate.h>
32
33/*
34 * rtems_task_set_note
35 *
36 *  This directive sets the specified notepad contents to the given
37 *  note.
38 *
39 *  Input parameters:
40 *    id      - thread id
41 *    notepad - notepad number
42 *    note    - note value
43 *
44 *  Output parameters:
45 *    RTEMS_SUCCESSFUL - if successful
46 *    error code       - if unsuccessful
47 */
48
49rtems_status_code rtems_task_set_note(
50  rtems_id id,
51  uint32_t notepad,
52  uint32_t note
53)
54{
55  register Thread_Control *the_thread;
56  Objects_Locations        location;
57  RTEMS_API_Control       *api;
58
59  if ( !rtems_configuration_get_notepads_enabled() )
60    return RTEMS_NOT_CONFIGURED;
61
62  /*
63   *  NOTE:  There is no check for < RTEMS_NOTEPAD_FIRST because that would
64   *         be checking an unsigned number for being negative.
65   */
66
67  if ( notepad > RTEMS_NOTEPAD_LAST )
68    return RTEMS_INVALID_NUMBER;
69
70  /*
71   *  Optimize the most likely case to avoid the Thread_Dispatch.
72   */
73
74  if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ||
75       _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) {
76      api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ];
77      api->Notepads[ notepad ] = note;
78      return RTEMS_SUCCESSFUL;
79  }
80
81  the_thread = _Thread_Get( id, &location );
82  switch ( location ) {
83
84    case OBJECTS_LOCAL:
85      api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
86      api->Notepads[ notepad ] = note;
87      _Thread_Enable_dispatch();
88      return RTEMS_SUCCESSFUL;
89
90#if defined(RTEMS_MULTIPROCESSING)
91    case OBJECTS_REMOTE:
92      return _RTEMS_tasks_MP_Send_request_packet(
93        RTEMS_TASKS_MP_SET_NOTE_REQUEST,
94        id,
95        0,          /* Not used */
96        notepad,
97        note
98      );
99#endif
100
101    case OBJECTS_ERROR:
102      break;
103  }
104
105  return RTEMS_INVALID_ID;
106}
Note: See TracBrowser for help on using the repository browser.