source: rtems/testsuites/sptests/sp75/init.c @ 4e8589d

4.115
Last change on this file since 4e8589d was 4e8589d, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/29/11 at 16:20:49

2011-09-29 Ralf Corsépius <ralf.corsepius@…>

  • sp75/init.c, spcbssched01/init.c, spcbssched01/task1.c spcbssched02/init.c, spcbssched02/task_periodic.c, spcbssched03/init.c, spcbssched03/tasks_aperiodic.c, spcbssched03/tasks_periodic.c, spedfsched01/init.c, spedfsched01/task1.c, spedfsched02/getall.c, spedfsched02/init.c, spedfsched02/task1.c, spedfsched03/init.c, spedfsched03/tasks_aperiodic.c, spedfsched03/tasks_periodic.c, sprbtree01/init.c: Add HAVE_CONFIG_H.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2011.
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#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ 1
17#include <tmacros.h>
18#include "test_support.h"
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.