source: rtems/cpukit/libgnat/ada_intrsupp.c @ ddeb7730

4.104.11
Last change on this file since ddeb7730 was ddeb7730, checked in by Joel Sherrill <joel.sherrill@…>, on Mar 27, 2010 at 3:08:04 PM

2010-03-27 Joel Sherrill <joel.sherrill@…>

  • libgnat/ada_intrsupp.c, telnetd/check_passwd.c, telnetd/des.c, telnetd/genpw.c: Add include of config.h
  • Property mode set to 100644
File size: 2.9 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2010.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <rtems.h>
17#include <rtems/bspIo.h>
18
19rtems_id __gnat_binary_semaphore_create(void)
20{
21  rtems_status_code status;
22  rtems_id          semaphore;
23
24  status = rtems_semaphore_create(
25    rtems_build_name( 'A', 'I', 'S', 'R' ),
26    0,
27    RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_FIFO,
28    0,
29    &semaphore
30  );
31  if ( status != RTEMS_SUCCESSFUL )
32    printk( "__gnat_binary_semaphore_create failed %d\n", status );
33
34  #if defined(GNAT_DEBUG)
35    printk( "__gnat_binary_semaphore_create\n" );
36  #endif
37  return semaphore;
38}
39
40int __gnat_binary_semaphore_delete(
41  rtems_id semaphore
42)
43{
44  rtems_status_code status;
45
46  #if defined(GNAT_DEBUG)
47    printk( "__gnat_binary_semaphore_delete\n" );
48  #endif
49
50  status = rtems_semaphore_delete( semaphore );
51  if ( status != RTEMS_SUCCESSFUL )
52    printk( "__gnat_binary_semaphore_delete failed %d\n", status );
53
54  return 0;
55}
56
57int __gnat_binary_semaphore_obtain(
58  rtems_id semaphore
59)
60{
61  rtems_status_code status;
62
63  #if defined(GNAT_DEBUG)
64    printk( "__gnat_binary_semaphore_obtain\n" );
65  #endif
66
67  status = rtems_semaphore_obtain( semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
68  if ( status != RTEMS_SUCCESSFUL )
69    printk( "__gnat_binary_semaphore_obtain failed %d\n", status );
70
71  return 0;
72}
73
74int __gnat_binary_semaphore_release(
75  rtems_id semaphore
76)
77{
78  rtems_status_code status;
79
80  #if defined(GNAT_DEBUG)
81    printk( "__gnat_binary_semaphore_release\n" );
82  #endif
83
84  status = rtems_semaphore_release( semaphore );
85  if ( status != RTEMS_SUCCESSFUL )
86    printk( "__gnat_binary_semaphore_release failed %d\n", status );
87
88  return 0;
89}
90
91int __gnat_binary_semaphore_flush(
92  rtems_id semaphore
93)
94{
95  rtems_status_code status;
96
97  printk( "__gnat_binary_semaphore_flush\n" );
98
99  status = rtems_semaphore_flush( semaphore );
100  if ( status != RTEMS_SUCCESSFUL )
101    printk( "__gnat_binary_semaphore_flush failed %d\n", status );
102
103  return 0;
104}
105
106typedef void (*ISRHandler)(void*);
107  void *set_vector( void *, rtems_vector_number, int );
108
109int __gnat_interrupt_connect(
110  int         vector,
111  ISRHandler  handler,
112  void       *parameter
113)
114{
115  printk( "__gnat_interrupt_connect( %d, %p, %p )\n", vector, handler, parameter  );
116  set_vector( handler, vector, 1 );
117  return 0;
118}
119
120int __gnat_interrupt_set(
121  int         vector,
122  ISRHandler  handler
123)
124{
125  printk( "__gnat_interrupt_set( %d, %p )\n", vector, handler );
126
127  set_vector( handler, vector, 1 );
128  return 0;
129}
130
131ISRHandler __gnat_interrupt_get(
132  int         vector
133)
134{
135  printk( "__gnat_interrupt_get( %d )\n", vector );
136  return 0;
137}
138
139int __gnat_interrupt_number_to_vector(
140  int intNum
141)
142{
143  printk( "__gnat_interrupt_number_to_vector( %d )\n", intNum );
144  return intNum;
145}
146
Note: See TracBrowser for help on using the repository browser.