source: rtems/testsuites/sptests/sp75/init.c @ ae75429

4.115
Last change on this file since ae75429 was ae75429, checked in by Sebastian Huber <sebastian.huber@…>, on Aug 6, 2013 at 2:10:26 PM

PR766: Delete RTEMS_VIOLATE_KERNEL_VISIBILITY

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