From f2f9740189ee65f3cda41cf20c618cc13626f681 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 1 Aug 2012 17:47:54 +0000 Subject: [PATCH] atexit() and on_exit() may now be configured to support multiple exit callbacks git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4995 7fd9a85b-ad96-42d3-883c-3090e2eb8679 --- nuttx/ChangeLog | 3 + nuttx/Documentation/NuttxPortingGuide.html | 18 ++ nuttx/Documentation/NuttxUserGuide.html | 271 ++++++++++++++++++++- nuttx/TODO | 12 +- nuttx/arch/arm/src/lpc17xx/lpc17_lowputc.c | 6 +- nuttx/arch/arm/src/lpc17xx/lpc17_serial.c | 4 +- nuttx/include/nuttx/sched.h | 24 +- nuttx/include/sys/syscall.h | 11 +- nuttx/sched/atexit.c | 88 +++++-- nuttx/sched/on_exit.c | 92 +++++-- nuttx/sched/task_exithook.c | 203 +++++++++++---- nuttx/syscall/stub_lookup.h | 4 + nuttx/syscall/syscall.csv | 1 + 13 files changed, 617 insertions(+), 120 deletions(-) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 3684728eb..3dc1dc527 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3096,4 +3096,7 @@ * arch/*/src/*_serial.c: Fix ioctl method return values. Theses methods should return a negated errno value; they should not set the errno variable. + * sched/on_exit.c, sched/task_exithook.c, and include/nuttx/sched.c: Add + support for multiple registered on_exit() functions if CONFIG_SCHED_ONEXIT_MAX + is defined. diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html index d3689da49..c4a6c90a7 100644 --- a/nuttx/Documentation/NuttxPortingGuide.html +++ b/nuttx/Documentation/NuttxPortingGuide.html @@ -4063,6 +4063,24 @@ build CONFIG_SIG_SIGWORK: The signal number that will be used to wake-up the worker thread. Default: 4 + +
  • + CONFIG_SCHED_WAITPID: Enables the waitpid() API +
  • +
  • + CONFIG_SCHED_ATEXIT: Enables the atexit() API +
  • +
  • + CONFIG_SCHED_ATEXIT_MAX: By default if CONFIG_SCHED_ATEXIT is selected, only a single atexit() function is supported. + That number can be increased by defined this setting to the number that you require. +
  • +
  • + CONFIG_SCHED_ONEXIT: Enables the on_exit() API +
  • +
  • + CONFIG_SCHED_ONEXIT_MAX: By default if CONFIG_SCHED_ONEXIT is selected, only a single on_exit() function is supported. + That number can be increased by defined this setting to the number that you require. +
  • diff --git a/nuttx/Documentation/NuttxUserGuide.html b/nuttx/Documentation/NuttxUserGuide.html index 9d3af1c27..457347727 100644 --- a/nuttx/Documentation/NuttxUserGuide.html +++ b/nuttx/Documentation/NuttxUserGuide.html @@ -13,7 +13,7 @@

    NuttX Operating System

    User's Manual

    by

    Gregory Nutt

    -

    Last Updated: March 23, 2012

    +

    Last Updated: August 1, 2012

    @@ -54,7 +54,7 @@