source: rtems/c/src/exec/rtems/src/signalcatch.c @ 227ae749

4.104.114.84.95
Last change on this file since 227ae749 was 7a55888, checked in by Joel Sherrill <joel.sherrill@…>, on 01/22/01 at 13:47:07

2001-01-22 Michael Hamel <mhamel@…>

  • include/rtems.h, src/signalcatch.c: Modifications to make CodeWarrior? happy.
  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2 *  Signal Manager
3 *
4 *
5 *  COPYRIGHT (c) 1989-1999.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.OARcorp.com/rtems/license.html.
11 *
12 *  $Id$
13 */
14
15#include <rtems/system.h>
16#include <rtems/rtems/status.h>
17#include <rtems/rtems/asr.h>
18#include <rtems/score/isr.h>
19#include <rtems/rtems/modes.h>
20#include <rtems/rtems/signal.h>
21#include <rtems/score/thread.h>
22#include <rtems/rtems/tasks.h>
23
24/*PAGE
25 *
26 *  rtems_signal_catch
27 *
28 *  This directive allows a thread to specify what action to take when
29 *  catching signals.
30 *
31 *  Input parameters:
32 *    handler  - address of asynchronous signal routine (asr)
33 *              ( NULL indicates asr is invalid )
34 *    mode_set - mode value for asr
35 *
36 *  Output parameters:
37 *    RTEMS_SUCCESSFUL - always succeeds
38 */
39
40rtems_status_code rtems_signal_catch(
41  rtems_asr_entry   asr_handler,
42  rtems_mode        mode_set
43)
44{
45  Thread_Control     *executing;
46  RTEMS_API_Control  *api;
47  ASR_Information    *asr;
48
49/* XXX normalize mode */
50  executing = _Thread_Executing;
51  api = (RTEMS_API_Control*)executing->API_Extensions[ THREAD_API_RTEMS ];
52  asr = &api->Signal;
53
54  _Thread_Disable_dispatch(); /* cannot reschedule while */
55                              /*   the thread is inconsistent */
56
57  if ( !_ASR_Is_null_handler( asr_handler ) ) {
58    asr->mode_set = mode_set;
59    asr->handler = asr_handler;
60  }
61  else
62    _ASR_Initialize( asr );
63  _Thread_Enable_dispatch();
64  return RTEMS_SUCCESSFUL;
65}
Note: See TracBrowser for help on using the repository browser.