examples/ostest: Cannot be configured or build if CONFIG_DISABLE_SIGNALS=y
This commit is contained in:
parent
b169bd4641
commit
497130f372
@ -6,6 +6,7 @@
|
|||||||
config EXAMPLES_OSTEST
|
config EXAMPLES_OSTEST
|
||||||
bool "OS test example"
|
bool "OS test example"
|
||||||
default n
|
default n
|
||||||
|
depends on !DISABLE_SIGNALS
|
||||||
---help---
|
---help---
|
||||||
Enable the OS test example
|
Enable the OS test example
|
||||||
|
|
||||||
@ -78,7 +79,7 @@ config EXAMPLES_OSTEST_RR_RUNS
|
|||||||
length of this test - it should last at least a few tens of seconds. Allowed
|
length of this test - it should last at least a few tens of seconds. Allowed
|
||||||
values [1; 32767], default 10
|
values [1; 32767], default 10
|
||||||
|
|
||||||
if ARCH_FPU && SCHED_WAITPID && !DISABLE_SIGNALS
|
if ARCH_FPU && SCHED_WAITPID
|
||||||
|
|
||||||
config EXAMPLES_OSTEST_FPUTESTDISABLE
|
config EXAMPLES_OSTEST_FPUTESTDISABLE
|
||||||
bool "Disable FPU test"
|
bool "Disable FPU test"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# apps/examples/ostest/Makefile
|
# apps/examples/ostest/Makefile
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007-2012, 2014 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2007-2012, 2014, 2017 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -44,7 +44,7 @@ STACKSIZE = 2048
|
|||||||
# NuttX OS Test
|
# NuttX OS Test
|
||||||
|
|
||||||
ASRCS =
|
ASRCS =
|
||||||
CSRCS = dev_null.c restart.c
|
CSRCS = dev_null.c restart.c sigprocmask.c sighand.c signest.c
|
||||||
MAINSRC = ostest_main.c
|
MAINSRC = ostest_main.c
|
||||||
|
|
||||||
ifeq ($(CONFIG_ARCH_FPU),y)
|
ifeq ($(CONFIG_ARCH_FPU),y)
|
||||||
@ -66,7 +66,7 @@ CSRCS += waitpid.c
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(CONFIG_DISABLE_PTHREAD),y)
|
ifneq ($(CONFIG_DISABLE_PTHREAD),y)
|
||||||
CSRCS += cancel.c cond.c mutex.c sem.c semtimed.c barrier.c
|
CSRCS += cancel.c cond.c mutex.c sem.c semtimed.c barrier.c timedwait.c
|
||||||
|
|
||||||
ifeq ($(CONFIG_FS_NAMED_SEMAPHORES),y)
|
ifeq ($(CONFIG_FS_NAMED_SEMAPHORES),y)
|
||||||
CSRCS += nsem.c
|
CSRCS += nsem.c
|
||||||
@ -85,13 +85,6 @@ CSRCS += sporadic.c
|
|||||||
endif
|
endif
|
||||||
endif # CONFIG_DISABLE_PTHREAD
|
endif # CONFIG_DISABLE_PTHREAD
|
||||||
|
|
||||||
ifneq ($(CONFIG_DISABLE_SIGNALS),y)
|
|
||||||
CSRCS += sigprocmask.c sighand.c signest.c
|
|
||||||
ifneq ($(CONFIG_DISABLE_PTHREAD),y)
|
|
||||||
CSRCS += timedwait.c
|
|
||||||
endif # CONFIG_DISABLE_PTHREAD
|
|
||||||
endif # CONFIG_DISABLE_SIGNALS
|
|
||||||
|
|
||||||
ifneq ($(CONFIG_DISABLE_MQUEUE),y)
|
ifneq ($(CONFIG_DISABLE_MQUEUE),y)
|
||||||
ifneq ($(CONFIG_DISABLE_PTHREAD),y)
|
ifneq ($(CONFIG_DISABLE_PTHREAD),y)
|
||||||
CSRCS += mqueue.c timedmqueue.c
|
CSRCS += mqueue.c timedmqueue.c
|
||||||
@ -111,13 +104,11 @@ CSRCS += vfork.c
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(CONFIG_DISABLE_SIGNALS),y)
|
|
||||||
ifneq ($(CONFIG_DISABLE_PTHREAD),y)
|
ifneq ($(CONFIG_DISABLE_PTHREAD),y)
|
||||||
ifeq ($(CONFIG_PRIORITY_INHERITANCE),y)
|
ifeq ($(CONFIG_PRIORITY_INHERITANCE),y)
|
||||||
CSRCS += prioinherit.c
|
CSRCS += prioinherit.c
|
||||||
endif # CONFIG_PRIORITY_INHERITANCE
|
endif # CONFIG_PRIORITY_INHERITANCE
|
||||||
endif # CONFIG_DISABLE_PTHREAD
|
endif # CONFIG_DISABLE_PTHREAD
|
||||||
endif # CONFIG_DISABLE_SIGNALS
|
|
||||||
|
|
||||||
CONFIG_XYZ_PROGNAME ?= ostest$(EXEEXT)
|
CONFIG_XYZ_PROGNAME ?= ostest$(EXEEXT)
|
||||||
PROGNAME = $(CONFIG_XYZ_PROGNAME)
|
PROGNAME = $(CONFIG_XYZ_PROGNAME)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/ostest/barrier.c
|
* examples/ostest/barrier.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2011, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -69,9 +69,7 @@ static void *barrier_func(void *parameter)
|
|||||||
int status;
|
int status;
|
||||||
|
|
||||||
printf("barrier_func: Thread %d started\n", id);
|
printf("barrier_func: Thread %d started\n", id);
|
||||||
#ifndef CONFIG_DISABLE_SIGNALS
|
|
||||||
usleep(HALF_SECOND);
|
usleep(HALF_SECOND);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Wait at the barrier until all threads are synchronized. */
|
/* Wait at the barrier until all threads are synchronized. */
|
||||||
|
|
||||||
@ -98,9 +96,7 @@ static void *barrier_func(void *parameter)
|
|||||||
}
|
}
|
||||||
FFLUSH();
|
FFLUSH();
|
||||||
|
|
||||||
#ifndef CONFIG_DISABLE_SIGNALS
|
|
||||||
usleep(HALF_SECOND);
|
usleep(HALF_SECOND);
|
||||||
#endif
|
|
||||||
printf("barrier_func: Thread %d done\n", id);
|
printf("barrier_func: Thread %d done\n", id);
|
||||||
FFLUSH();
|
FFLUSH();
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/ostest/cancel.c
|
* examples/ostest/cancel.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -33,6 +33,10 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included Files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -42,9 +46,17 @@
|
|||||||
|
|
||||||
#include "ostest.h"
|
#include "ostest.h"
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Private Data
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
static pthread_mutex_t mutex;
|
static pthread_mutex_t mutex;
|
||||||
static pthread_cond_t cond;
|
static pthread_cond_t cond;
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Private Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_PTHREAD_CLEANUP
|
#ifdef CONFIG_PTHREAD_CLEANUP
|
||||||
static void thread_cleaner(FAR void *arg)
|
static void thread_cleaner(FAR void *arg)
|
||||||
{
|
{
|
||||||
@ -274,6 +286,10 @@ static void restart_thread(FAR void *(*entry)(FAR void *), pthread_t *waiter, in
|
|||||||
start_thread(entry, waiter, cancelable);
|
start_thread(entry, waiter, cancelable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
void cancel_test(void)
|
void cancel_test(void)
|
||||||
{
|
{
|
||||||
pthread_t waiter;
|
pthread_t waiter;
|
||||||
@ -437,7 +453,6 @@ void cancel_test(void)
|
|||||||
* could be re-designed so that it does not depend on signals.
|
* could be re-designed so that it does not depend on signals.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_DISABLE_SIGNALS
|
|
||||||
printf("cancel_test: Test 5: Non-cancelable threads\n");
|
printf("cancel_test: Test 5: Non-cancelable threads\n");
|
||||||
printf("cancel_test: Re-starting thread (non-cancelable)\n");
|
printf("cancel_test: Re-starting thread (non-cancelable)\n");
|
||||||
restart_thread(thread_waiter, &waiter, 0);
|
restart_thread(thread_waiter, &waiter, 0);
|
||||||
@ -508,5 +523,4 @@ void cancel_test(void)
|
|||||||
printf("cancel_test: PASS thread terminated with PTHREAD_CANCELED\n");
|
printf("cancel_test: PASS thread terminated with PTHREAD_CANCELED\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/examples/ostest/fpu.c
|
* apps/examples/ostest/fpu.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2012, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -57,7 +57,6 @@
|
|||||||
#ifdef CONFIG_ARCH_FPU
|
#ifdef CONFIG_ARCH_FPU
|
||||||
# if defined(CONFIG_EXAMPLES_OSTEST_FPUSIZE) && \
|
# if defined(CONFIG_EXAMPLES_OSTEST_FPUSIZE) && \
|
||||||
defined(CONFIG_SCHED_WAITPID) && \
|
defined(CONFIG_SCHED_WAITPID) && \
|
||||||
!defined(CONFIG_DISABLE_SIGNALS) && \
|
|
||||||
defined(CONFIG_BUILD_FLAT)
|
defined(CONFIG_BUILD_FLAT)
|
||||||
# define HAVE_FPU 1
|
# define HAVE_FPU 1
|
||||||
# else
|
# else
|
||||||
@ -67,9 +66,6 @@
|
|||||||
# ifndef CONFIG_SCHED_WAITPID
|
# ifndef CONFIG_SCHED_WAITPID
|
||||||
# warning "FPU test not built; CONFIG_SCHED_WAITPID not defined"
|
# warning "FPU test not built; CONFIG_SCHED_WAITPID not defined"
|
||||||
# endif
|
# endif
|
||||||
# ifdef CONFIG_DISABLE_SIGNALS
|
|
||||||
# warning "FPU test not built; CONFIG_DISABLE_SIGNALS defined"
|
|
||||||
# endif
|
|
||||||
# ifndef CONFIG_BUILD_FLAT
|
# ifndef CONFIG_BUILD_FLAT
|
||||||
# warning "FPU test not built; Only available in the flat build (CONFIG_BUILD_FLAT)"
|
# warning "FPU test not built; Only available in the flat build (CONFIG_BUILD_FLAT)"
|
||||||
# endif
|
# endif
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/examples/ostest/mqueue.c
|
* apps/examples/ostest/mqueue.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2011, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -59,34 +59,18 @@
|
|||||||
#if defined(SDCC) || defined(__ZILOG__)
|
#if defined(SDCC) || defined(__ZILOG__)
|
||||||
/* Cannot use strlen in array size */
|
/* Cannot use strlen in array size */
|
||||||
|
|
||||||
# define TEST_MSGLEN (31)
|
# define TEST_MSGLEN (31)
|
||||||
#else
|
#else
|
||||||
/* Message lenght is the size of the message plus the null terminator */
|
/* Message lenght is the size of the message plus the null terminator */
|
||||||
|
|
||||||
# define TEST_MSGLEN (strlen(TEST_MESSAGE)+1)
|
# define TEST_MSGLEN (strlen(TEST_MESSAGE)+1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TEST_SEND_NMSGS (10)
|
#define TEST_SEND_NMSGS (10)
|
||||||
#ifndef CONFIG_DISABLE_SIGNALS
|
#define TEST_RECEIVE_NMSGS (11)
|
||||||
# define TEST_RECEIVE_NMSGS (11)
|
|
||||||
#else
|
|
||||||
# define TEST_RECEIVE_NMSGS (10)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HALF_SECOND_USEC_USEC 500000L
|
#define HALF_SECOND_USEC_USEC 500000L
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Types
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Function Prototypes
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -94,10 +78,6 @@
|
|||||||
static mqd_t g_send_mqfd;
|
static mqd_t g_send_mqfd;
|
||||||
static mqd_t g_recv_mqfd;
|
static mqd_t g_recv_mqfd;
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -376,7 +356,6 @@ void mqueue_test(void)
|
|||||||
(int)((intptr_t)result));
|
(int)((intptr_t)result));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_DISABLE_SIGNALS
|
|
||||||
/* Wake up the receiver thread with a signal */
|
/* Wake up the receiver thread with a signal */
|
||||||
|
|
||||||
printf("mqueue_test: Killing receiver\n");
|
printf("mqueue_test: Killing receiver\n");
|
||||||
@ -385,7 +364,6 @@ void mqueue_test(void)
|
|||||||
/* Wait a bit to see if the thread exits on its own */
|
/* Wait a bit to see if the thread exits on its own */
|
||||||
|
|
||||||
usleep(HALF_SECOND_USEC_USEC);
|
usleep(HALF_SECOND_USEC_USEC);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Then cancel the thread and see if it did */
|
/* Then cancel the thread and see if it did */
|
||||||
|
|
||||||
|
@ -36,6 +36,14 @@
|
|||||||
#ifndef __APPS_EXAMPLES_OSTEST_OSTEST_H
|
#ifndef __APPS_EXAMPLES_OSTEST_OSTEST_H
|
||||||
#define __APPS_EXAMPLES_OSTEST_OSTEST_H
|
#define __APPS_EXAMPLES_OSTEST_OSTEST_H
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Pre-processor Definitions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_DISABLE_SIGNALS
|
||||||
|
# error Signals are disabled (CONFIG_DISABLE_SIGNALS)
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -206,8 +214,7 @@ void priority_inheritance(void);
|
|||||||
|
|
||||||
/* vfork.c ******************************************************************/
|
/* vfork.c ******************************************************************/
|
||||||
|
|
||||||
#if defined(CONFIG_ARCH_HAVE_VFORK) && defined(CONFIG_SCHED_WAITPID) && \
|
#if defined(CONFIG_ARCH_HAVE_VFORK) && defined(CONFIG_SCHED_WAITPID)
|
||||||
!defined(CONFIG_DISABLE_SIGNALS)
|
|
||||||
int vfork_test(void);
|
int vfork_test(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -90,11 +90,9 @@ static const char *g_argv[NARGS+1];
|
|||||||
static const char *g_argv[NARGS+1] = { arg1, arg2, arg3, arg4, NULL };
|
static const char *g_argv[NARGS+1] = { arg1, arg2, arg3, arg4, NULL };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_DISABLE_SIGNALS
|
|
||||||
static struct mallinfo g_mmbefore;
|
static struct mallinfo g_mmbefore;
|
||||||
static struct mallinfo g_mmprevious;
|
static struct mallinfo g_mmprevious;
|
||||||
static struct mallinfo g_mmafter;
|
static struct mallinfo g_mmafter;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef CONFIG_DISABLE_ENVIRON
|
#ifndef CONFIG_DISABLE_ENVIRON
|
||||||
const char g_var1_name[] = "Variable1";
|
const char g_var1_name[] = "Variable1";
|
||||||
@ -119,7 +117,6 @@ const char g_putenv_value[] = "Variable1=BadValue3";
|
|||||||
* Name: show_memory_usage
|
* Name: show_memory_usage
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef CONFIG_DISABLE_SIGNALS
|
|
||||||
static void show_memory_usage(struct mallinfo *mmbefore,
|
static void show_memory_usage(struct mallinfo *mmbefore,
|
||||||
struct mallinfo *mmafter)
|
struct mallinfo *mmafter)
|
||||||
{
|
{
|
||||||
@ -131,15 +128,11 @@ static void show_memory_usage(struct mallinfo *mmbefore,
|
|||||||
printf("uordblks %8x %8x\n", mmbefore->uordblks, mmafter->uordblks);
|
printf("uordblks %8x %8x\n", mmbefore->uordblks, mmafter->uordblks);
|
||||||
printf("fordblks %8x %8x\n", mmbefore->fordblks, mmafter->fordblks);
|
printf("fordblks %8x %8x\n", mmbefore->fordblks, mmafter->fordblks);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
# define show_memory_usage(mm1, mm2)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: check_test_memory_usage
|
* Name: check_test_memory_usage
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef CONFIG_DISABLE_SIGNALS
|
|
||||||
static void check_test_memory_usage(void)
|
static void check_test_memory_usage(void)
|
||||||
{
|
{
|
||||||
/* Wait a little bit to let any threads terminate */
|
/* Wait a little bit to let any threads terminate */
|
||||||
@ -171,9 +164,6 @@ static void check_test_memory_usage(void)
|
|||||||
|
|
||||||
dump_nfreeholders("user_main:");
|
dump_nfreeholders("user_main:");
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
# define check_test_memory_usage()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: show_variable
|
* Name: show_variable
|
||||||
@ -238,7 +228,6 @@ static int user_main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Sample the memory usage now */
|
/* Sample the memory usage now */
|
||||||
|
|
||||||
#ifndef CONFIG_DISABLE_SIGNALS
|
|
||||||
usleep(HALF_SECOND_USEC);
|
usleep(HALF_SECOND_USEC);
|
||||||
|
|
||||||
#ifdef CONFIG_CAN_PASS_STRUCTS
|
#ifdef CONFIG_CAN_PASS_STRUCTS
|
||||||
@ -247,7 +236,6 @@ static int user_main(int argc, char *argv[])
|
|||||||
#else
|
#else
|
||||||
(void)mallinfo(&g_mmbefore);
|
(void)mallinfo(&g_mmbefore);
|
||||||
memcpy(&g_mmprevious, &g_mmbefore, sizeof(struct mallinfo));
|
memcpy(&g_mmprevious, &g_mmbefore, sizeof(struct mallinfo));
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
printf("\nuser_main: Begin argument test\n");
|
printf("\nuser_main: Begin argument test\n");
|
||||||
@ -424,7 +412,7 @@ static int user_main(int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(CONFIG_DISABLE_SIGNALS) && !defined(CONFIG_DISABLE_PTHREAD)
|
#ifndef CONFIG_DISABLE_PTHREAD
|
||||||
/* Verify pthreads and condition variable timed waits */
|
/* Verify pthreads and condition variable timed waits */
|
||||||
|
|
||||||
printf("\nuser_main: timed wait test\n");
|
printf("\nuser_main: timed wait test\n");
|
||||||
@ -448,7 +436,6 @@ static int user_main(int argc, char *argv[])
|
|||||||
check_test_memory_usage();
|
check_test_memory_usage();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_DISABLE_SIGNALS
|
|
||||||
/* Verify that we can modify the signal mask */
|
/* Verify that we can modify the signal mask */
|
||||||
|
|
||||||
printf("\nuser_main: sigprocmask test\n");
|
printf("\nuser_main: sigprocmask test\n");
|
||||||
@ -464,9 +451,8 @@ static int user_main(int argc, char *argv[])
|
|||||||
printf("\nuser_main: nested signal handler test\n");
|
printf("\nuser_main: nested signal handler test\n");
|
||||||
signest_test();
|
signest_test();
|
||||||
check_test_memory_usage();
|
check_test_memory_usage();
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(CONFIG_DISABLE_POSIX_TIMERS) && !defined(CONFIG_DISABLE_SIGNALS)
|
#ifndef CONFIG_DISABLE_POSIX_TIMERS
|
||||||
/* Verify posix timers (with SIGEV_SIGNAL) */
|
/* Verify posix timers (with SIGEV_SIGNAL) */
|
||||||
|
|
||||||
printf("\nuser_main: POSIX timer test\n");
|
printf("\nuser_main: POSIX timer test\n");
|
||||||
@ -506,16 +492,15 @@ static int user_main(int argc, char *argv[])
|
|||||||
check_test_memory_usage();
|
check_test_memory_usage();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_PRIORITY_INHERITANCE) && !defined(CONFIG_DISABLE_SIGNALS) && !defined(CONFIG_DISABLE_PTHREAD)
|
#if defined(CONFIG_PRIORITY_INHERITANCE) && !defined(CONFIG_DISABLE_PTHREAD)
|
||||||
/* Verify priority inheritance */
|
/* Verify priority inheritance */
|
||||||
|
|
||||||
printf("\nuser_main: priority inheritance test\n");
|
printf("\nuser_main: priority inheritance test\n");
|
||||||
priority_inheritance();
|
priority_inheritance();
|
||||||
check_test_memory_usage();
|
check_test_memory_usage();
|
||||||
#endif /* CONFIG_PRIORITY_INHERITANCE && !CONFIG_DISABLE_SIGNALS && !CONFIG_DISABLE_PTHREAD */
|
#endif /* CONFIG_PRIORITY_INHERITANCE && !CONFIG_DISABLE_PTHREAD */
|
||||||
|
|
||||||
#if defined(CONFIG_ARCH_HAVE_VFORK) && defined(CONFIG_SCHED_WAITPID) && \
|
#if defined(CONFIG_ARCH_HAVE_VFORK) && defined(CONFIG_SCHED_WAITPID)
|
||||||
!defined(CONFIG_DISABLE_SIGNALS)
|
|
||||||
printf("\nuser_main: vfork() test\n");
|
printf("\nuser_main: vfork() test\n");
|
||||||
vfork_test();
|
vfork_test();
|
||||||
#endif
|
#endif
|
||||||
@ -526,7 +511,6 @@ static int user_main(int argc, char *argv[])
|
|||||||
* leaks.
|
* leaks.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_DISABLE_SIGNALS
|
|
||||||
usleep(HALF_SECOND_USEC);
|
usleep(HALF_SECOND_USEC);
|
||||||
|
|
||||||
#ifdef CONFIG_CAN_PASS_STRUCTS
|
#ifdef CONFIG_CAN_PASS_STRUCTS
|
||||||
@ -537,7 +521,6 @@ static int user_main(int argc, char *argv[])
|
|||||||
|
|
||||||
printf("\nFinal memory usage:\n");
|
printf("\nFinal memory usage:\n");
|
||||||
show_memory_usage(&g_mmbefore, &g_mmafter);
|
show_memory_usage(&g_mmbefore, &g_mmafter);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("user_main: Exitting\n");
|
printf("user_main: Exitting\n");
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/ostest/prioinherit.c
|
* examples/ostest/prioinherit.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2009, 2011, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
#include "ostest.h"
|
#include "ostest.h"
|
||||||
|
|
||||||
#if defined(CONFIG_PRIORITY_INHERITANCE) && !defined(CONFIG_DISABLE_SIGNALS) && !defined(CONFIG_DISABLE_PTHREAD)
|
#if defined(CONFIG_PRIORITY_INHERITANCE) && !defined(CONFIG_DISABLE_PTHREAD)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@ -392,7 +392,7 @@ static void *lowpri_thread(void *parameter)
|
|||||||
g_lowstate[threadno-1] = DONE;
|
g_lowstate[threadno-1] = DONE;
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_PRIORITY_INHERITANCE && !CONFIG_DISABLE_SIGNALS && !CONFIG_DISABLE_PTHREAD */
|
#endif /* CONFIG_PRIORITY_INHERITANCE && !CONFIG_DISABLE_PTHREAD */
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
@ -404,7 +404,7 @@ static void *lowpri_thread(void *parameter)
|
|||||||
|
|
||||||
void priority_inheritance(void)
|
void priority_inheritance(void)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_PRIORITY_INHERITANCE) && !defined(CONFIG_DISABLE_SIGNALS) && !defined(CONFIG_DISABLE_PTHREAD)
|
#if defined(CONFIG_PRIORITY_INHERITANCE) && !defined(CONFIG_DISABLE_PTHREAD)
|
||||||
pthread_t lowpri[NLOWPRI_THREADS];
|
pthread_t lowpri[NLOWPRI_THREADS];
|
||||||
pthread_t medpri;
|
pthread_t medpri;
|
||||||
pthread_t highpri[NHIGHPRI_THREADS];
|
pthread_t highpri[NHIGHPRI_THREADS];
|
||||||
@ -573,5 +573,5 @@ void priority_inheritance(void)
|
|||||||
sem_destroy(&g_sem);
|
sem_destroy(&g_sem);
|
||||||
dump_nfreeholders("priority_inheritance:");
|
dump_nfreeholders("priority_inheritance:");
|
||||||
FFLUSH();
|
FFLUSH();
|
||||||
#endif /* CONFIG_PRIORITY_INHERITANCE && !CONFIG_DISABLE_SIGNALS && !CONFIG_DISABLE_PTHREAD */
|
#endif /* CONFIG_PRIORITY_INHERITANCE && !CONFIG_DISABLE_PTHREAD */
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/ostest/vfork.c
|
* examples/ostest/vfork.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -47,12 +47,7 @@
|
|||||||
|
|
||||||
#include "ostest.h"
|
#include "ostest.h"
|
||||||
|
|
||||||
#if defined(CONFIG_ARCH_HAVE_VFORK) && defined(CONFIG_SCHED_WAITPID) && \
|
#if defined(CONFIG_ARCH_HAVE_VFORK) && defined(CONFIG_SCHED_WAITPID)
|
||||||
!defined(CONFIG_DISABLE_SIGNALS)
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Pre-processor Definitions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
@ -101,4 +96,4 @@ int vfork_test(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_ARCH_HAVE_VFORK && CONFIG_SCHED_WAITPID && !CONFIG_DISABLE_SIGNALS */
|
#endif /* CONFIG_ARCH_HAVE_VFORK && CONFIG_SCHED_WAITPID */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user