OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [posix/] [src/] [psignalclearsignals.c] - Blame information for rev 1771

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*
2
 *  psignalclearsignals.c,v 1.3 2001/01/24 14:17:28 joel Exp
3
 */
4
 
5
#if HAVE_CONFIG_H
6
#include "config.h"
7
#endif
8
 
9
#include <assert.h>
10
#include <errno.h>
11
#include <pthread.h>
12
#include <signal.h>
13
 
14
#include <rtems/system.h>
15
#include <rtems/score/isr.h>
16
#include <rtems/score/thread.h>
17
#include <rtems/score/tqdata.h>
18
#include <rtems/score/wkspace.h>
19
#include <rtems/seterr.h>
20
#include <rtems/posix/threadsup.h>
21
#include <rtems/posix/psignal.h>
22
#include <rtems/posix/pthread.h>
23
#include <rtems/posix/time.h>
24
#include <stdio.h>
25
 
26
/*PAGE
27
 *
28
 *  _POSIX_signals_Clear_signals
29
 */
30
 
31
boolean _POSIX_signals_Clear_signals(
32
  POSIX_API_Control  *api,
33
  int                 signo,
34
  siginfo_t          *info,
35
  boolean             is_global,
36
  boolean             check_blocked
37
)
38
{
39
  sigset_t                    mask;
40
  sigset_t                    signals_blocked;
41
  ISR_Level                   level;
42
  boolean                     do_callout;
43
  POSIX_signals_Siginfo_node *psiginfo;
44
 
45
  mask = signo_to_mask( signo );
46
 
47
  do_callout = FALSE;
48
 
49
  /* set blocked signals based on if checking for them, SIGNAL_ALL_MASK
50
   * insures that no signals are blocked and all are checked.
51
   */
52
 
53
  if ( check_blocked )
54
    signals_blocked = ~api->signals_blocked;
55
  else
56
    signals_blocked = SIGNAL_ALL_MASK;
57
 
58
  /* XXX this is not right for siginfo type signals yet */
59
  /* XXX since they can't be cleared the same way */
60
 
61
  _ISR_Disable( level );
62
    if ( is_global ) {
63
       if ( mask & (_POSIX_signals_Pending & signals_blocked) ) {
64
         if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
65
           psiginfo = (POSIX_signals_Siginfo_node *)
66
             _Chain_Get_unprotected( &_POSIX_signals_Siginfo[ signo ] );
67
           if ( _Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
68
             _POSIX_signals_Clear_process_signals( mask );
69
           if ( psiginfo ) {
70
             *info = psiginfo->Info;
71
             _Chain_Append_unprotected(
72
               &_POSIX_signals_Inactive_siginfo,
73
               &psiginfo->Node
74
             );
75
           } else
76
             do_callout = FALSE;
77
         } else
78
           _POSIX_signals_Clear_process_signals( mask );
79
         do_callout = TRUE;
80
       }
81
    } else {
82
      if ( mask & (api->signals_pending & signals_blocked) ) {
83
        api->signals_pending &= ~mask;
84
        do_callout = TRUE;
85
      }
86
    }
87
  _ISR_Enable( level );
88
  return do_callout;
89
}

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.