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

Subversion Repositories or1k

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

powered by: WebSVN 2.1.0

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