]> git.saurik.com Git - apple/xnu.git/blame - bsd/sys/sysent.h
xnu-792.13.8.tar.gz
[apple/xnu.git] / bsd / sys / sysent.h
CommitLineData
91447636 1/*
5d5c5d0d
A
2 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
3 *
8ad349bb 4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
91447636 5 *
8ad349bb
A
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
91447636
A
29 */
30
31#ifndef _SYS_SYSENT_H_
32#define _SYS_SYSENT_H_
33
34#include <sys/appleapiopts.h>
35#include <sys/cdefs.h>
36#ifdef __ppc__
37#include <sys/types.h>
38#endif
39
40#ifdef KERNEL_PRIVATE
41#ifdef __APPLE_API_PRIVATE
42
43typedef int32_t sy_call_t(struct proc *, void *, int *);
44typedef void sy_munge_t(const void *, void *);
45
46extern struct sysent { /* system call table */
47 int16_t sy_narg; /* number of args */
48 int8_t sy_cancel; /* funnel type */
49 int8_t sy_funnel; /* funnel type */
50 sy_call_t *sy_call; /* implementing function */
51 sy_munge_t *sy_arg_munge32; /* system call aguments munger for 32-bit process */
52 sy_munge_t *sy_arg_munge64; /* system call aguments munger for 64-bit process */
53 int32_t sy_return_type; /* system call return types */
54} sysent[];
55
56/* sy_funnel flags bits */
57#define FUNNEL_MASK 0x00ff
58#define UNSAFE_64BIT 0x0100
59
60/*
61 * Valid values for sy_cancel
62 */
63#define _SYSCALL_CANCEL_NONE 0 /* Not a cancellation point */
64#define _SYSCALL_CANCEL_PRE 1 /* Canbe cancelled on entry itself */
65#define _SYSCALL_CANCEL_POST 2 /* Can only be cancelled after syscall is run */
66
67/*
68 * Valid values for sy_return_type
69 */
70#define _SYSCALL_RET_NONE 0
71#define _SYSCALL_RET_INT_T 1
72#define _SYSCALL_RET_UINT_T 2
73#define _SYSCALL_RET_OFF_T 3
74#define _SYSCALL_RET_ADDR_T 4
75#define _SYSCALL_RET_SIZE_T 5
76#define _SYSCALL_RET_SSIZE_T 6
77
78extern int nsysent;
79
80#endif /* __APPLE_API_PRIVATE */
81#endif /* KERNEL_PRIVATE */
82
83#endif /* !_SYS_SYSENT_H_ */