2018-06-16 13:07:12 -06:00
|
|
|
/****************************************************************************
|
2011-03-28 21:21:11 +00:00
|
|
|
* include/sys/syscall.h
|
|
|
|
* This file contains the system call numbers.
|
|
|
|
*
|
2020-03-21 11:02:42 -06: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 21:21:11 +00:00
|
|
|
*
|
2020-03-21 11:02:42 -06:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2011-03-28 21:21:11 +00:00
|
|
|
*
|
2020-03-21 11:02:42 -06: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 21:21:11 +00:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __INCLUDE_SYS_SYSCALL_H
|
|
|
|
#define __INCLUDE_SYS_SYSCALL_H
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
2011-03-29 00:07:02 +00:00
|
|
|
#include <nuttx/config.h>
|
2011-04-06 15:04:57 +00:00
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
# include <stdint.h>
|
|
|
|
#endif
|
2011-03-29 00:07:02 +00:00
|
|
|
|
2022-02-25 15:40:21 +08:00
|
|
|
#include <arch/syscall.h>
|
|
|
|
|
2014-08-28 17:03:54 -06:00
|
|
|
#ifdef CONFIG_LIB_SYSCALL
|
2013-03-06 19:56:32 +00:00
|
|
|
|
2011-03-28 21:21:11 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* Pre-processor Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
|
2011-04-06 15:04:57 +00: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 14:42:52 +08:00
|
|
|
#define SYS_nsyscalls (SYS_maxsyscall - CONFIG_SYS_RESERVED)
|
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
2011-04-06 15:04:57 +00:00
|
|
|
|
2011-03-28 21:21:11 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* Public Type Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
|
2020-05-07 14:42:52 +08:00
|
|
|
enum
|
|
|
|
{
|
2020-05-06 12:20:26 +08: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 14:42:52 +08:00
|
|
|
# include "syscall_lookup.h"
|
|
|
|
, SYS_maxsyscall
|
|
|
|
# undef SYSCALL_LOOKUP_
|
|
|
|
# undef SYSCALL_LOOKUP1
|
|
|
|
# undef SYSCALL_LOOKUP
|
|
|
|
};
|
|
|
|
|
2011-03-28 21:21:11 +00:00
|
|
|
/****************************************************************************
|
2011-04-04 12:43:35 +00:00
|
|
|
* Public Data
|
2011-03-28 21:21:11 +00:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#define EXTERN extern "C"
|
2015-06-12 19:26:01 -06:00
|
|
|
extern "C"
|
|
|
|
{
|
2011-03-28 21:21:11 +00:00
|
|
|
#else
|
|
|
|
#define EXTERN extern
|
|
|
|
#endif
|
|
|
|
|
2020-07-07 13:56:04 +08:00
|
|
|
#ifdef CONFIG_LIB_SYSCALL
|
2013-03-06 19:56:32 +00: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 22:21:42 +09:00
|
|
|
/* Given the system call number, the corresponding entry in this table
|
|
|
|
* provides the name of the function.
|
|
|
|
*/
|
|
|
|
|
|
|
|
EXTERN const char *g_funcnames[SYS_nsyscalls];
|
|
|
|
|
2011-04-04 12:43:35 +00:00
|
|
|
/****************************************************************************
|
2020-02-09 07:32:52 -06:00
|
|
|
* Public Function Prototypes
|
2011-04-04 12:43:35 +00:00
|
|
|
****************************************************************************/
|
|
|
|
|
2011-03-28 21:21:11 +00:00
|
|
|
#undef EXTERN
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-04-06 15:04:57 +00:00
|
|
|
#endif /* __ASSEMBLY__ */
|
2014-08-29 14:47:22 -06:00
|
|
|
#endif /* CONFIG_LIB_SYSCALL */
|
2011-03-28 21:21:11 +00:00
|
|
|
#endif /* __INCLUDE_SYS_SYSCALL_H */
|