* spnsext01/.cvsignore, spnsext01/Makefile.am, spnsext01/init.c,
	spnsext01/spnsext01.doc, spnsext01/spnsext01.scn: New files.
	* Makefile.am, configure.ac: Reflect changes above.
This commit is contained in:
Sebastian Huber
2011-05-06 07:08:04 +00:00
parent 541591c355
commit b68d231ee2
8 changed files with 154 additions and 1 deletions

View File

@@ -1,3 +1,9 @@
2011-05-06 Sebastian Huber <sebastian.huber@embedded-brains.de>
* spnsext01/.cvsignore, spnsext01/Makefile.am, spnsext01/init.c,
spnsext01/spnsext01.doc, spnsext01/spnsext01.scn: New files.
* Makefile.am, configure.ac: Reflect changes above.
2011-05-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* sp09/screen12.c, sp09/sp09.scn, sp21/Makefile.am, sp35/priinv.c,

View File

@@ -29,7 +29,7 @@ SUBDIRS = \
spintrcritical09 spintrcritical10 spintrcritical11 spintrcritical12 \
spintrcritical13 spintrcritical14 spintrcritical15 spintrcritical16 \
spintrcritical17 spmkdir spmountmgr01 spheapprot \
spsimplesched01 spsimplesched02 spsimplesched03
spsimplesched01 spsimplesched02 spsimplesched03 spnsext01
DIST_SUBDIRS = $(SUBDIRS) spfatal_support spintrcritical_support
EXTRA_DIST = spfatal_support/init.c spfatal_support/system.h

View File

@@ -157,6 +157,7 @@ spheapprot/Makefile
spmkdir/Makefile
spmountmgr01/Makefile
spnotepad01/Makefile
spnsext01/Makefile
spobjgetnext/Makefile
spprintk/Makefile
spprivenv01/Makefile

View File

@@ -0,0 +1,2 @@
Makefile
Makefile.in

View File

@@ -0,0 +1,27 @@
##
## $Id$
##
MANAGERS = io semaphore event
rtems_tests_PROGRAMS = spnsext01
spnsext01_SOURCES = init.c
dist_rtems_tests_DATA = spnsext01.scn spnsext01.doc
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
include $(top_srcdir)/../automake/leaf.am
spnsext01_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
LINK_OBJS = $(spnsext01_OBJECTS) $(spnsext01_LDADD)
LINK_LIBS = $(spnsext01_LDLIBS)
spnsext01$(EXEEXT): $(spnsext01_OBJECTS) $(spnsext01_DEPENDENCIES)
@rm -f spnsext01$(EXEEXT)
$(make-exe)
include $(top_srcdir)/../automake/local.am

View File

@@ -0,0 +1,88 @@
/*
* Copyright (c) 2011 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Obere Lagerstr. 30
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tmacros.h>
static rtems_task Init(rtems_task_argument argument)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_interrupt_level level;
rtems_interval t0 = 0;
rtems_interval t1 = 0;
int i = 0;
int n = 0;
struct timespec uptime;
struct timespec new_uptime;
puts("\n\n*** TEST NANO SECONDS EXTENSION 1 ***");
/* Align with clock tick */
t0 = rtems_clock_get_ticks_since_boot();
while ((t1 = rtems_clock_get_ticks_since_boot()) == t0) {
/* Do nothing */
}
t0 = t1;
sc = rtems_clock_get_uptime(&uptime);
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
while ((t1 = rtems_clock_get_ticks_since_boot()) == t0) {
++n;
sc = rtems_clock_get_uptime(&new_uptime);
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
rtems_test_assert(!_Timestamp_Less_than(&new_uptime, &uptime));
uptime = new_uptime;
}
n = (3 * n) / 2;
rtems_interrupt_disable(level);
sc = rtems_clock_get_uptime(&uptime);
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
for (i = 0; i < n; ++i) {
/* Preserve execution time of previous loop */
rtems_clock_get_ticks_since_boot();
sc = rtems_clock_get_uptime(&new_uptime);
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
rtems_test_assert(!_Timestamp_Less_than(&new_uptime, &uptime));
uptime = new_uptime;
}
rtems_interrupt_enable(level);
puts("*** END OF TEST NANO SECONDS EXTENSION 1 ***");
rtems_test_exit(0);
}
#define CONFIGURE_INIT
#define CONFIGURE_MICROSECONDS_PER_TICK 100000
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
#define CONFIGURE_MAXIMUM_TASKS 1
#define CONFIGURE_MAXIMUM_DRIVERS 2
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h>

View File

@@ -0,0 +1,27 @@
#
# Copyright (c) 2011 embedded brains GmbH. All rights reserved.
#
# embedded brains GmbH
# Obere Lagerstr. 30
# 82178 Puchheim
# Germany
# <rtems@embedded-brains.de>
#
# The license and distribution terms for this file may be
# found in the file LICENSE in this distribution or at
# http://www.rtems.com/license/LICENSE.
#
# $Id$
#
This file describes the directives and concepts tested by this test set.
test set name: spnsext
directives:
rtems_clock_get_uptime
concepts:
+ Check if nano seconds extension works.

View File

@@ -0,0 +1,2 @@
*** TEST NANO SECONDS EXTENSION 1 ***
*** END OF TEST NANO SECONDS EXTENSION 1 ***