mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-23 06:36:45 +08:00
configs/sim/nxwm now uses kconfig-frontends
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5449 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
+5
-2
@@ -3805,6 +3805,9 @@
|
||||
* graphics/: Adds 5x8 monospace font. This tiny font is useful for graph
|
||||
labels and for small bitmapped display. Contributed by Petteri
|
||||
Aimonen.
|
||||
* configs/stm3220g-eval/nxwm: Converted to use the kconfig-fronteds
|
||||
* configs/stm3220g-eval/nxwm: Converted to use the kconfig-frontends
|
||||
configuration tool.
|
||||
|
||||
* configs/sim/nxwm: Converted to use the kconfig-frontends configuration
|
||||
tool.
|
||||
* include/pthread.h: In sys/prctl.h because it is needed by
|
||||
pthread_[set|get]name_np()
|
||||
|
||||
@@ -50,7 +50,7 @@ config SIM_FRAMEBUFFER
|
||||
config SIM_X11FB
|
||||
bool "Use X11 window"
|
||||
default n
|
||||
depends on NX && FB_CMAP
|
||||
depends on NX
|
||||
---help---
|
||||
Use an X11 graphics window to simulate the graphics device"
|
||||
|
||||
|
||||
@@ -461,46 +461,57 @@ nxwm
|
||||
|
||||
nuttx-code/NxWidgets/UnitTests/READEM.txt
|
||||
|
||||
NOTE: There is an issue with running this example under the
|
||||
simulation. In the default configuration, this example will
|
||||
run the NxConsole example which waits on readline() for console
|
||||
intput. When it calls readline(), the whole system blocks
|
||||
waiting from input from the host OS. So, in order to get
|
||||
this example to run, you must comment out the readline call in
|
||||
apps/nshlib/nsh_consolemain.c like:
|
||||
NOTES
|
||||
-----
|
||||
1. This configuration uses the mconf-based configuration tool. To
|
||||
change this configuration using that tool, you should:
|
||||
|
||||
Index: nsh_consolemain.c
|
||||
===================================================================
|
||||
--- nsh_consolemain.c (revision 4681)
|
||||
+++ nsh_consolemain.c (working copy)
|
||||
@@ -117,7 +117,8 @@
|
||||
/* Execute the startup script */
|
||||
a. Build and install the mconf tool. See nuttx/README.txt and
|
||||
misc/tools/
|
||||
|
||||
b. Execute 'make menuconfig' in nuttx/ in order to start the
|
||||
reconfiguration process.
|
||||
|
||||
2. There is an issue with running this example under the
|
||||
simulation. In the default configuration, this example will
|
||||
run the NxConsole example which waits on readline() for console
|
||||
input. When it calls readline(), the whole system blocks
|
||||
waiting from input from the host OS. So, in order to get
|
||||
this example to run, you must comment out the readline call in
|
||||
apps/nshlib/nsh_consolemain.c like:
|
||||
|
||||
Index: nsh_consolemain.c
|
||||
===================================================================
|
||||
--- nsh_consolemain.c (revision 4681)
|
||||
+++ nsh_consolemain.c (working copy)
|
||||
@@ -117,7 +117,8 @@
|
||||
/* Execute the startup script */
|
||||
|
||||
#ifdef CONFIG_NSH_ROMFSETC
|
||||
- (void)nsh_script(&pstate->cn_vtbl, "init", NSH_INITPATH);
|
||||
+// REMOVE ME
|
||||
+// (void)nsh_script(&pstate->cn_vtbl, "init", NSH_INITPATH);
|
||||
#endif
|
||||
#ifdef CONFIG_NSH_ROMFSETC
|
||||
- (void)nsh_script(&pstate->cn_vtbl, "init", NSH_INITPATH);
|
||||
+// REMOVE ME
|
||||
+// (void)nsh_script(&pstate->cn_vtbl, "init", NSH_INITPATH);
|
||||
#endif
|
||||
|
||||
/* Then enter the command line parsing loop */
|
||||
@@ -130,7 +131,8 @@
|
||||
fflush(pstate->cn_outstream);
|
||||
/* Then enter the command line parsing loop */
|
||||
@@ -130,7 +131,8 @@
|
||||
fflush(pstate->cn_outstream);
|
||||
|
||||
/* Get the next line of input */
|
||||
-
|
||||
+sleep(2); // REMOVE ME
|
||||
+#if 0 // REMOVE ME
|
||||
ret = readline(pstate->cn_line, CONFIG_NSH_LINELEN,
|
||||
INSTREAM(pstate), OUTSTREAM(pstate));
|
||||
if (ret > 0)
|
||||
@@ -153,6 +155,7 @@
|
||||
"readline", NSH_ERRNO_OF(-ret));
|
||||
nsh_exit(&pstate->cn_vtbl, 1);
|
||||
}
|
||||
+#endif // REMOVE ME
|
||||
}
|
||||
/* Get the next line of input */
|
||||
-
|
||||
+sleep(2); // REMOVE ME
|
||||
+#if 0 // REMOVE ME
|
||||
ret = readline(pstate->cn_line, CONFIG_NSH_LINELEN,
|
||||
INSTREAM(pstate), OUTSTREAM(pstate));
|
||||
if (ret > 0)
|
||||
@@ -153,6 +155,7 @@
|
||||
"readline", NSH_ERRNO_OF(-ret));
|
||||
nsh_exit(&pstate->cn_vtbl, 1);
|
||||
}
|
||||
+#endif // REMOVE ME
|
||||
}
|
||||
|
||||
/* Clean up */
|
||||
/* Clean up */
|
||||
|
||||
ostest
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
############################################################################
|
||||
# configs/sim/nxwm/appconfig
|
||||
#
|
||||
# Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
# The NSH Library
|
||||
|
||||
CONFIGURED_APPS += system/readline
|
||||
CONFIGURED_APPS += nshlib
|
||||
|
||||
+579
-281
File diff suppressed because it is too large
Load Diff
+76
-72
@@ -44,6 +44,8 @@
|
||||
#include <nuttx/compiler.h> /* Compiler settings, noreturn_function */
|
||||
|
||||
#include <sys/types.h> /* Needed for general types */
|
||||
#include <sys/prctl.h> /* Needed by pthread_[set|get]name_np */
|
||||
|
||||
#include <stdint.h> /* C99 fixed width integer types */
|
||||
#include <stdbool.h> /* C99 boolean types */
|
||||
#include <unistd.h> /* For getpid */
|
||||
@@ -58,10 +60,11 @@
|
||||
/* Standard POSIX switches */
|
||||
|
||||
#ifndef _POSIX_THREADS
|
||||
#define _POSIX_THREADS
|
||||
# define _POSIX_THREADS
|
||||
#endif
|
||||
|
||||
#ifndef _POSIX_THREAD_ATTR_STACKSIZE
|
||||
#define _POSIX_THREAD_ATTR_STACKSIZE
|
||||
# define _POSIX_THREAD_ATTR_STACKSIZE
|
||||
#endif
|
||||
|
||||
/********************************************************************************
|
||||
@@ -153,10 +156,8 @@
|
||||
********************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C" {
|
||||
#else
|
||||
#define EXTERN extern
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* pthread-specific types */
|
||||
@@ -245,28 +246,29 @@ struct sched_param; /* Defined in sched.h */
|
||||
* the individual attributes used by a given implementation.
|
||||
*/
|
||||
|
||||
EXTERN int pthread_attr_init(FAR pthread_attr_t *attr);
|
||||
int pthread_attr_init(FAR pthread_attr_t *attr);
|
||||
|
||||
/* An attributes object can be deleted when it is no longer needed. */
|
||||
|
||||
EXTERN int pthread_attr_destroy(pthread_attr_t *attr);
|
||||
int pthread_attr_destroy(pthread_attr_t *attr);
|
||||
|
||||
/* Set or obtain the default scheduling algorithm */
|
||||
|
||||
EXTERN int pthread_attr_setschedpolicy(FAR pthread_attr_t *attr, int policy);
|
||||
EXTERN int pthread_attr_getschedpolicy(FAR pthread_attr_t *attr, int *policy);
|
||||
EXTERN int pthread_attr_setschedparam(FAR pthread_attr_t *attr,
|
||||
FAR const struct sched_param *param);
|
||||
EXTERN int pthread_attr_getschedparam(FAR pthread_attr_t *attr,
|
||||
FAR struct sched_param *param);
|
||||
EXTERN int pthread_attr_setinheritsched(FAR pthread_attr_t *attr, int inheritsched);
|
||||
EXTERN int pthread_attr_getinheritsched(FAR const pthread_attr_t *attr,
|
||||
FAR int *inheritsched);
|
||||
int pthread_attr_setschedpolicy(FAR pthread_attr_t *attr, int policy);
|
||||
int pthread_attr_getschedpolicy(FAR pthread_attr_t *attr, int *policy);
|
||||
int pthread_attr_setschedparam(FAR pthread_attr_t *attr,
|
||||
FAR const struct sched_param *param);
|
||||
int pthread_attr_getschedparam(FAR pthread_attr_t *attr,
|
||||
FAR struct sched_param *param);
|
||||
int pthread_attr_setinheritsched(FAR pthread_attr_t *attr,
|
||||
int inheritsched);
|
||||
int pthread_attr_getinheritsched(FAR const pthread_attr_t *attr,
|
||||
FAR int *inheritsched);
|
||||
|
||||
/* Set or obtain the default stack size */
|
||||
|
||||
EXTERN int pthread_attr_setstacksize(FAR pthread_attr_t *attr, long stacksize);
|
||||
EXTERN int pthread_attr_getstacksize(FAR pthread_attr_t *attr, long *stackaddr);
|
||||
int pthread_attr_setstacksize(FAR pthread_attr_t *attr, long stacksize);
|
||||
int pthread_attr_getstacksize(FAR pthread_attr_t *attr, long *stackaddr);
|
||||
|
||||
/* To create a thread object and runnable thread, a routine must be specified
|
||||
* as the new thread's start routine. An argument may be passed to this
|
||||
@@ -275,34 +277,33 @@ EXTERN int pthread_attr_getstacksize(FAR pthread_attr_t *attr, long *stackaddr);
|
||||
* about the kind of thread being created.
|
||||
*/
|
||||
|
||||
EXTERN int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr,
|
||||
pthread_startroutine_t startroutine,
|
||||
pthread_addr_t arg);
|
||||
int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr,
|
||||
pthread_startroutine_t startroutine, pthread_addr_t arg);
|
||||
|
||||
/* A thread object may be "detached" to specify that the return value and
|
||||
* completion status will not be requested.
|
||||
*/
|
||||
|
||||
EXTERN int pthread_detach(pthread_t thread);
|
||||
int pthread_detach(pthread_t thread);
|
||||
|
||||
/* A thread may terminate it's own execution or the execution of another
|
||||
* thread.
|
||||
*/
|
||||
|
||||
EXTERN void pthread_exit(pthread_addr_t value) noreturn_function;
|
||||
EXTERN int pthread_cancel(pthread_t thread);
|
||||
EXTERN int pthread_setcancelstate(int state, FAR int *oldstate);
|
||||
EXTERN void pthread_testcancel(void);
|
||||
void pthread_exit(pthread_addr_t value) noreturn_function;
|
||||
int pthread_cancel(pthread_t thread);
|
||||
int pthread_setcancelstate(int state, FAR int *oldstate);
|
||||
void pthread_testcancel(void);
|
||||
|
||||
/* A thread can await termination of another thread and retrieve the return
|
||||
* value of the thread.
|
||||
*/
|
||||
|
||||
EXTERN int pthread_join(pthread_t thread, FAR pthread_addr_t *value);
|
||||
int pthread_join(pthread_t thread, FAR pthread_addr_t *value);
|
||||
|
||||
/* A thread may tell the scheduler that its processor can be made available. */
|
||||
|
||||
EXTERN void pthread_yield(void);
|
||||
void pthread_yield(void);
|
||||
|
||||
/* A thread may obtain a copy of its own thread handle. */
|
||||
|
||||
@@ -314,91 +315,94 @@ EXTERN void pthread_yield(void);
|
||||
|
||||
/* Thread scheduling parameters */
|
||||
|
||||
EXTERN int pthread_getschedparam(pthread_t thread, FAR int *policy,
|
||||
FAR struct sched_param *param);
|
||||
EXTERN int pthread_setschedparam(pthread_t thread, int policy,
|
||||
FAR const struct sched_param *param);
|
||||
EXTERN int pthread_setschedprio(pthread_t thread, int prio);
|
||||
int pthread_getschedparam(pthread_t thread, FAR int *policy,
|
||||
FAR struct sched_param *param);
|
||||
int pthread_setschedparam(pthread_t thread, int policy,
|
||||
FAR const struct sched_param *param);
|
||||
int pthread_setschedprio(pthread_t thread, int prio);
|
||||
|
||||
/* Thread-specific Data Interfaces */
|
||||
|
||||
EXTERN int pthread_key_create(FAR pthread_key_t *key,
|
||||
CODE void (*destructor)(FAR void*));
|
||||
EXTERN int pthread_setspecific(pthread_key_t key, FAR void *value);
|
||||
EXTERN FAR void *pthread_getspecific(pthread_key_t key);
|
||||
EXTERN int pthread_key_delete(pthread_key_t key);
|
||||
int pthread_key_create(FAR pthread_key_t *key,
|
||||
CODE void (*destructor)(FAR void*));
|
||||
int pthread_setspecific(pthread_key_t key, FAR void *value);
|
||||
FAR void *pthread_getspecific(pthread_key_t key);
|
||||
int pthread_key_delete(pthread_key_t key);
|
||||
|
||||
/* Create, operate on, and destroy mutex attributes. */
|
||||
|
||||
EXTERN int pthread_mutexattr_init(FAR pthread_mutexattr_t *attr);
|
||||
EXTERN int pthread_mutexattr_destroy(FAR pthread_mutexattr_t *attr);
|
||||
EXTERN int pthread_mutexattr_getpshared(FAR pthread_mutexattr_t *attr, FAR int *pshared);
|
||||
EXTERN int pthread_mutexattr_setpshared(FAR pthread_mutexattr_t *attr, int pshared);
|
||||
int pthread_mutexattr_init(FAR pthread_mutexattr_t *attr);
|
||||
int pthread_mutexattr_destroy(FAR pthread_mutexattr_t *attr);
|
||||
int pthread_mutexattr_getpshared(FAR pthread_mutexattr_t *attr,
|
||||
FAR int *pshared);
|
||||
int pthread_mutexattr_setpshared(FAR pthread_mutexattr_t *attr,
|
||||
int pshared);
|
||||
#ifdef CONFIG_MUTEX_TYPES
|
||||
EXTERN int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type);
|
||||
EXTERN int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type);
|
||||
int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type);
|
||||
int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type);
|
||||
#endif
|
||||
|
||||
/* The following routines create, delete, lock and unlock mutexes. */
|
||||
|
||||
EXTERN int pthread_mutex_init(FAR pthread_mutex_t *mutex, FAR pthread_mutexattr_t *attr);
|
||||
EXTERN int pthread_mutex_destroy(FAR pthread_mutex_t *mutex);
|
||||
EXTERN int pthread_mutex_lock(FAR pthread_mutex_t *mutex);
|
||||
EXTERN int pthread_mutex_trylock(FAR pthread_mutex_t *mutex);
|
||||
EXTERN int pthread_mutex_unlock(FAR pthread_mutex_t *mutex);
|
||||
int pthread_mutex_init(FAR pthread_mutex_t *mutex,
|
||||
FAR pthread_mutexattr_t *attr);
|
||||
int pthread_mutex_destroy(FAR pthread_mutex_t *mutex);
|
||||
int pthread_mutex_lock(FAR pthread_mutex_t *mutex);
|
||||
int pthread_mutex_trylock(FAR pthread_mutex_t *mutex);
|
||||
int pthread_mutex_unlock(FAR pthread_mutex_t *mutex);
|
||||
|
||||
/* Operations on condition variables */
|
||||
|
||||
EXTERN int pthread_condattr_init(FAR pthread_condattr_t *attr);
|
||||
EXTERN int pthread_condattr_destroy(FAR pthread_condattr_t *attr);
|
||||
int pthread_condattr_init(FAR pthread_condattr_t *attr);
|
||||
int pthread_condattr_destroy(FAR pthread_condattr_t *attr);
|
||||
|
||||
/* A thread can create and delete condition variables. */
|
||||
|
||||
EXTERN int pthread_cond_init(FAR pthread_cond_t *cond, FAR pthread_condattr_t *attr);
|
||||
EXTERN int pthread_cond_destroy(FAR pthread_cond_t *cond);
|
||||
int pthread_cond_init(FAR pthread_cond_t *cond, FAR pthread_condattr_t *attr);
|
||||
int pthread_cond_destroy(FAR pthread_cond_t *cond);
|
||||
|
||||
/* A thread can signal to and broadcast on a condition variable. */
|
||||
|
||||
EXTERN int pthread_cond_broadcast(FAR pthread_cond_t *cond);
|
||||
EXTERN int pthread_cond_signal(FAR pthread_cond_t *cond);
|
||||
int pthread_cond_broadcast(FAR pthread_cond_t *cond);
|
||||
int pthread_cond_signal(FAR pthread_cond_t *cond);
|
||||
|
||||
/* A thread can wait for a condition variable to be signalled or broadcast. */
|
||||
|
||||
EXTERN int pthread_cond_wait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex);
|
||||
int pthread_cond_wait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex);
|
||||
|
||||
/* A thread can perform a timed wait on a condition variable. */
|
||||
|
||||
EXTERN int pthread_cond_timedwait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex,
|
||||
FAR const struct timespec *abstime);
|
||||
int pthread_cond_timedwait(FAR pthread_cond_t *cond,
|
||||
FAR pthread_mutex_t *mutex,
|
||||
FAR const struct timespec *abstime);
|
||||
|
||||
/* Barrier attributes */
|
||||
|
||||
EXTERN int pthread_barrierattr_destroy(FAR pthread_barrierattr_t *attr);
|
||||
EXTERN int pthread_barrierattr_init(FAR pthread_barrierattr_t *attr);
|
||||
EXTERN int pthread_barrierattr_getpshared(FAR const pthread_barrierattr_t *attr,
|
||||
FAR int *pshared);
|
||||
EXTERN int pthread_barrierattr_setpshared(FAR pthread_barrierattr_t *attr,
|
||||
int pshared);
|
||||
int pthread_barrierattr_destroy(FAR pthread_barrierattr_t *attr);
|
||||
int pthread_barrierattr_init(FAR pthread_barrierattr_t *attr);
|
||||
int pthread_barrierattr_getpshared(FAR const pthread_barrierattr_t *attr,
|
||||
FAR int *pshared);
|
||||
int pthread_barrierattr_setpshared(FAR pthread_barrierattr_t *attr,
|
||||
int pshared);
|
||||
|
||||
/* Barriers */
|
||||
|
||||
EXTERN int pthread_barrier_destroy(FAR pthread_barrier_t *barrier);
|
||||
EXTERN int pthread_barrier_init(FAR pthread_barrier_t *barrier,
|
||||
int pthread_barrier_destroy(FAR pthread_barrier_t *barrier);
|
||||
int pthread_barrier_init(FAR pthread_barrier_t *barrier,
|
||||
FAR const pthread_barrierattr_t *attr,
|
||||
unsigned int count);
|
||||
EXTERN int pthread_barrier_wait(FAR pthread_barrier_t *barrier);
|
||||
int pthread_barrier_wait(FAR pthread_barrier_t *barrier);
|
||||
|
||||
/* Pthread initialization */
|
||||
|
||||
EXTERN int pthread_once(FAR pthread_once_t *once_control,
|
||||
int pthread_once(FAR pthread_once_t *once_control,
|
||||
CODE void (*init_routine)(void));
|
||||
|
||||
/* Pthread signal management APIs */
|
||||
|
||||
EXTERN int pthread_kill(pthread_t thread, int sig);
|
||||
EXTERN int pthread_sigmask(int how, FAR const sigset_t *set, FAR sigset_t *oset);
|
||||
int pthread_kill(pthread_t thread, int sig);
|
||||
int pthread_sigmask(int how, FAR const sigset_t *set, FAR sigset_t *oset);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user