forked from nuttx/nuttx-update
First round of changes to get the ELF configuration building again
This commit is contained in:
parent
62a11fde1d
commit
925fc9ad81
16 changed files with 37 additions and 48 deletions
|
@ -51,7 +51,7 @@
|
|||
#include "mmu.h"
|
||||
#include "pgalloc.h"
|
||||
|
||||
#if defined(CONFIG_MM_PGALLOC) && defined(CONFIG_ARCH_USE_MMU)
|
||||
#ifdef CONFIG_BUILD_KERNEL
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -317,4 +317,4 @@ uintptr_t pgalloc(uintptr_t brkaddr, unsigned int npages)
|
|||
return brkaddr;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_MM_PGALLOC && CONFIG_ARCH_USE_MMU */
|
||||
#endif /* CONFIG_BUILD_KERNEL */
|
||||
|
|
|
@ -99,7 +99,7 @@ int task_init(FAR struct tcb_s *tcb, const char *name, int priority,
|
|||
FAR char * const argv[]);
|
||||
int task_activate(FAR struct tcb_s *tcb);
|
||||
|
||||
#ifndef CONFIG_ARCH_ADDRENV
|
||||
#ifndef CONFIG_BUILD_KERNEL
|
||||
int task_create(FAR const char *name, int priority, int stack_size,
|
||||
main_t entry, FAR char * const argv[]);
|
||||
#endif
|
||||
|
|
|
@ -89,7 +89,7 @@ struct posix_spawnattr_s
|
|||
sigset_t sigmask; /* Signals to be masked */
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_ARCH_ADDRENV
|
||||
#ifndef CONFIG_BUILD_KERNEL
|
||||
/* Used only by task_spawn (non-standard) */
|
||||
|
||||
size_t stacksize; /* Task stack size */
|
||||
|
@ -141,7 +141,7 @@ int posix_spawn(FAR pid_t *pid, FAR const char *path,
|
|||
posix_spawn(pid,path,file_actions,attr,argv,envp)
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_ARCH_ADDRENV
|
||||
#ifndef CONFIG_BUILD_KERNEL
|
||||
/* Non-standard task_spawn interface. This function uses the same
|
||||
* semantics to execute a file in memory at 'entry', giving it the name
|
||||
* 'name'.
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
* address environments.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_ARCH_ADDRENV
|
||||
#ifndef CONFIG_BUILD_KERNEL
|
||||
# define SYS_task_create (CONFIG_SYS_RESERVED+22)
|
||||
# define __SYS_task_delete (CONFIG_SYS_RESERVED+23)
|
||||
|
||||
|
@ -102,11 +102,9 @@
|
|||
* allocator selected. MMU support from the CPU is also required.
|
||||
*/
|
||||
|
||||
#elif defined(CONFIG_MM_PGALLOC) && defined(CONFIG_ARCH_USE_MMU)
|
||||
#else
|
||||
# define SYS_pgalloc (CONFIG_SYS_RESERVED+22)
|
||||
# define __SYS_task_delete (CONFIG_SYS_RESERVED+23)
|
||||
#else
|
||||
# define __SYS_task_delete (CONFIG_SYS_RESERVED+22)
|
||||
#endif
|
||||
|
||||
# define SYS_task_delete __SYS_task_delete
|
||||
|
|
|
@ -50,7 +50,7 @@ ifneq ($(CONFIG_DISABLE_SIGNALS),y)
|
|||
CSRCS += lib_psa_getsigmask.c lib_psa_setsigmask.c
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_ARCH_ADDRENV),y)
|
||||
ifneq ($(CONFIG_BUILD_KERNEL),y)
|
||||
CSRCS += lib_psa_getstacksize.c lib_psa_setstacksize.c
|
||||
endif
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include <spawn.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifndef CONFIG_ARCH_ADDRENV
|
||||
#ifndef CONFIG_BUILD_KERNEL
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
@ -75,4 +75,4 @@ int task_spawnattr_getstacksize(FAR const posix_spawnattr_t *attr,
|
|||
return OK;
|
||||
}
|
||||
|
||||
#endif /* !CONFIG_ARCH_ADDRENV */
|
||||
#endif /* !CONFIG_BUILD_KERNEL */
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include <spawn.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifndef CONFIG_ARCH_ADDRENV
|
||||
#ifndef CONFIG_BUILD_KERNEL
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
@ -74,4 +74,4 @@ int task_spawnattr_setstacksize(FAR posix_spawnattr_t *attr, size_t stacksize)
|
|||
return OK;
|
||||
}
|
||||
|
||||
#endif /* !CONFIG_ARCH_ADDRENV */
|
||||
#endif /* !CONFIG_BUILD_KERNEL */
|
||||
|
|
|
@ -41,8 +41,7 @@
|
|||
|
||||
#include <nuttx/mm.h>
|
||||
|
||||
#if defined(CONFIG_MM_KERNEL_HEAP) && defined(CONFIG_ARCH_ADDRENV) && \
|
||||
defined(CONFIG_MM_PGALLOC) && defined(CONFIG_ARCH_USE_MMU)
|
||||
#if defined(CONFIG_BUILD_KERNEL) && defined(__KERNEL__)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -89,4 +88,4 @@ FAR void *kmm_sbrk(intptr_t incr)
|
|||
return mm_sbrk(&g_kmmheap, incr, UINTPTR_MAX);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_MM_KERNEL_HEAP && CONFIG_ARCH_ADDRENV && ... */
|
||||
#endif /* CONFIG_BUILD_KERNEL && __KERNEL__ */
|
||||
|
|
|
@ -47,8 +47,7 @@
|
|||
#include <nuttx/mm.h>
|
||||
#include <nuttx/pgalloc.h>
|
||||
|
||||
#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_MM_PGALLOC) && \
|
||||
defined(CONFIG_ARCH_USE_MMU)
|
||||
#ifdef CONFIG_BUILD_KERNEL
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -166,4 +165,4 @@ errout:
|
|||
set_errno(err);
|
||||
return (FAR void *)-1;
|
||||
}
|
||||
#endif /* CONFIG_ARCH_ADDRENV && CONFIG_MM_PGALLOC && CONFIG_ARCH_USE_MMU */
|
||||
#endif /* CONFIG_BUILD_KERNEL */
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_BUILD_KERNEL)
|
||||
#ifdef CONFIG_BUILD_KERNEL
|
||||
/* In the kernel build, there a multiple user heaps; one for each task
|
||||
* group. In this build configuration, the user heap structure lies
|
||||
* in a reserved region at the beginning of the .bss/.data address
|
||||
|
@ -103,7 +103,7 @@
|
|||
|
||||
FAR void *malloc(size_t size)
|
||||
{
|
||||
#ifdef CONFIG_ARCH_ADDRENV
|
||||
#ifdef CONFIG_BUILD_KERNEL
|
||||
FAR void *brkaddr;
|
||||
FAR void *mem;
|
||||
|
||||
|
|
|
@ -42,17 +42,15 @@
|
|||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/mm.h>
|
||||
#include <nuttx/addrenv.h>
|
||||
#include <nuttx/pgalloc.h>
|
||||
|
||||
#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_MM_PGALLOC) && \
|
||||
defined(CONFIG_ARCH_USE_MMU) && (!defined(CONFIG_BUILD_PROTECTED) || \
|
||||
!defined(__KERNEL__))
|
||||
#if defined(CONFIG_BUILD_KERNEL) && !defined(__KERNEL__)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_BUILD_KERNEL)
|
||||
/* In the kernel build, there a multiple user heaps; one for each task
|
||||
* group. In this build configuration, the user heap structure lies
|
||||
* in a reserved region at the beginning of the .bss/.data address
|
||||
|
@ -60,14 +58,7 @@
|
|||
* ARCH_DATA_RESERVE_SIZE
|
||||
*/
|
||||
|
||||
# include <nuttx/addrenv.h>
|
||||
# define USR_HEAP (&ARCH_DATA_RESERVE->ar_usrheap)
|
||||
|
||||
#else
|
||||
/* Otherwise, the user heap data structures are in common .bss */
|
||||
|
||||
# define USR_HEAP &g_mmheap
|
||||
#endif
|
||||
#define USR_HEAP (&ARCH_DATA_RESERVE->ar_usrheap)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
@ -110,4 +101,4 @@ FAR void *sbrk(intptr_t incr)
|
|||
return mm_sbrk(USR_HEAP, incr, CONFIG_ARCH_HEAP_NPAGES << MM_PGSHIFT);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ARCH_ADDRENV && CONFIG_MM_PGALLOC && ... */
|
||||
#endif /* CONFIG_BUILD_KERNEL && !__KERNEL__ */
|
||||
|
|
|
@ -33,11 +33,10 @@
|
|||
#
|
||||
############################################################################
|
||||
|
||||
TSK_SRCS = task_create.c task_init.c task_setup.c task_activate.c
|
||||
TSK_SRCS += task_start.c task_delete.c task_exit.c task_exithook.c
|
||||
TSK_SRCS += task_recover.c task_restart.c task_spawnparms.c
|
||||
TSK_SRCS += task_terminate.c task_getgroup.c task_prctl.c task_getpid.c
|
||||
TSK_SRCS += exit.c
|
||||
TSK_SRCS = task_init.c task_setup.c task_activate.c task_start.c
|
||||
TSK_SRCS += task_delete.c task_exit.c task_exithook.c task_recover.c
|
||||
TSK_SRCS += task_restart.c task_spawnparms.c task_terminate.c
|
||||
TSK_SRCS += task_getgroup.c task_prctl.c task_getpid.c exit.c
|
||||
|
||||
ifeq ($(CONFIG_ARCH_HAVE_VFORK),y)
|
||||
ifeq ($(CONFIG_SCHED_WAITPID),y)
|
||||
|
@ -45,8 +44,8 @@ TSK_SRCS += task_vfork.c
|
|||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_ARCH_ADDRENV),y)
|
||||
TSK_SRCS += task_spawn.c
|
||||
ifneq ($(CONFIG_BUILD_KERNEL),y)
|
||||
TSK_SRCS += task_create.c task_spawn.c
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_BINFMT_DISABLE),y)
|
||||
|
|
|
@ -52,6 +52,8 @@
|
|||
#include "group/group.h"
|
||||
#include "task/task.h"
|
||||
|
||||
#ifndef CONFIG_BUILD_KERNEL
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
****************************************************************************/
|
||||
|
@ -270,3 +272,4 @@ int kernel_thread(FAR const char *name, int priority,
|
|||
return thread_create(name, TCB_FLAG_TTYPE_KERNEL, priority, stack_size, entry, argv);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BUILD_KERNEL */
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
#include "task/spawn.h"
|
||||
#include "task/task.h"
|
||||
|
||||
#ifndef CONFIG_ARCH_ADDRENV
|
||||
#ifndef CONFIG_BUILD_KERNEL
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -455,4 +455,4 @@ errout_with_lock:
|
|||
return ret;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ARCH_ADDRENV */
|
||||
#endif /* CONFIG_BUILD_KERNEL */
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
"nanosleep","time.h","!defined(CONFIG_DISABLE_SIGNALS)","int","FAR const struct timespec *", "FAR struct timespec*"
|
||||
"open","fcntl.h","CONFIG_NFILE_DESCRIPTORS > 0","int","const char*","int","..."
|
||||
"opendir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","FAR DIR*","FAR const char*"
|
||||
"pgalloc", "nuttx/arch.h", "defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_MM_PGALLOC) && defined(CONFIG_ARCH_USE_MMU)", "uintptr_t", "uintptr_t", "unsigned int"
|
||||
"pgalloc", "nuttx/arch.h", "defined(CONFIG_BUILD_KERNEL)", "uintptr_t", "uintptr_t", "unsigned int"
|
||||
"pipe","unistd.h","CONFIG_NFILE_DESCRIPTORS > 0","int","int [2]|int*"
|
||||
"poll","poll.h","!defined(CONFIG_DISABLE_POLL) && (CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0)","int","FAR struct pollfd*","nfds_t","int"
|
||||
"prctl","sys/prctl.h", "CONFIG_TASK_NAME_SIZE > 0","int","int","..."
|
||||
|
@ -124,7 +124,7 @@
|
|||
"stat","sys/stat.h","CONFIG_NFILE_DESCRIPTORS > 0","int","const char*","FAR struct stat*"
|
||||
#"statfs","stdio.h","","int","FAR const char*","FAR struct statfs*"
|
||||
"statfs","sys/statfs.h","CONFIG_NFILE_DESCRIPTORS > 0","int","const char*","struct statfs*"
|
||||
"task_create","sched.h","!defined(CONFIG_ARCH_ADDRENV)","int","FAR const char*","int","int","main_t","FAR char * const []|FAR char * const *"
|
||||
"task_create","sched.h","!defined(CONFIG_BUILD_KERNEL)", "int","FAR const char*","int","int","main_t","FAR char * const []|FAR char * const *"
|
||||
#"task_create","sched.h","","int","const char*","int","main_t","FAR char * const []|FAR char * const *"
|
||||
"task_delete","sched.h","","int","pid_t"
|
||||
"task_restart","sched.h","","int","pid_t"
|
||||
|
|
Can't render this file because it has a wrong number of fields in line 2.
|
|
@ -65,9 +65,9 @@ SYSCALL_LOOKUP(sem_trywait, 1, STUB_sem_trywait)
|
|||
SYSCALL_LOOKUP(sem_unlink, 1, STUB_sem_unlink)
|
||||
SYSCALL_LOOKUP(sem_wait, 1, STUB_sem_wait)
|
||||
SYSCALL_LOOKUP(set_errno, 1, STUB_set_errno)
|
||||
#ifndef CONFIG_ARCH_ADDRENV
|
||||
#ifndef CONFIG_BUILD_KERNEL
|
||||
SYSCALL_LOOKUP(task_create, 5, STUB_task_create)
|
||||
#elif defined(CONFIG_MM_PGALLOC) && defined(CONFIG_ARCH_USE_MMU)
|
||||
#else
|
||||
SYSCALL_LOOKUP(pgalloc, 2, STUB_pgalloc)
|
||||
#endif
|
||||
SYSCALL_LOOKUP(task_delete, 1, STUB_task_delete)
|
||||
|
|
Loading…
Reference in a new issue