source: rtems/testsuites/samples/base_mp/init.c @ a8ac273c

Last change on this file since a8ac273c was a8ac273c, checked in by Sebastian Huber <sebastian.huber@…>, on Mar 24, 2016 at 7:40:19 AM

samples/base_mp: Check directive status

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[5f0cd34]1/**
2 *  COPYRIGHT (c) 1989-2012.
[ac7d5ef0]3 *  On-Line Applications Research Corporation (OAR).
4 *
[98e4ebf]5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
[c499856]7 *  http://www.rtems.org/license/LICENSE.
[ac7d5ef0]8 */
9
[e313551]10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
[df49c60]14#define CONFIGURE_INIT
[ac7d5ef0]15#include "system.h"
[df49c60]16#include <stdio.h>
[ac7d5ef0]17
[0cd2b777]18#include "tmacros.h"
19
[5f0cd34]20/* forward declarations to avoid warnings */
21rtems_task Init(rtems_task_argument argument);
22
[9391f6d]23const char rtems_test_name[] = "SAMPLE MULTIPROCESSOR APPLICATION";
24
[ac7d5ef0]25rtems_task Init(
26  rtems_task_argument argument
27)
28{
29  rtems_name        task_name;
30  rtems_id          tid;
31  rtems_status_code status;
32
[9391f6d]33  TEST_BEGIN();
[ac7d5ef0]34  printf( "Creating and starting an application task\n" );
35  task_name = rtems_build_name( 'T', 'A', '1', ' ' );
[3652ad35]36  status = rtems_task_create( task_name, 1, RTEMS_MINIMUM_STACK_SIZE,
[ac7d5ef0]37             RTEMS_INTERRUPT_LEVEL(0), RTEMS_DEFAULT_ATTRIBUTES, &tid );
[a8ac273c]38  rtems_test_assert(status == RTEMS_SUCCESSFUL);
39
[3a4ae6c]40  status = rtems_task_start(
41    tid,
42    Application_task,
43    Multiprocessing_configuration.node
44  );
[a8ac273c]45  rtems_test_assert(status == RTEMS_SUCCESSFUL);
46
47  rtems_task_delete( RTEMS_SELF );
[ac7d5ef0]48}
Note: See TracBrowser for help on using the repository browser.