2013-03-06 20:56:32 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* syscall/syscall_stublookup.c
|
|
|
|
*
|
2020-05-03 22:16:36 +02:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2013-03-06 20:56:32 +01:00
|
|
|
*
|
2020-05-03 22:16:36 +02:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2013-03-06 20:56:32 +01:00
|
|
|
*
|
2020-05-03 22:16:36 +02:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2013-03-06 20:56:32 +01:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
2013-12-11 23:49:48 +01:00
|
|
|
|
|
|
|
#include <sys/types.h>
|
2013-03-06 20:56:32 +01:00
|
|
|
#include <syscall.h>
|
|
|
|
|
|
|
|
/* The content of this file is only meaningful during the kernel phase of
|
|
|
|
* a kernel build.
|
|
|
|
*/
|
|
|
|
|
2014-08-30 22:26:56 +02:00
|
|
|
#if defined(CONFIG_LIB_SYSCALL)
|
2013-03-06 20:56:32 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Stub Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* These first system calls are supported regardless of the NuttX
|
|
|
|
* configuration
|
|
|
|
*/
|
|
|
|
|
|
|
|
uintptr_t STUB__exit(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_exit(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_get_errno(int nbr);
|
|
|
|
uintptr_t STUB_getpid(int nbr);
|
2020-01-31 21:25:15 +01:00
|
|
|
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_sched_getparam(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_sched_getscheduler(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_sched_lock(int nbr);
|
|
|
|
uintptr_t STUB_sched_lockcount(int nbr);
|
|
|
|
uintptr_t STUB_sched_rr_get_interval(int nbr, uintptr_t parm1,
|
|
|
|
uintptr_t parm2);
|
|
|
|
uintptr_t STUB_sched_setparam(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_sched_setscheduler(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
uintptr_t STUB_sched_unlock(int nbr);
|
|
|
|
uintptr_t STUB_sched_yield(int nbr);
|
2020-05-04 08:49:38 +02:00
|
|
|
uintptr_t STUB_sched_get_stackinfo(int nbr, uintptr_t parm1,
|
|
|
|
uintptr_t parm2);
|
2020-02-09 08:38:50 +01:00
|
|
|
|
|
|
|
uintptr_t STUB_sched_getaffinity(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
2020-01-31 21:25:15 +01:00
|
|
|
uintptr_t STUB_sched_getcpu(int nbr);
|
2020-02-09 08:38:50 +01:00
|
|
|
uintptr_t STUB_sched_setaffinity(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
2020-01-31 21:25:15 +01:00
|
|
|
|
2015-07-05 18:41:58 +02:00
|
|
|
uintptr_t STUB_set_errno(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_uname(int nbr, uintptr_t parm1);
|
2014-10-09 03:37:10 +02:00
|
|
|
|
2019-08-06 22:13:43 +02:00
|
|
|
/* User identity */
|
|
|
|
|
|
|
|
uintptr_t STUB_setuid(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_getuid(int nbr);
|
|
|
|
uintptr_t STUB_setgid(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_getgid(int nbr);
|
|
|
|
|
2014-10-09 03:37:10 +02:00
|
|
|
/* Semaphores */
|
|
|
|
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_sem_close(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_sem_destroy(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_sem_open(int nbr, uintptr_t parm1, uintptr_t parm2,
|
Improve proxy/stub parameter passing for variadic OS interfaces.
In the past a very low effort interface was used:
- All parmeters were treated as though they were type uinptr_t, and
- The maximum number of parmeters (6) was passed in all cases.
The first is potentially wrong and the second is very inefficient. This commit improves this by:
- Making tools/mksyscall.c more intelligent, and
- Extending the syntax for variadic functions.
For example, in syscall.cvs, the open() API was represened like this:
"open","fcntl.h","","int","const char*","int","..."
In reality, open may take only a single optional argument of type mode_t which is not the same size as uintptr_t. And there is not reason to pass 6 parameters in that case.
And this has been extended to:
"open","fcntl.h","","int","const char*","int","...","mode_t"
The existence of the "mode_t" tells tools/mksyscall that there is at most one optional parameter and, if present, it is of type mode_t.
2020-05-05 23:02:07 +02:00
|
|
|
uintptr_t parm3, uintptr_t parm4);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_sem_post(int nbr, uintptr_t parm1);
|
2016-11-02 16:05:18 +01:00
|
|
|
uintptr_t STUB_sem_setprotocol(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2013-12-28 19:04:39 +01:00
|
|
|
uintptr_t STUB_sem_timedwait(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2013-03-06 20:56:32 +01:00
|
|
|
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);
|
2016-11-02 16:05:18 +01:00
|
|
|
|
2014-09-02 16:29:44 +02:00
|
|
|
uintptr_t STUB_pgalloc(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_task_create(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5);
|
2019-08-23 21:20:52 +02:00
|
|
|
uintptr_t STUB_nx_task_spawn(int nbr, uintptr_t parm1);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_task_delete(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_task_restart(int nbr, uintptr_t parm1);
|
2016-12-10 22:16:46 +01:00
|
|
|
uintptr_t STUB_task_setcancelstate(int nbr, uintptr_t parm1,
|
|
|
|
uintptr_t parm2);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_up_assert(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
|
2016-12-10 23:06:14 +01:00
|
|
|
uintptr_t STUB_task_setcanceltype(int nbr, uintptr_t parm1,
|
|
|
|
uintptr_t parm2);
|
2016-12-10 23:34:14 +01:00
|
|
|
uintptr_t STUB_task_testcancel(int nbr);
|
2016-12-10 23:06:14 +01:00
|
|
|
|
2013-03-06 20:56:32 +01:00
|
|
|
/* The following can be individually enabled */
|
|
|
|
|
|
|
|
uintptr_t STUB_vfork(int nbr);
|
|
|
|
uintptr_t STUB_atexit(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_on_exit(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_waitpid(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
uintptr_t STUB_wait(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_waitid(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4);
|
|
|
|
|
2015-12-12 18:11:09 +01:00
|
|
|
/* The following can only be defined if we are configured to load
|
|
|
|
* OS modules from a file system.
|
|
|
|
*/
|
|
|
|
|
2015-12-13 15:12:28 +01:00
|
|
|
uintptr_t STUB_insmod(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2015-12-12 18:11:09 +01:00
|
|
|
uintptr_t STUB_rmmod(int nbr, uintptr_t parm1);
|
2017-01-22 21:26:22 +01:00
|
|
|
uintptr_t STUB_modhandle(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2015-12-12 18:11:09 +01:00
|
|
|
|
2013-03-06 20:56:32 +01:00
|
|
|
/* The following can only be defined if we are configured to execute
|
|
|
|
* programs from a file system.
|
|
|
|
*/
|
|
|
|
|
2017-10-03 15:09:35 +02:00
|
|
|
uintptr_t STUB_exec(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_posix_spawn(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5,
|
|
|
|
uintptr_t parm6);
|
|
|
|
uintptr_t STUB_posix_spawnp(int nbr, uintptr_t parm1, uintptr_t parm2,
|
2013-03-07 02:52:30 +01:00
|
|
|
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5,
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t parm6);
|
|
|
|
uintptr_t STUB_execv(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
|
|
|
|
/* The following are only defined is signals are supported in the NuttX
|
|
|
|
* configuration.
|
|
|
|
*/
|
|
|
|
|
|
|
|
uintptr_t STUB_kill(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_sigaction(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
uintptr_t STUB_sigpending(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_sigprocmask(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
uintptr_t STUB_sigqueue(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
uintptr_t STUB_sigsuspend(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_sigtimedwait(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
uintptr_t STUB_sigwaitinfo(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2017-11-12 00:44:59 +01:00
|
|
|
uintptr_t STUB_clock_nanosleep(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4);
|
2013-03-06 20:56:32 +01:00
|
|
|
|
|
|
|
/* The following are only defined if the system clock is enabled in the
|
|
|
|
* NuttX configuration.
|
|
|
|
*/
|
|
|
|
|
2018-06-16 20:50:28 +02:00
|
|
|
uintptr_t STUB_clock(int nbr);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_clock_getres(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_clock_gettime(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_clock_settime(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2016-07-11 00:55:32 +02:00
|
|
|
uintptr_t STUB_adjtime(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2013-03-06 20:56:32 +01:00
|
|
|
|
|
|
|
/* The following are defined only if POSIX timers are supported */
|
|
|
|
|
|
|
|
uintptr_t STUB_timer_create(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
uintptr_t STUB_timer_delete(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_timer_getoverrun(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_timer_gettime(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_timer_settime(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4);
|
2019-11-14 22:10:04 +01:00
|
|
|
uintptr_t STUB_getitimer(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_setitimer(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
2013-03-06 20:56:32 +01:00
|
|
|
|
2016-06-19 15:03:44 +02:00
|
|
|
/* System logging */
|
|
|
|
|
2018-03-04 15:07:07 +01:00
|
|
|
uintptr_t STUB_nx_vsyslog(int nbr, uintptr_t parm1, uintptr_t parm2,
|
2016-06-21 00:11:50 +02:00
|
|
|
uintptr_t parm3);
|
2016-06-19 15:03:44 +02:00
|
|
|
|
2013-03-06 20:56:32 +01:00
|
|
|
/* The following are defined if either file or socket descriptor are
|
|
|
|
* enabled.
|
|
|
|
*/
|
|
|
|
|
|
|
|
uintptr_t STUB_close(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_ioctl(int nbr, uintptr_t parm1, uintptr_t parm2,
|
Improve proxy/stub parameter passing for variadic OS interfaces.
In the past a very low effort interface was used:
- All parmeters were treated as though they were type uinptr_t, and
- The maximum number of parmeters (6) was passed in all cases.
The first is potentially wrong and the second is very inefficient. This commit improves this by:
- Making tools/mksyscall.c more intelligent, and
- Extending the syntax for variadic functions.
For example, in syscall.cvs, the open() API was represened like this:
"open","fcntl.h","","int","const char*","int","..."
In reality, open may take only a single optional argument of type mode_t which is not the same size as uintptr_t. And there is not reason to pass 6 parameters in that case.
And this has been extended to:
"open","fcntl.h","","int","const char*","int","...","mode_t"
The existence of the "mode_t" tells tools/mksyscall that there is at most one optional parameter and, if present, it is of type mode_t.
2020-05-05 23:02:07 +02:00
|
|
|
uintptr_t parm3);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_read(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
uintptr_t STUB_write(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
2014-10-04 15:31:45 +02:00
|
|
|
uintptr_t STUB_pread(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4);
|
|
|
|
uintptr_t STUB_pwrite(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4);
|
|
|
|
uintptr_t STUB_poll(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
uintptr_t STUB_select(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5);
|
2018-11-08 14:45:23 +01:00
|
|
|
uintptr_t STUB_ppoll(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4);
|
|
|
|
uintptr_t STUB_pselect(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5,
|
|
|
|
uintptr_t parm6);
|
2013-03-06 20:56:32 +01:00
|
|
|
|
2018-06-25 20:41:28 +02:00
|
|
|
/* Asynchronous I/O */
|
|
|
|
|
2014-10-05 23:59:02 +02:00
|
|
|
uintptr_t STUB_aio_read(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_aio_write(int nbr, uintptr_t parm1);
|
2014-10-06 00:58:52 +02:00
|
|
|
uintptr_t STUB_aio_fsync(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_aio_cancel(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2014-10-05 23:59:02 +02:00
|
|
|
|
2018-06-25 20:41:28 +02:00
|
|
|
/* Network interface indices */
|
|
|
|
|
|
|
|
uintptr_t STUB_if_indextoname(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_if_nametoindex(int nbr, uintptr_t parm1);
|
|
|
|
|
|
|
|
/* Termios */
|
|
|
|
|
2017-10-06 18:55:36 +02:00
|
|
|
uintptr_t STUB_tcdrain(int nbr, uintptr_t parm1);
|
|
|
|
|
2015-03-31 19:25:52 +02:00
|
|
|
/* Board support */
|
|
|
|
|
2015-03-31 19:59:16 +02:00
|
|
|
uintptr_t STUB_boardctl(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2015-03-31 19:25:52 +02:00
|
|
|
|
2013-03-06 20:56:32 +01:00
|
|
|
/* The following are defined if file descriptors are enabled */
|
|
|
|
|
|
|
|
uintptr_t STUB_closedir(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_dup(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_dup2(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_fcntl(int nbr, uintptr_t parm1, uintptr_t parm2,
|
2020-05-06 17:36:16 +02:00
|
|
|
uintptr_t parm3);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_lseek(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
uintptr_t STUB_mmap(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5,
|
|
|
|
uintptr_t parm6);
|
2019-04-04 18:54:46 +02:00
|
|
|
uintptr_t STUB_munmap(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_open(int nbr, uintptr_t parm1, uintptr_t parm2,
|
Improve proxy/stub parameter passing for variadic OS interfaces.
In the past a very low effort interface was used:
- All parmeters were treated as though they were type uinptr_t, and
- The maximum number of parmeters (6) was passed in all cases.
The first is potentially wrong and the second is very inefficient. This commit improves this by:
- Making tools/mksyscall.c more intelligent, and
- Extending the syntax for variadic functions.
For example, in syscall.cvs, the open() API was represened like this:
"open","fcntl.h","","int","const char*","int","..."
In reality, open may take only a single optional argument of type mode_t which is not the same size as uintptr_t. And there is not reason to pass 6 parameters in that case.
And this has been extended to:
"open","fcntl.h","","int","const char*","int","...","mode_t"
The existence of the "mode_t" tells tools/mksyscall that there is at most one optional parameter and, if present, it is of type mode_t.
2020-05-05 23:02:07 +02:00
|
|
|
uintptr_t parm3);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_opendir(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_readdir(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_rewinddir(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_seekdir(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_stat(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2017-02-14 17:44:01 +01:00
|
|
|
uintptr_t STUB_fstat(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_statfs(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2017-02-17 15:46:07 +01:00
|
|
|
uintptr_t STUB_fstatfs(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_telldir(int nbr, uintptr_t parm1);
|
|
|
|
|
2017-02-03 00:11:08 +01:00
|
|
|
uintptr_t STUB_link(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2017-02-03 20:57:12 +01:00
|
|
|
uintptr_t STUB_readlink(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
2017-02-03 00:11:08 +01:00
|
|
|
|
2020-05-04 08:49:38 +02:00
|
|
|
uintptr_t STUB_nx_pipe(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_nx_mkfifo(int nbr, uintptr_t parm1, uintptr_t parm2,
|
2016-07-20 23:26:54 +02:00
|
|
|
uintptr_t parm3);
|
|
|
|
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_fs_fdopen(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
uintptr_t STUB_sched_getstreams(int nbr);
|
|
|
|
|
2013-09-28 22:47:49 +02:00
|
|
|
ssize_t sendfile(int outfd, int infd, FAR off_t *offset, size_t count);
|
|
|
|
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_fsync(int nbr, uintptr_t parm1);
|
2018-01-03 23:03:56 +01:00
|
|
|
uintptr_t STUB_ftruncate(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_mkdir(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_mount(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5);
|
|
|
|
uintptr_t STUB_rename(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_rmdir(int nbr, uintptr_t parm1);
|
2015-05-18 17:02:28 +02:00
|
|
|
uintptr_t STUB_umount2(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_unlink(int nbr, uintptr_t parm1);
|
|
|
|
|
2014-09-22 23:24:09 +02:00
|
|
|
/* Shared memory interfaces */
|
|
|
|
|
|
|
|
uintptr_t STUB_shmget(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
uintptr_t STUB_shmat(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
uintptr_t STUB_shmctl(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
uintptr_t STUB_shmdt(int nbr, uintptr_t parm1);
|
|
|
|
|
2013-03-06 20:56:32 +01:00
|
|
|
/* The following are defined if pthreads are enabled */
|
|
|
|
|
|
|
|
uintptr_t STUB_pthread_cancel(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_pthread_cond_broadcast(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_pthread_cond_signal(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_pthread_cond_wait(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_pthread_create(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4);
|
|
|
|
uintptr_t STUB_pthread_detach(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_pthread_exit(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_pthread_getschedparam(int nbr, uintptr_t parm1,
|
|
|
|
uintptr_t parm2, uintptr_t parm3);
|
|
|
|
uintptr_t STUB_pthread_getspecific(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_pthread_join(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_pthread_key_create(int nbr, uintptr_t parm1,
|
|
|
|
uintptr_t parm2);
|
|
|
|
uintptr_t STUB_pthread_key_delete(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_pthread_mutex_destroy(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_pthread_mutex_init(int nbr, uintptr_t parm1,
|
|
|
|
uintptr_t parm2);
|
2019-02-26 01:19:13 +01:00
|
|
|
uintptr_t STUB_pthread_mutex_timedlock(int nbr, uintptr_t parm1,
|
|
|
|
uintptr_t parm2);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_pthread_mutex_trylock(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_pthread_mutex_unlock(int nbr, uintptr_t parm1);
|
2017-03-27 17:36:03 +02:00
|
|
|
uintptr_t STUB_pthread_mutex_consistent(int nbr, uintptr_t parm1);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_pthread_setschedparam(int nbr, uintptr_t parm1,
|
|
|
|
uintptr_t parm2, uintptr_t parm3);
|
|
|
|
uintptr_t STUB_pthread_setschedprio(int nbr, uintptr_t parm1,
|
|
|
|
uintptr_t parm2);
|
|
|
|
uintptr_t STUB_pthread_setspecific(int nbr, uintptr_t parm1,
|
|
|
|
uintptr_t parm2);
|
|
|
|
|
2020-05-07 09:25:18 +02:00
|
|
|
uintptr_t STUB_pthread_setaffinity_np(int nbr, uintptr_t parm1,
|
2016-02-20 01:13:06 +01:00
|
|
|
uintptr_t parm2, uintptr_t parm3);
|
2020-05-07 09:25:18 +02:00
|
|
|
uintptr_t STUB_pthread_getaffinity_np(int nbr, uintptr_t parm1,
|
2016-02-20 01:13:06 +01:00
|
|
|
uintptr_t parm2, uintptr_t parm3);
|
|
|
|
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_pthread_cond_timedwait(int nbr, uintptr_t parm1,
|
|
|
|
uintptr_t parm2, uintptr_t parm3);
|
|
|
|
uintptr_t STUB_pthread_kill(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_pthread_sigmask(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
|
2016-12-08 16:27:13 +01:00
|
|
|
uintptr_t STUB_pthread_cleanup_pop(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_pthread_cleanup_push(int nbr, uintptr_t parm1,
|
|
|
|
uintptr_t parm2);
|
|
|
|
|
2013-03-06 20:56:32 +01:00
|
|
|
/* The following are defined only if message queues are enabled */
|
|
|
|
|
|
|
|
uintptr_t STUB_mq_close(int nbr, uintptr_t parm1);
|
2015-06-03 17:24:17 +02:00
|
|
|
uintptr_t STUB_mq_getattr(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_mq_notify(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_mq_open(int nbr, uintptr_t parm1, uintptr_t parm2,
|
Improve proxy/stub parameter passing for variadic OS interfaces.
In the past a very low effort interface was used:
- All parmeters were treated as though they were type uinptr_t, and
- The maximum number of parmeters (6) was passed in all cases.
The first is potentially wrong and the second is very inefficient. This commit improves this by:
- Making tools/mksyscall.c more intelligent, and
- Extending the syntax for variadic functions.
For example, in syscall.cvs, the open() API was represened like this:
"open","fcntl.h","","int","const char*","int","..."
In reality, open may take only a single optional argument of type mode_t which is not the same size as uintptr_t. And there is not reason to pass 6 parameters in that case.
And this has been extended to:
"open","fcntl.h","","int","const char*","int","...","mode_t"
The existence of the "mode_t" tells tools/mksyscall that there is at most one optional parameter and, if present, it is of type mode_t.
2020-05-05 23:02:07 +02:00
|
|
|
uintptr_t parm3, uintptr_t parm4);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_mq_receive(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4);
|
|
|
|
uintptr_t STUB_mq_send(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4);
|
2015-06-03 17:24:17 +02:00
|
|
|
uintptr_t STUB_mq_setattr(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_mq_timedreceive(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5);
|
|
|
|
uintptr_t STUB_mq_timedsend(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5);
|
|
|
|
uintptr_t STUB_mq_unlink(int nbr, uintptr_t parm1);
|
|
|
|
|
|
|
|
/* The following are defined only if environment variables are supported */
|
|
|
|
|
|
|
|
uintptr_t STUB_clearenv(int nbr);
|
|
|
|
uintptr_t STUB_getenv(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_putenv(int nbr, uintptr_t parm1);
|
|
|
|
uintptr_t STUB_setenv(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
uintptr_t STUB_unsetenv(int nbr, uintptr_t parm1);
|
|
|
|
|
2015-07-10 23:41:20 +02:00
|
|
|
/* The following are defined only if netb is supported */
|
2015-07-05 16:40:56 +02:00
|
|
|
|
|
|
|
uintptr_t STUB_sethostname(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
|
2013-03-06 20:56:32 +01:00
|
|
|
/* The following are defined only if networking AND sockets are supported */
|
|
|
|
|
|
|
|
uintptr_t STUB_accept(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
uintptr_t STUB_bind(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
uintptr_t STUB_connect(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
2018-07-19 15:30:01 +02:00
|
|
|
uintptr_t STUB_getpeername(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
uintptr_t STUB_getsockname(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
2013-03-06 20:56:32 +01:00
|
|
|
uintptr_t STUB_getsockopt(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5);
|
|
|
|
uintptr_t STUB_listen(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
uintptr_t STUB_recv(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4);
|
|
|
|
uintptr_t STUB_recvfrom(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5,
|
|
|
|
uintptr_t parm6);
|
|
|
|
uintptr_t STUB_send(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4);
|
|
|
|
uintptr_t STUB_sendto(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5,
|
|
|
|
uintptr_t parm6);
|
|
|
|
uintptr_t STUB_setsockopt(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5);
|
|
|
|
uintptr_t STUB_socket(int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3);
|
|
|
|
|
|
|
|
/* The following is defined only if CONFIG_TASK_NAME_SIZE > 0 */
|
|
|
|
|
Improve proxy/stub parameter passing for variadic OS interfaces.
In the past a very low effort interface was used:
- All parmeters were treated as though they were type uinptr_t, and
- The maximum number of parmeters (6) was passed in all cases.
The first is potentially wrong and the second is very inefficient. This commit improves this by:
- Making tools/mksyscall.c more intelligent, and
- Extending the syntax for variadic functions.
For example, in syscall.cvs, the open() API was represened like this:
"open","fcntl.h","","int","const char*","int","..."
In reality, open may take only a single optional argument of type mode_t which is not the same size as uintptr_t. And there is not reason to pass 6 parameters in that case.
And this has been extended to:
"open","fcntl.h","","int","const char*","int","...","mode_t"
The existence of the "mode_t" tells tools/mksyscall that there is at most one optional parameter and, if present, it is of type mode_t.
2020-05-05 23:02:07 +02:00
|
|
|
uintptr_t STUB_prctl(int nbr, uintptr_t parm1, uintptr_t parm2);
|
2013-03-06 20:56:32 +01:00
|
|
|
|
2017-03-30 15:38:37 +02:00
|
|
|
/* The following is defined only if entropy pool random number generator
|
2020-02-09 14:32:52 +01:00
|
|
|
* is enabled.
|
|
|
|
*/
|
2017-03-30 15:38:37 +02:00
|
|
|
|
|
|
|
uintptr_t STUB_getrandom(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|
|
|
|
2013-03-06 20:56:32 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Public Data
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* Stub lookup tables. This table is indexed by the system call number.
|
|
|
|
* Given the system call number, the corresponding entry in this table
|
|
|
|
* provides the address of the stub function.
|
|
|
|
*/
|
|
|
|
|
|
|
|
const uintptr_t g_stublookup[SYS_nsyscalls] =
|
|
|
|
{
|
|
|
|
# define SYSCALL_LOOKUP1(f,n,p) (uintptr_t)p
|
|
|
|
# define SYSCALL_LOOKUP(f,n,p) , (uintptr_t)p
|
2020-05-07 08:42:52 +02:00
|
|
|
# include <sys/syscall_lookup.h>
|
|
|
|
# undef SYSCALL_LOOKUP1
|
|
|
|
# undef SYSCALL_LOOKUP
|
2013-03-06 20:56:32 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
2014-08-30 22:26:56 +02:00
|
|
|
#endif /* CONFIG_LIB_SYSCALL */
|