2018-06-16 21:07:12 +02:00
|
|
|
/****************************************************************************
|
2011-03-28 23:21:11 +02:00
|
|
|
* include/sys/syscall.h
|
|
|
|
* This file contains the system call numbers.
|
|
|
|
*
|
2020-03-21 18:02:42 +01: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
|
2011-03-28 23:21:11 +02:00
|
|
|
*
|
2020-03-21 18:02:42 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2011-03-28 23:21:11 +02:00
|
|
|
*
|
2020-03-21 18:02:42 +01: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.
|
2011-03-28 23:21:11 +02:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __INCLUDE_SYS_SYSCALL_H
|
|
|
|
#define __INCLUDE_SYS_SYSCALL_H
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
2011-03-29 02:07:02 +02:00
|
|
|
#include <nuttx/config.h>
|
2011-04-06 17:04:57 +02:00
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
# include <stdint.h>
|
|
|
|
#endif
|
2011-03-29 02:07:02 +02:00
|
|
|
|
2022-02-25 08:40:21 +01:00
|
|
|
#include <arch/syscall.h>
|
|
|
|
|
2014-08-29 01:03:54 +02:00
|
|
|
#ifdef CONFIG_LIB_SYSCALL
|
2013-03-06 20:56:32 +01:00
|
|
|
|
2011-03-28 23:21:11 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Pre-processor Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
|
2011-04-06 17:04:57 +02:00
|
|
|
/* Note that the reported number of system calls does *NOT* include the
|
|
|
|
* architecture-specific system calls. If the "real" total is required,
|
|
|
|
* use SYS_maxsyscall.
|
|
|
|
*/
|
|
|
|
|
2020-05-07 08:42:52 +02:00
|
|
|
#define SYS_nsyscalls (SYS_maxsyscall - CONFIG_SYS_RESERVED)
|
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
2011-04-06 17:04:57 +02:00
|
|
|
|
2011-03-28 23:21:11 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Public Type Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
|
2020-05-07 08:42:52 +02:00
|
|
|
enum
|
|
|
|
{
|
2020-05-06 06:20:26 +02:00
|
|
|
# define SYSCALL_LOOKUP_(f) SYS_##f
|
|
|
|
# define SYSCALL_LOOKUP1(f,n) SYSCALL_LOOKUP_(f) = CONFIG_SYS_RESERVED
|
|
|
|
# define SYSCALL_LOOKUP(f,n) , SYSCALL_LOOKUP_(f)
|
2020-05-07 08:42:52 +02:00
|
|
|
# include "syscall_lookup.h"
|
|
|
|
, SYS_maxsyscall
|
|
|
|
# undef SYSCALL_LOOKUP_
|
|
|
|
# undef SYSCALL_LOOKUP1
|
|
|
|
# undef SYSCALL_LOOKUP
|
|
|
|
};
|
|
|
|
|
2011-03-28 23:21:11 +02:00
|
|
|
/****************************************************************************
|
2011-04-04 14:43:35 +02:00
|
|
|
* Public Data
|
2011-03-28 23:21:11 +02:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#define EXTERN extern "C"
|
2015-06-13 03:26:01 +02:00
|
|
|
extern "C"
|
|
|
|
{
|
2011-03-28 23:21:11 +02:00
|
|
|
#else
|
|
|
|
#define EXTERN extern
|
|
|
|
#endif
|
|
|
|
|
2020-07-07 07:56:04 +02:00
|
|
|
#ifdef CONFIG_LIB_SYSCALL
|
2013-03-06 20:56:32 +01:00
|
|
|
|
|
|
|
/* Given the system call number, the corresponding entry in this table
|
|
|
|
* provides the address of the stub function.
|
|
|
|
*
|
|
|
|
* This table is only available during the kernel phase of a kernel build.
|
|
|
|
*/
|
|
|
|
|
|
|
|
EXTERN const uintptr_t g_stublookup[SYS_nsyscalls];
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2020-07-22 15:21:42 +02:00
|
|
|
#ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
|
|
|
|
|
|
|
|
/* Given the system call number, the corresponding entry in this table
|
|
|
|
* provides the name of the function.
|
|
|
|
*/
|
|
|
|
|
|
|
|
EXTERN const char *g_funcnames[SYS_nsyscalls];
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2011-04-04 14:43:35 +02:00
|
|
|
/****************************************************************************
|
2020-02-09 14:32:52 +01:00
|
|
|
* Public Function Prototypes
|
2011-04-04 14:43:35 +02:00
|
|
|
****************************************************************************/
|
|
|
|
|
2011-03-28 23:21:11 +02:00
|
|
|
#undef EXTERN
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-04-06 17:04:57 +02:00
|
|
|
#endif /* __ASSEMBLY__ */
|
2014-08-29 22:47:22 +02:00
|
|
|
#endif /* CONFIG_LIB_SYSCALL */
|
2011-03-28 23:21:11 +02:00
|
|
|
#endif /* __INCLUDE_SYS_SYSCALL_H */
|