source: rtems/testsuites/sptests/sp75/init.c @ 3c8eda7

4.115
Last change on this file since 3c8eda7 was 3c8eda7, checked in by Joel Sherrill <joel.sherrill@…>, on 05/12/12 at 16:01:26

sptests - Eliminate missing prototype warnings

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2012.
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
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ 1
15#include <tmacros.h>
16#include "test_support.h"
17
18/* forward declarations to avoid warnings */
19rtems_task Init(rtems_task_argument argument);
20
21rtems_task Init(
22  rtems_task_argument argument
23)
24{
25  rtems_status_code sc;
26  rtems_id          mutex;
27
28  puts( "\n\n*** TEST SP75 ***" );
29
30  sc = rtems_semaphore_create(
31    rtems_build_name('M', 'U', 'T', 'X'),
32    0,
33    RTEMS_BINARY_SEMAPHORE,
34    0,
35    &mutex
36  );
37  directive_failed(sc, "rtems_semaphore_create");
38
39  /*
40   *  Call semaphore obtain with dispatching disabled.  Reenable
41   *  dispatching before checking the status returned since
42   *  directive_failed() checks for dispatching being enabled.
43   */
44  puts( "rtems_semaphore_obtain - with dispatching disabled" );
45  _Thread_Disable_dispatch();
46    sc = rtems_semaphore_obtain(mutex, RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT);
47  _Thread_Enable_dispatch();
48  directive_failed(sc, "rtems_semaphore_obtain");
49
50  puts( "*** END OF TEST SP75 ***" );
51  rtems_test_exit(0);
52}
53
54/* configuration information */
55
56#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
57#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
58
59#define CONFIGURE_MAXIMUM_TASKS             1
60#define CONFIGURE_MAXIMUM_SEMAPHORES        1
61#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
62
63#define CONFIGURE_INIT
64
65#include <rtems/confdefs.h>
66/* end of file */
Note: See TracBrowser for help on using the repository browser.