source: rtems/cpukit/rtems/src/signalsend.c @ c05d7502

4.115
Last change on this file since c05d7502 was c05d7502, checked in by Mathew Kallada <matkallada@…>, on 12/02/12 at 22:59:17

score misc: Clean up Doxygen #14 (GCI 2012)

This patch is a task from GCI 2012 which improves the Doxygen
comments in the RTEMS source.

http://www.google-melange.com/gci/task/view/google/gci2012/8025204

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief RTEMS Send Signal
5 *  @ingroup ClassicSignal
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2007.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.com/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/system.h>
22#include <rtems/rtems/status.h>
23#include <rtems/rtems/asr.h>
24#include <rtems/score/isr.h>
25#include <rtems/rtems/modes.h>
26#include <rtems/rtems/signal.h>
27#include <rtems/score/thread.h>
28#include <rtems/rtems/tasks.h>
29
30rtems_status_code rtems_signal_send(
31  rtems_id          id,
32  rtems_signal_set  signal_set
33)
34{
35  register Thread_Control *the_thread;
36  Objects_Locations        location;
37  RTEMS_API_Control       *api;
38  ASR_Information         *asr;
39
40  if ( !signal_set )
41    return RTEMS_INVALID_NUMBER;
42
43  the_thread = _Thread_Get( id, &location );
44  switch ( location ) {
45
46    case OBJECTS_LOCAL:
47      api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
48      asr = &api->Signal;
49
50      if ( ! _ASR_Is_null_handler( asr->handler ) ) {
51        if ( asr->is_enabled ) {
52          _ASR_Post_signals( signal_set, &asr->signals_posted );
53
54          if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
55            _Thread_Dispatch_necessary = true;
56        } else {
57          _ASR_Post_signals( signal_set, &asr->signals_pending );
58        }
59        _Thread_Enable_dispatch();
60        return RTEMS_SUCCESSFUL;
61      }
62      _Thread_Enable_dispatch();
63      return RTEMS_NOT_DEFINED;
64
65#if defined(RTEMS_MULTIPROCESSING)
66    case OBJECTS_REMOTE:
67      return _Signal_MP_Send_request_packet(
68        SIGNAL_MP_SEND_REQUEST,
69        id,
70        signal_set
71      );
72#endif
73
74    case OBJECTS_ERROR:
75      break;
76  }
77
78  return RTEMS_INVALID_ID;
79}
Note: See TracBrowser for help on using the repository browser.