Add SYSCALL support for pgalloc()
This commit is contained in:
parent
a5af2568eb
commit
8b082a167b
@ -695,7 +695,8 @@ void up_allocate_pgheap(FAR void **heap_start, size_t *heap_size);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ARCH_ADDRENV
|
||||
#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_MM_PGALLOC) && \
|
||||
defined(CONFIG_ARCH_USE_MMU)
|
||||
uintptr_t pgalloc(uintptr_t brkaddr, unsigned int npages);
|
||||
#endif
|
||||
|
||||
|
@ -90,19 +90,30 @@
|
||||
#define SYS_sem_wait (CONFIG_SYS_RESERVED+20)
|
||||
#define SYS_set_errno (CONFIG_SYS_RESERVED+21)
|
||||
|
||||
/* Task creation APIs based on global entry points cannot be use with
|
||||
* address environments.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_ARCH_ADDRENV
|
||||
# define SYS_task_create (CONFIG_SYS_RESERVED+22)
|
||||
# define SYS_task_delete (CONFIG_SYS_RESERVED+23)
|
||||
# define SYS_task_restart (CONFIG_SYS_RESERVED+24)
|
||||
# define SYS_up_assert (CONFIG_SYS_RESERVED+25)
|
||||
# define __SYS_vfork (CONFIG_SYS_RESERVED+26)
|
||||
# define __SYS_task_delete (CONFIG_SYS_RESERVED+23)
|
||||
|
||||
/* pgalloc() is only available with address environments with the page
|
||||
* allocator selected. MMU support from the CPU is also required.
|
||||
*/
|
||||
|
||||
#elif defined(CONFIG_MM_PGALLOC) && defined(CONFIG_ARCH_USE_MMU)
|
||||
# define SYS_pgalloc (CONFIG_SYS_RESERVED+22)
|
||||
# define __SYS_task_delete (CONFIG_SYS_RESERVED+23)
|
||||
#else
|
||||
# define SYS_task_delete (CONFIG_SYS_RESERVED+22)
|
||||
# define SYS_task_restart (CONFIG_SYS_RESERVED+23)
|
||||
# define SYS_up_assert (CONFIG_SYS_RESERVED+24)
|
||||
# define __SYS_vfork (CONFIG_SYS_RESERVED+25)
|
||||
# define __SYS_task_delete (CONFIG_SYS_RESERVED+22)
|
||||
#endif
|
||||
|
||||
# define SYS_task_delete __SYS_task_delete
|
||||
# define SYS_task_restart (__SYS_task_delete+1)
|
||||
# define SYS_up_assert (__SYS_task_delete+2)
|
||||
# define __SYS_vfork (__SYS_task_delete+3)
|
||||
|
||||
/* The following can be individually enabled */
|
||||
|
||||
#ifdef CONFIG_ARCH_HAVE_VFORK
|
||||
|
@ -43,6 +43,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"
|
||||
"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","..."
|
||||
|
Can't render this file because it has a wrong number of fields in line 2.
|
@ -67,6 +67,8 @@ SYSCALL_LOOKUP(sem_wait, 1, STUB_sem_wait)
|
||||
SYSCALL_LOOKUP(set_errno, 1, STUB_set_errno)
|
||||
#ifndef CONFIG_ARCH_ADDRENV
|
||||
SYSCALL_LOOKUP(task_create, 5, STUB_task_create)
|
||||
#elif defined(CONFIG_MM_PGALLOC) && defined(CONFIG_ARCH_USE_MMU)
|
||||
SYSCALL_LOOKUP(pgalloc, 2, STUB_pgalloc)
|
||||
#endif
|
||||
SYSCALL_LOOKUP(task_delete, 1, STUB_task_delete)
|
||||
SYSCALL_LOOKUP(task_restart, 1, STUB_task_restart)
|
||||
|
@ -85,6 +85,7 @@ uintptr_t STUB_sem_trywait(int nbr, uintptr_t parm1);
|
||||
uintptr_t STUB_sem_unlink(int nbr, uintptr_t parm1);
|
||||
uintptr_t STUB_sem_wait(int nbr, uintptr_t parm1);
|
||||
uintptr_t STUB_set_errno(int nbr, uintptr_t parm1);
|
||||
uintptr_t STUB_pgalloc(int nbr, uintptr_t parm1, uintptr_t parm2);
|
||||
uintptr_t STUB_task_create(int nbr, uintptr_t parm1, uintptr_t parm2,
|
||||
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5);
|
||||
uintptr_t STUB_task_delete(int nbr, uintptr_t parm1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user