2011-03-30 02:50:16 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* arch/x86/include/i486/syscall.h
|
|
|
|
*
|
2021-03-28 17:31:37 +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
|
2011-03-30 02:50:16 +02:00
|
|
|
*
|
2021-03-28 17:31:37 +02:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2011-03-30 02:50:16 +02:00
|
|
|
*
|
2021-03-28 17:31:37 +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.
|
2011-03-30 02:50:16 +02:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2020-04-05 23:00:04 +02:00
|
|
|
/* This file should never be included directly but, rather, only indirectly
|
2011-03-30 02:50:16 +02:00
|
|
|
* through include/syscall.h or include/sys/sycall.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ARCH_X86_INCLUDE_I486_SYSCALL_H
|
|
|
|
#define __ARCH_X86_INCLUDE_I486_SYSCALL_H
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
/****************************************************************************
|
2015-04-08 16:04:12 +02:00
|
|
|
* Pre-processor Definitions
|
2011-03-30 02:50:16 +02:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#define SYS_syscall 0x80
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Types
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
2015-10-03 01:42:29 +02:00
|
|
|
* Public Data
|
2011-03-30 02:50:16 +02:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#define EXTERN extern "C"
|
2015-06-13 03:00:52 +02:00
|
|
|
extern "C"
|
|
|
|
{
|
2011-03-30 02:50:16 +02:00
|
|
|
#else
|
|
|
|
#define EXTERN extern
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* SWI with SYS_ call number and six parameters */
|
|
|
|
|
2015-06-13 03:00:52 +02:00
|
|
|
uintptr_t sys_call6(unsigned int nbr, uintptr_t parm1, uintptr_t parm2,
|
|
|
|
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5,
|
|
|
|
uintptr_t parm6);
|
2011-03-30 02:50:16 +02:00
|
|
|
|
|
|
|
/* SWI with SYS_ call number and no parameters */
|
|
|
|
|
|
|
|
static inline uintptr_t sys_call0(unsigned int nbr)
|
|
|
|
{
|
|
|
|
return sys_call6(nbr, 0, 0, 0, 0, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* SWI with SYS_ call number and one parameter */
|
|
|
|
|
|
|
|
static inline uintptr_t sys_call1(unsigned int nbr, uintptr_t parm1)
|
|
|
|
{
|
|
|
|
return sys_call6(nbr, parm1, 0, 0, 0, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* SWI with SYS_ call number and two parameters */
|
|
|
|
|
|
|
|
static inline uintptr_t sys_call2(unsigned int nbr, uintptr_t parm1,
|
|
|
|
uintptr_t parm2)
|
|
|
|
{
|
|
|
|
return sys_call6(nbr, parm1, parm2, 0, 0, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* SWI with SYS_ call number and three parameters */
|
|
|
|
|
|
|
|
static inline uintptr_t sys_call3(unsigned int nbr, uintptr_t parm1,
|
|
|
|
uintptr_t parm2, uintptr_t parm3)
|
|
|
|
{
|
|
|
|
return sys_call6(nbr, parm1, parm2, parm3, 0, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* SWI with SYS_ call number and four parameters */
|
|
|
|
|
|
|
|
static inline uintptr_t sys_call4(unsigned int nbr, uintptr_t parm1,
|
|
|
|
uintptr_t parm2, uintptr_t parm3,
|
|
|
|
uintptr_t parm4)
|
|
|
|
{
|
|
|
|
return sys_call6(nbr, parm1, parm2, parm3, parm4, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* SWI with SYS_ call number and five parameters */
|
|
|
|
|
|
|
|
static inline uintptr_t sys_call5(unsigned int nbr, uintptr_t parm1,
|
|
|
|
uintptr_t parm2, uintptr_t parm3,
|
|
|
|
uintptr_t parm4, uintptr_t parm5)
|
|
|
|
{
|
|
|
|
return sys_call6(nbr, parm1, parm2, parm3, parm4, parm5, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef EXTERN
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __ARCH_X86_INCLUDE_I486_SYSCALL_H */
|