xref: /onnv-gate/usr/src/uts/common/os/sysent.c (revision 10887:25ca697b9a84)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
51676Sjpk  * Common Development and Distribution License (the "License").
61676Sjpk  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
212248Sraf 
220Sstevel@tonic-gate /* ONC_PLUS EXTRACT START */
230Sstevel@tonic-gate /*
249264SRoger.Faulkner@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
250Sstevel@tonic-gate  * Use is subject to license terms.
260Sstevel@tonic-gate  */
270Sstevel@tonic-gate 
280Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
290Sstevel@tonic-gate /*	  All Rights Reserved  	*/
300Sstevel@tonic-gate 
310Sstevel@tonic-gate /* ONC_PLUS EXTRACT END */
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #include <sys/param.h>
340Sstevel@tonic-gate #include <sys/types.h>
350Sstevel@tonic-gate #include <sys/systm.h>
360Sstevel@tonic-gate #include <sys/systrace.h>
370Sstevel@tonic-gate #include <sys/procfs.h>
380Sstevel@tonic-gate 
390Sstevel@tonic-gate /* ONC_PLUS EXTRACT START */
400Sstevel@tonic-gate /*
410Sstevel@tonic-gate  * This table is the switch used to transfer to the appropriate
420Sstevel@tonic-gate  * routine for processing a system call.  Each row contains the
430Sstevel@tonic-gate  * number of arguments expected, a switch that tells systrap()
440Sstevel@tonic-gate  * in trap.c whether a setjmp() is not necessary, and a pointer
450Sstevel@tonic-gate  * to the routine.
460Sstevel@tonic-gate  */
470Sstevel@tonic-gate /* ONC_PLUS EXTRACT END */
480Sstevel@tonic-gate 
490Sstevel@tonic-gate int	access();
500Sstevel@tonic-gate int	alarm();
510Sstevel@tonic-gate int	auditsys();
522712Snn35248 int64_t	brandsys();
530Sstevel@tonic-gate int	brk();
540Sstevel@tonic-gate int	chdir();
550Sstevel@tonic-gate int	chmod();
560Sstevel@tonic-gate int	chown();
570Sstevel@tonic-gate int	chroot();
580Sstevel@tonic-gate int	cladm();
590Sstevel@tonic-gate int	close();
600Sstevel@tonic-gate int	creat();
610Sstevel@tonic-gate int	dup();
620Sstevel@tonic-gate int	exec();
630Sstevel@tonic-gate int	exece();
640Sstevel@tonic-gate int	fcntl();
650Sstevel@tonic-gate int64_t	forkall();
663235Sraf int64_t	vfork();
673235Sraf int64_t	forksys();
680Sstevel@tonic-gate int64_t	fork1();
690Sstevel@tonic-gate int	fstat();
700Sstevel@tonic-gate int	fsat32();
710Sstevel@tonic-gate int	fdsync();
720Sstevel@tonic-gate int64_t	getgid();
730Sstevel@tonic-gate int	ucredsys();
740Sstevel@tonic-gate int64_t	getpid();
750Sstevel@tonic-gate int64_t	getuid();
760Sstevel@tonic-gate time_t	gtime();
770Sstevel@tonic-gate int	getloadavg();
780Sstevel@tonic-gate int	rusagesys();
790Sstevel@tonic-gate int	getpagesizes();
800Sstevel@tonic-gate int	gtty();
810Sstevel@tonic-gate #if defined(__i386) || defined(__amd64)
820Sstevel@tonic-gate int	hrtsys();
830Sstevel@tonic-gate #endif /* __i386 || __amd64 */
840Sstevel@tonic-gate int	ioctl();
850Sstevel@tonic-gate int	kill();
861676Sjpk int	labelsys();
870Sstevel@tonic-gate int	link();
880Sstevel@tonic-gate off32_t	lseek32();
890Sstevel@tonic-gate off_t	lseek64();
900Sstevel@tonic-gate int	lgrpsys();
918212SMichael.Corcoran@Sun.COM int	mmapobjsys();
920Sstevel@tonic-gate int	mknod();
930Sstevel@tonic-gate int	mount();
940Sstevel@tonic-gate int	nice();
950Sstevel@tonic-gate int	nullsys();
960Sstevel@tonic-gate int	open();
970Sstevel@tonic-gate int	pause();
980Sstevel@tonic-gate long	pcsample();
990Sstevel@tonic-gate int	privsys();
1000Sstevel@tonic-gate int	profil();
1010Sstevel@tonic-gate ssize_t	pread();
1020Sstevel@tonic-gate ssize_t	pwrite();
1030Sstevel@tonic-gate ssize_t	read();
1040Sstevel@tonic-gate int	rename();
1050Sstevel@tonic-gate void	rexit();
1060Sstevel@tonic-gate int	semsys();
1070Sstevel@tonic-gate int	setgid();
1080Sstevel@tonic-gate int	setpgrp();
1090Sstevel@tonic-gate int	setuid();
1100Sstevel@tonic-gate uintptr_t	shmsys();
1114321Scasper uint64_t	sidsys();
1120Sstevel@tonic-gate int	ssig();
1130Sstevel@tonic-gate int	sigprocmask();
1140Sstevel@tonic-gate int	sigsuspend();
1150Sstevel@tonic-gate int	sigaltstack();
1160Sstevel@tonic-gate int	sigaction();
1170Sstevel@tonic-gate int	sigpending();
1184806Sraf int	sigresend();
1190Sstevel@tonic-gate int	sigtimedwait();
1200Sstevel@tonic-gate int	getsetcontext();
1210Sstevel@tonic-gate int	stat();
1220Sstevel@tonic-gate int	stime();
1230Sstevel@tonic-gate int	stty();
1240Sstevel@tonic-gate int	syssync();
1250Sstevel@tonic-gate int	sysacct();
1260Sstevel@tonic-gate clock_t	times();
1270Sstevel@tonic-gate long	ulimit();
1280Sstevel@tonic-gate int	getrlimit32();
1290Sstevel@tonic-gate int	setrlimit32();
1300Sstevel@tonic-gate int	umask();
1310Sstevel@tonic-gate int	umount();
1320Sstevel@tonic-gate int	umount2();
1330Sstevel@tonic-gate int	unlink();
1340Sstevel@tonic-gate int	utime();
13510440SRoger.Faulkner@Sun.COM int	utimesys();
1360Sstevel@tonic-gate int64_t	utssys32();
1370Sstevel@tonic-gate int64_t	utssys64();
1382712Snn35248 int	uucopy();
1392712Snn35248 ssize_t	uucopystr();
1400Sstevel@tonic-gate int64_t	wait();
1410Sstevel@tonic-gate ssize_t	write();
1420Sstevel@tonic-gate ssize_t	readv();
1430Sstevel@tonic-gate ssize_t	writev();
1440Sstevel@tonic-gate int	syslwp_park();
1450Sstevel@tonic-gate int	rmdir();
1460Sstevel@tonic-gate int	mkdir();
1470Sstevel@tonic-gate int	getdents32();
1480Sstevel@tonic-gate int	statfs32();
1490Sstevel@tonic-gate int	fstatfs32();
1500Sstevel@tonic-gate int	sysfs();
1510Sstevel@tonic-gate int	getmsg();
1520Sstevel@tonic-gate int	poll();
1530Sstevel@tonic-gate int	pollsys();
1540Sstevel@tonic-gate int	putmsg();
1550Sstevel@tonic-gate int	uadmin();
1560Sstevel@tonic-gate int	lstat();
1570Sstevel@tonic-gate int	symlink();
1580Sstevel@tonic-gate ssize_t	readlink();
1590Sstevel@tonic-gate int	resolvepath();
1600Sstevel@tonic-gate int	setgroups();
1610Sstevel@tonic-gate int	getgroups();
1620Sstevel@tonic-gate int	fchdir();
1630Sstevel@tonic-gate int	fchown();
1640Sstevel@tonic-gate int	fchmod();
1650Sstevel@tonic-gate int	getcwd();
1660Sstevel@tonic-gate int	statvfs();
1670Sstevel@tonic-gate int	fstatvfs();
1680Sstevel@tonic-gate offset_t llseek32();
1690Sstevel@tonic-gate 
1700Sstevel@tonic-gate #if (defined(__i386) && !defined(__amd64)) || defined(__i386_COMPAT)
1710Sstevel@tonic-gate int	sysi86();
1720Sstevel@tonic-gate #endif
1730Sstevel@tonic-gate 
1740Sstevel@tonic-gate int	acl();
1750Sstevel@tonic-gate int	facl();
1760Sstevel@tonic-gate long	priocntlsys();
1770Sstevel@tonic-gate int	waitsys();
1780Sstevel@tonic-gate int	sigsendsys();
1790Sstevel@tonic-gate int	mincore();
1800Sstevel@tonic-gate caddr_t	smmap64();
1810Sstevel@tonic-gate caddr_t smmap32();
1820Sstevel@tonic-gate int	smmaplf32();
1830Sstevel@tonic-gate int	mprotect();
1840Sstevel@tonic-gate int	munmap();
1850Sstevel@tonic-gate #if (defined(__i386) && !defined(__amd64)) || defined(__i386_COMPAT)
1860Sstevel@tonic-gate int	xstat();
1870Sstevel@tonic-gate int	lxstat();
1880Sstevel@tonic-gate int	fxstat();
1890Sstevel@tonic-gate int	xmknod();
1900Sstevel@tonic-gate #endif
1910Sstevel@tonic-gate int	uname();
1920Sstevel@tonic-gate int	lchown();
1930Sstevel@tonic-gate int	getpmsg();
1940Sstevel@tonic-gate int	putpmsg();
1950Sstevel@tonic-gate int	memcntl();
1960Sstevel@tonic-gate long	sysconfig();
1970Sstevel@tonic-gate int	adjtime();
1980Sstevel@tonic-gate long	systeminfo();
1990Sstevel@tonic-gate int	setegid();
2000Sstevel@tonic-gate int	seteuid();
2010Sstevel@tonic-gate 
2020Sstevel@tonic-gate int	setreuid();
2030Sstevel@tonic-gate int	setregid();
2040Sstevel@tonic-gate int	install_utrap();
2050Sstevel@tonic-gate #ifdef __sparc
2060Sstevel@tonic-gate int	sparc_utrap_install();
2070Sstevel@tonic-gate #endif
2080Sstevel@tonic-gate 
2090Sstevel@tonic-gate int	syslwp_create();
2100Sstevel@tonic-gate void	syslwp_exit();
2110Sstevel@tonic-gate int	syslwp_suspend();
2120Sstevel@tonic-gate int	syslwp_continue();
2130Sstevel@tonic-gate int	syslwp_private();
2140Sstevel@tonic-gate int	lwp_detach();
2150Sstevel@tonic-gate int	lwp_info();
2160Sstevel@tonic-gate int	lwp_kill();
2170Sstevel@tonic-gate int	lwp_self();
2180Sstevel@tonic-gate int64_t	lwp_sigmask();
2190Sstevel@tonic-gate int	yield();
2200Sstevel@tonic-gate int	lwp_wait();
2210Sstevel@tonic-gate int	lwp_mutex_lock();
2220Sstevel@tonic-gate int	lwp_mutex_timedlock();
2230Sstevel@tonic-gate int	lwp_mutex_wakeup();
2240Sstevel@tonic-gate int	lwp_mutex_unlock();
2250Sstevel@tonic-gate int	lwp_mutex_trylock();
2264574Sraf int	lwp_mutex_register();
2270Sstevel@tonic-gate int	lwp_rwlock_sys();
2280Sstevel@tonic-gate int	lwp_sema_post();
2290Sstevel@tonic-gate int	lwp_sema_wait();
2300Sstevel@tonic-gate int	lwp_sema_timedwait();
2310Sstevel@tonic-gate int	lwp_sema_trywait();
2320Sstevel@tonic-gate int	lwp_cond_wait();
2330Sstevel@tonic-gate int	lwp_cond_signal();
2340Sstevel@tonic-gate int	lwp_cond_broadcast();
2350Sstevel@tonic-gate caddr_t	schedctl();
2360Sstevel@tonic-gate 
2370Sstevel@tonic-gate long	pathconf();
2380Sstevel@tonic-gate long	fpathconf();
2390Sstevel@tonic-gate int	processor_bind();
2400Sstevel@tonic-gate int	processor_info();
2410Sstevel@tonic-gate int	p_online();
2420Sstevel@tonic-gate 
2430Sstevel@tonic-gate /*
2440Sstevel@tonic-gate  *	POSIX .4 system calls *
2450Sstevel@tonic-gate  */
2460Sstevel@tonic-gate int	clock_gettime();
2470Sstevel@tonic-gate int	clock_settime();
2480Sstevel@tonic-gate int	clock_getres();
2490Sstevel@tonic-gate int	timer_create();
2500Sstevel@tonic-gate int	timer_delete();
2510Sstevel@tonic-gate int	timer_settime();
2520Sstevel@tonic-gate int	timer_gettime();
2530Sstevel@tonic-gate int	timer_getoverrun();
2540Sstevel@tonic-gate int	nanosleep();
2550Sstevel@tonic-gate int	sigqueue();
2560Sstevel@tonic-gate int	signotify();
2570Sstevel@tonic-gate 
2580Sstevel@tonic-gate int	getdents64();
2590Sstevel@tonic-gate int	stat64();
2600Sstevel@tonic-gate int	fsat64();
2610Sstevel@tonic-gate int	lstat64();
2620Sstevel@tonic-gate int	fstatat64();
2630Sstevel@tonic-gate int	fstat64();
2640Sstevel@tonic-gate int	statvfs64();
2650Sstevel@tonic-gate int	fstatvfs64();
2660Sstevel@tonic-gate int	setrlimit64();
2670Sstevel@tonic-gate int	getrlimit64();
2680Sstevel@tonic-gate int	pread64();
2690Sstevel@tonic-gate int	pwrite64();
2700Sstevel@tonic-gate int	creat64();
2710Sstevel@tonic-gate int	open64();
2720Sstevel@tonic-gate 
2730Sstevel@tonic-gate /*
2740Sstevel@tonic-gate  * NTP syscalls
2750Sstevel@tonic-gate  */
2760Sstevel@tonic-gate 
2770Sstevel@tonic-gate int ntp_gettime();
2780Sstevel@tonic-gate int ntp_adjtime();
2790Sstevel@tonic-gate 
2800Sstevel@tonic-gate /*
2810Sstevel@tonic-gate  *	++++++++++++++++++++++++
2820Sstevel@tonic-gate  *	++  SunOS4.1 Buyback  ++
2830Sstevel@tonic-gate  *	++++++++++++++++++++++++
2840Sstevel@tonic-gate  *
2850Sstevel@tonic-gate  *	fchroot, utimes, vhangup, gettimeofday
2860Sstevel@tonic-gate  */
2870Sstevel@tonic-gate 
2880Sstevel@tonic-gate int	fchroot();
2890Sstevel@tonic-gate int	utimes();
2900Sstevel@tonic-gate int	vhangup();
2910Sstevel@tonic-gate int	gettimeofday();
2920Sstevel@tonic-gate int	getitimer();
2930Sstevel@tonic-gate int	setitimer();
2940Sstevel@tonic-gate 
2950Sstevel@tonic-gate int	corectl();
2960Sstevel@tonic-gate int	modctl();
2970Sstevel@tonic-gate int64_t loadable_syscall();
2980Sstevel@tonic-gate int64_t indir();
2990Sstevel@tonic-gate 
3000Sstevel@tonic-gate long	tasksys();
3010Sstevel@tonic-gate long	rctlsys();
3020Sstevel@tonic-gate 
3030Sstevel@tonic-gate long	zone();
3040Sstevel@tonic-gate 
3050Sstevel@tonic-gate int	so_socket();
3060Sstevel@tonic-gate int	so_socketpair();
3070Sstevel@tonic-gate int	bind();
3080Sstevel@tonic-gate int	listen();
3090Sstevel@tonic-gate int	accept();
3100Sstevel@tonic-gate int	connect();
3110Sstevel@tonic-gate int	shutdown();
3120Sstevel@tonic-gate ssize_t	recv();
3130Sstevel@tonic-gate ssize_t	recvfrom();
3140Sstevel@tonic-gate ssize_t	recvmsg();
3150Sstevel@tonic-gate ssize_t	send();
3160Sstevel@tonic-gate ssize_t	sendmsg();
3170Sstevel@tonic-gate ssize_t	sendto();
3180Sstevel@tonic-gate int	getpeername();
3190Sstevel@tonic-gate int	getsockname();
3200Sstevel@tonic-gate int	getsockopt();
3210Sstevel@tonic-gate int	setsockopt();
3220Sstevel@tonic-gate int	sockconfig();
3230Sstevel@tonic-gate ssize_t	sendfilev();
3240Sstevel@tonic-gate 
3250Sstevel@tonic-gate typedef int64_t	(*llfcn_t)();	/* for casting one-word returns */
3260Sstevel@tonic-gate 
3270Sstevel@tonic-gate /*
3280Sstevel@tonic-gate  * Sysent initialization macros.
3290Sstevel@tonic-gate  * 	These take the name string of the system call even though that isn't
3300Sstevel@tonic-gate  *	currently used in the sysent entry.  This might be useful someday.
3310Sstevel@tonic-gate  *
3320Sstevel@tonic-gate  * Initialization macro for system calls which take their args in the C style.
3330Sstevel@tonic-gate  * These system calls return the longlong_t return value and must call
3340Sstevel@tonic-gate  * set_errno() to return an error.  For SPARC, narg must be at most six.
3350Sstevel@tonic-gate  * For more args, use the SYSENT_AP() routine.
3360Sstevel@tonic-gate  *
3370Sstevel@tonic-gate  * We are able to return two distinct values to userland via the rval_t.
3380Sstevel@tonic-gate  * At this time, that corresponds to one 64-bit quantity, or two 32-bit
3390Sstevel@tonic-gate  * quantities.  The kernel does not currently need to return two 64-bit
3400Sstevel@tonic-gate  * values, or one 128 bit value(!), but we may do one day, so the calling
3410Sstevel@tonic-gate  * sequence between userland and the kernel should permit it.
3420Sstevel@tonic-gate  *
3430Sstevel@tonic-gate  * The interpretation of rval_t is provided by the sy_flags field
3440Sstevel@tonic-gate  * which is used to determine how to arrange the results in registers
3450Sstevel@tonic-gate  * (or on the stack) for return userland.
3460Sstevel@tonic-gate  */
3470Sstevel@tonic-gate 	/* returns a 64-bit quantity for both ABIs */
3480Sstevel@tonic-gate #define	SYSENT_C(name, call, narg)	\
3490Sstevel@tonic-gate 	{ (narg), SE_64RVAL, NULL, NULL, (llfcn_t)(call) }
3500Sstevel@tonic-gate 
3510Sstevel@tonic-gate 	/* returns one 32-bit value for both ABIs: r_val1 */
3520Sstevel@tonic-gate #define	SYSENT_CI(name, call, narg)	\
3530Sstevel@tonic-gate 	{ (narg), SE_32RVAL1, NULL, NULL, (llfcn_t)(call) }
3540Sstevel@tonic-gate 
3550Sstevel@tonic-gate 	/* returns 2 32-bit values: r_val1 & r_val2 */
3560Sstevel@tonic-gate #define	SYSENT_2CI(name, call, narg)	\
3570Sstevel@tonic-gate 	{ (narg), SE_32RVAL1|SE_32RVAL2, NULL, NULL, (llfcn_t)(call) }
3580Sstevel@tonic-gate 
3590Sstevel@tonic-gate /*
3600Sstevel@tonic-gate  * Initialization macro for system calls which take their args in the standard
3610Sstevel@tonic-gate  * Unix style of a pointer to the arg structure and a pointer to the rval_t.
3620Sstevel@tonic-gate  *
3630Sstevel@tonic-gate  * Deprecated wherever possible (slower on some architectures, and trickier
3640Sstevel@tonic-gate  * to maintain two flavours).
3650Sstevel@tonic-gate  */
3660Sstevel@tonic-gate #define	SYSENT_AP(name, call, narg)	\
3670Sstevel@tonic-gate 	{ (narg), SE_64RVAL, (call), NULL, syscall_ap }
3680Sstevel@tonic-gate 
3690Sstevel@tonic-gate /*
3700Sstevel@tonic-gate  * Conditional constructors to build the tables without #ifdef clutter
3710Sstevel@tonic-gate  */
3720Sstevel@tonic-gate #if defined(_LP64)
3730Sstevel@tonic-gate #define	IF_LP64(true, false)	true
3740Sstevel@tonic-gate #else
3750Sstevel@tonic-gate #define	IF_LP64(true, false)	false
3760Sstevel@tonic-gate #endif
3770Sstevel@tonic-gate 
3780Sstevel@tonic-gate #if defined(__sparc)
3790Sstevel@tonic-gate #define	IF_sparc(true, false)	true
3800Sstevel@tonic-gate #else
3810Sstevel@tonic-gate #define	IF_sparc(true, false)	false
3820Sstevel@tonic-gate #endif
3830Sstevel@tonic-gate 
3840Sstevel@tonic-gate #if defined(__i386) && !defined(__amd64)
3850Sstevel@tonic-gate #define	IF_i386(true, false)	true
3860Sstevel@tonic-gate #else
3870Sstevel@tonic-gate #define	IF_i386(true, false)	false
3880Sstevel@tonic-gate #endif
3890Sstevel@tonic-gate 
390641Skalai #if defined(__i386) || defined(__amd64)
3910Sstevel@tonic-gate #define	IF_x86(true, false)	true
3920Sstevel@tonic-gate #else
3930Sstevel@tonic-gate #define	IF_x86(true, false)	false
3940Sstevel@tonic-gate #endif
3950Sstevel@tonic-gate 
3960Sstevel@tonic-gate #if (defined(__i386) && !defined(__amd64)) || defined(__i386_COMPAT)
3970Sstevel@tonic-gate #define	IF_386_ABI(true, false)	true
3980Sstevel@tonic-gate #else
3990Sstevel@tonic-gate #define	IF_386_ABI(true, false)	false
4000Sstevel@tonic-gate #endif
4010Sstevel@tonic-gate 
4020Sstevel@tonic-gate /*
4030Sstevel@tonic-gate  * Define system calls that return a native 'long' quantity i.e. a 32-bit
4040Sstevel@tonic-gate  * or 64-bit integer - depending on how the kernel is itself compiled
4050Sstevel@tonic-gate  * e.g. read(2) returns 'ssize_t' in the kernel and in userland.
4060Sstevel@tonic-gate  */
4070Sstevel@tonic-gate #define	SYSENT_CL(name, call, narg)	\
4080Sstevel@tonic-gate 	IF_LP64(SYSENT_C(name, call, narg), SYSENT_CI(name, call, narg))
4090Sstevel@tonic-gate 
4100Sstevel@tonic-gate /*
4110Sstevel@tonic-gate  * Initialization macro for loadable native system calls.
4120Sstevel@tonic-gate  */
4130Sstevel@tonic-gate #define	SYSENT_LOADABLE()	\
4140Sstevel@tonic-gate 	{ 0, SE_LOADABLE, (int (*)())nosys, NULL, loadable_syscall }
4150Sstevel@tonic-gate /* ONC_PLUS EXTRACT END */
4160Sstevel@tonic-gate 
4170Sstevel@tonic-gate /*
4180Sstevel@tonic-gate  * Initialization macro for loadable 32-bit compatibility system calls.
4190Sstevel@tonic-gate  */
4200Sstevel@tonic-gate #define	SYSENT_LOADABLE32()	SYSENT_LOADABLE()
4210Sstevel@tonic-gate 
4220Sstevel@tonic-gate #define	SYSENT_NOSYS()		SYSENT_C("nosys", nosys, 0)
4230Sstevel@tonic-gate 
4240Sstevel@tonic-gate struct sysent nosys_ent = SYSENT_NOSYS();
4250Sstevel@tonic-gate 
4260Sstevel@tonic-gate /* ONC_PLUS EXTRACT START */
4270Sstevel@tonic-gate /*
4280Sstevel@tonic-gate  * Native sysent table.
4290Sstevel@tonic-gate  */
4300Sstevel@tonic-gate struct sysent sysent[NSYSCALL] =
4310Sstevel@tonic-gate {
4320Sstevel@tonic-gate /* ONC_PLUS EXTRACT END */
4330Sstevel@tonic-gate 	/*  0 */ IF_LP64(
4340Sstevel@tonic-gate 			SYSENT_NOSYS(),
4350Sstevel@tonic-gate 			SYSENT_C("indir",	indir,		1)),
4360Sstevel@tonic-gate 	/*  1 */ SYSENT_CI("exit",		rexit,		1),
4370Sstevel@tonic-gate 	/*  2 */ SYSENT_2CI("forkall",		forkall,	0),
4380Sstevel@tonic-gate 	/*  3 */ SYSENT_CL("read",		read,		3),
4390Sstevel@tonic-gate 	/*  4 */ SYSENT_CL("write",		write,		3),
4400Sstevel@tonic-gate 	/*  5 */ SYSENT_CI("open",		open,		3),
4410Sstevel@tonic-gate 	/*  6 */ SYSENT_CI("close",		close,		1),
4420Sstevel@tonic-gate 	/*  7 */ SYSENT_2CI("wait",		wait,		0),
4430Sstevel@tonic-gate 	/*  8 */ SYSENT_CI("creat",		creat,		2),
4440Sstevel@tonic-gate 	/*  9 */ SYSENT_CI("link",		link,		2),
4450Sstevel@tonic-gate 	/* 10 */ SYSENT_CI("unlink",		unlink,		1),
4460Sstevel@tonic-gate 	/* 11 */ SYSENT_CI("exec",		exec,		2),
4470Sstevel@tonic-gate 	/* 12 */ SYSENT_CI("chdir",		chdir,		1),
4480Sstevel@tonic-gate 	/* 13 */ SYSENT_CL("time",		gtime,		0),
4490Sstevel@tonic-gate 	/* 14 */ SYSENT_CI("mknod",		mknod,		3),
4500Sstevel@tonic-gate 	/* 15 */ SYSENT_CI("chmod",		chmod,		2),
4510Sstevel@tonic-gate 	/* 16 */ SYSENT_CI("chown",		chown,		3),
4520Sstevel@tonic-gate 	/* 17 */ SYSENT_CI("brk",		brk,		1),
4530Sstevel@tonic-gate 	/* 18 */ SYSENT_CI("stat",		stat,		2),
4540Sstevel@tonic-gate 	/* 19 */ IF_LP64(
4550Sstevel@tonic-gate 			SYSENT_CL("lseek",	lseek64,	3),
4560Sstevel@tonic-gate 			SYSENT_CL("lseek",	lseek32,	3)),
4570Sstevel@tonic-gate 	/* 20 */ SYSENT_2CI("getpid",		getpid,		0),
4580Sstevel@tonic-gate 	/* 21 */ SYSENT_AP("mount",		mount,		8),
4590Sstevel@tonic-gate 	/* 22 */ SYSENT_CI("umount",		umount,		1),
4600Sstevel@tonic-gate 	/* 23 */ SYSENT_CI("setuid",		setuid,		1),
4610Sstevel@tonic-gate 	/* 24 */ SYSENT_2CI("getuid",		getuid,		0),
4620Sstevel@tonic-gate 	/* 25 */ SYSENT_CI("stime",		stime,		1),
4630Sstevel@tonic-gate 	/* 26 */ SYSENT_CL("pcsample",		pcsample,	2),
4640Sstevel@tonic-gate 	/* 27 */ SYSENT_CI("alarm",		alarm,		1),
4650Sstevel@tonic-gate 	/* 28 */ SYSENT_CI("fstat",		fstat,		2),
4660Sstevel@tonic-gate 	/* 29 */ SYSENT_CI("pause",		pause,		0),
4670Sstevel@tonic-gate 	/* 30 */ SYSENT_CI("utime",		utime,		2),
4680Sstevel@tonic-gate 	/* 31 */ SYSENT_CI("stty",		stty,		2),
4690Sstevel@tonic-gate 	/* 32 */ SYSENT_CI("gtty",		gtty,		2),
4700Sstevel@tonic-gate 	/* 33 */ SYSENT_CI("access",		access,		2),
4710Sstevel@tonic-gate 	/* 34 */ SYSENT_CI("nice",		nice,		1),
4720Sstevel@tonic-gate 	/* 35 */ IF_LP64(
4730Sstevel@tonic-gate 			SYSENT_NOSYS(),
4740Sstevel@tonic-gate 			SYSENT_CI("statfs",	statfs32,	4)),
4750Sstevel@tonic-gate 	/* 36 */ SYSENT_CI("sync",		syssync,	0),
4760Sstevel@tonic-gate 	/* 37 */ SYSENT_CI("kill",		kill,		2),
4770Sstevel@tonic-gate 	/* 38 */ IF_LP64(
4780Sstevel@tonic-gate 			SYSENT_NOSYS(),
4790Sstevel@tonic-gate 			SYSENT_CI("fstatfs",	fstatfs32,	4)),
4800Sstevel@tonic-gate 	/* 39 */ SYSENT_CI("setpgrp",		setpgrp,	3),
4812712Snn35248 	/* 40 */ SYSENT_CI("uucopystr",		uucopystr,	3),
4820Sstevel@tonic-gate 	/* 41 */ SYSENT_CI("dup",		dup,		1),
4833235Sraf 	/* 42 */ SYSENT_LOADABLE(),			/* pipe */
4840Sstevel@tonic-gate 	/* 43 */ SYSENT_CL("times",		times,		1),
4850Sstevel@tonic-gate 	/* 44 */ SYSENT_CI("prof",		profil,		4),
4860Sstevel@tonic-gate 	/* 45 */ SYSENT_LOADABLE(),			/* (was proc lock) */
4870Sstevel@tonic-gate 	/* 46 */ SYSENT_CI("setgid",		setgid,		1),
4880Sstevel@tonic-gate 	/* 47 */ SYSENT_2CI("getgid",		getgid,		0),
4890Sstevel@tonic-gate 	/* 48 */ SYSENT_CI("sig",		ssig,		2),
4903235Sraf 	/* 49 */ SYSENT_LOADABLE(),			/* msgsys */
4910Sstevel@tonic-gate 	/* 50 */ IF_x86(
4920Sstevel@tonic-gate 			SYSENT_CI("sysi86",	sysi86,		4),
4930Sstevel@tonic-gate 			SYSENT_LOADABLE()),		/* (was sys3b) */
4940Sstevel@tonic-gate 	/* 51 */ SYSENT_LOADABLE(),			/* sysacct */
4950Sstevel@tonic-gate 	/* 52 */ SYSENT_LOADABLE(),			/* shmsys */
4960Sstevel@tonic-gate 	/* 53 */ SYSENT_LOADABLE(),			/* semsys */
4970Sstevel@tonic-gate 	/* 54 */ SYSENT_CI("ioctl",		ioctl,		3),
4980Sstevel@tonic-gate 	/* 55 */ SYSENT_CI("uadmin",		uadmin,		3),
4990Sstevel@tonic-gate 	/* 56 */ SYSENT_LOADABLE(),
5000Sstevel@tonic-gate 	/* 57 */ IF_LP64(
5010Sstevel@tonic-gate 			SYSENT_2CI("utssys",	utssys64,	4),
5020Sstevel@tonic-gate 			SYSENT_2CI("utssys",	utssys32,	4)),
5030Sstevel@tonic-gate 	/* 58 */ SYSENT_CI("fdsync",		fdsync,		2),
5040Sstevel@tonic-gate 	/* 59 */ SYSENT_CI("exece",		exece,		3),
5050Sstevel@tonic-gate 	/* 60 */ SYSENT_CI("umask",		umask,		1),
5060Sstevel@tonic-gate 	/* 61 */ SYSENT_CI("chroot",		chroot,		1),
5070Sstevel@tonic-gate 	/* 62 */ SYSENT_CI("fcntl",		fcntl,		3),
5080Sstevel@tonic-gate 	/* 63 */ SYSENT_CI("ulimit",		ulimit,		2),
5090Sstevel@tonic-gate 
5100Sstevel@tonic-gate 	/*
5110Sstevel@tonic-gate 	 * The following 6 entries were reserved for the UNIX PC.
5120Sstevel@tonic-gate 	 */
5130Sstevel@tonic-gate 	/* 64 */ SYSENT_LOADABLE(),
5140Sstevel@tonic-gate 	/* 65 */ SYSENT_LOADABLE(),
5150Sstevel@tonic-gate 	/* 66 */ SYSENT_LOADABLE(),
5160Sstevel@tonic-gate 	/* 67 */ SYSENT_LOADABLE(),		/* file locking call */
5170Sstevel@tonic-gate 	/* 68 */ SYSENT_LOADABLE(),		/* local system calls */
5180Sstevel@tonic-gate 	/* 69 */ SYSENT_LOADABLE(),		/* inode open */
5190Sstevel@tonic-gate 
5200Sstevel@tonic-gate 	/* 70 */ SYSENT_CI("tasksys",		tasksys,	5),
5210Sstevel@tonic-gate 	/* 71 */ SYSENT_LOADABLE(),		/* acctctl */
5220Sstevel@tonic-gate 	/* 72 */ SYSENT_LOADABLE(),		/* exacct */
5235349Skchow 	/* 73 */ SYSENT_CI("getpagesizes",	getpagesizes,	3),
5240Sstevel@tonic-gate 	/* 74 */ SYSENT_CI("rctlsys",		rctlsys,	6),
5254321Scasper 	/* 75 */ SYSENT_2CI("sidsys",		sidsys,		4),
5260Sstevel@tonic-gate 	/* 76 */ IF_LP64(
5270Sstevel@tonic-gate 			SYSENT_CI("fsat",	fsat64,		6),
5280Sstevel@tonic-gate 			SYSENT_CI("fsat",	fsat32,		6)),
5290Sstevel@tonic-gate 	/* 77 */ SYSENT_CI("lwp_park",		syslwp_park,	3),
5300Sstevel@tonic-gate 	/* 78 */ SYSENT_CL("sendfilev",		sendfilev,	5),
5310Sstevel@tonic-gate 	/* 79 */ SYSENT_CI("rmdir",		rmdir,		1),
5320Sstevel@tonic-gate 	/* 80 */ SYSENT_CI("mkdir",		mkdir,		2),
5330Sstevel@tonic-gate 	/* 81 */ IF_LP64(
5340Sstevel@tonic-gate 			SYSENT_CI("getdents",	getdents64,	3),
5350Sstevel@tonic-gate 			SYSENT_CI("getdents",	getdents32,	3)),
5366134Scasper 	/* 82 */ SYSENT_CI("privsys",		privsys,	6),
5370Sstevel@tonic-gate 	/* 83 */ SYSENT_CI("ucredsys",		ucredsys,	3),
5380Sstevel@tonic-gate 	/* 84 */ SYSENT_CI("sysfs",		sysfs,		3),
5390Sstevel@tonic-gate 	/* 85 */ SYSENT_CI("getmsg",		getmsg,		4),
5400Sstevel@tonic-gate 	/* 86 */ SYSENT_CI("putmsg",		putmsg,		4),
5410Sstevel@tonic-gate 	/* 87 */ SYSENT_CI("poll",		poll,		3),
5420Sstevel@tonic-gate 	/* 88 */ SYSENT_CI("lstat",		lstat,		2),
5430Sstevel@tonic-gate 	/* 89 */ SYSENT_CI("symlink",		symlink,	2),
5440Sstevel@tonic-gate 	/* 90 */ SYSENT_CL("readlink",		readlink,	3),
5450Sstevel@tonic-gate 	/* 91 */ SYSENT_CI("setgroups",		setgroups,	2),
5460Sstevel@tonic-gate 	/* 92 */ SYSENT_CI("getgroups",		getgroups,	2),
5470Sstevel@tonic-gate 	/* 93 */ SYSENT_CI("fchmod",		fchmod,		2),
5480Sstevel@tonic-gate 	/* 94 */ SYSENT_CI("fchown",		fchown,		3),
5490Sstevel@tonic-gate 	/* 95 */ SYSENT_CI("sigprocmask",	sigprocmask,	3),
5500Sstevel@tonic-gate 	/* 96 */ SYSENT_CI("sigsuspend",	sigsuspend,	1),
5510Sstevel@tonic-gate 	/* 97 */ SYSENT_CI("sigaltstack",	sigaltstack,	2),
5520Sstevel@tonic-gate 	/* 98 */ SYSENT_CI("sigaction",		sigaction,	3),
5530Sstevel@tonic-gate 	/* 99 */ SYSENT_CI("sigpending",	sigpending,	2),
5540Sstevel@tonic-gate 
5550Sstevel@tonic-gate 	/* 100 */ SYSENT_CI("getsetcontext",	getsetcontext,	2),
5560Sstevel@tonic-gate 	/* 101 */ SYSENT_LOADABLE(),		/* (was evsys) */
5570Sstevel@tonic-gate 	/* 102 */ SYSENT_LOADABLE(),		/* (was evtrapret) */
5580Sstevel@tonic-gate 	/* 103 */ SYSENT_CI("statvfs",		statvfs,	2),
5590Sstevel@tonic-gate 	/* 104 */ SYSENT_CI("fstatvfs",		fstatvfs,	2),
5600Sstevel@tonic-gate 	/* 105 */ SYSENT_CI("getloadavg",	getloadavg,	2),
5610Sstevel@tonic-gate /* ONC_PLUS EXTRACT START */
5620Sstevel@tonic-gate 	/* 106 */ SYSENT_LOADABLE(),		/* nfssys */
5630Sstevel@tonic-gate /* ONC_PLUS EXTRACT END */
5640Sstevel@tonic-gate 	/* 107 */ SYSENT_CI("waitsys",		waitsys,	4),
5650Sstevel@tonic-gate 	/* 108 */ SYSENT_CI("sigsendset",	sigsendsys,	2),
5660Sstevel@tonic-gate 	/* 109 */ IF_x86(
5670Sstevel@tonic-gate 			SYSENT_AP("hrtsys",	hrtsys,		5),
5680Sstevel@tonic-gate 			SYSENT_LOADABLE()),
56910440SRoger.Faulkner@Sun.COM 	/* 110 */ SYSENT_CI("utimesys",		utimesys,	5),
5704806Sraf 	/* 111 */ SYSENT_CI("sigresend",	sigresend,	3),
5710Sstevel@tonic-gate 	/* 112 */ SYSENT_CL("priocntlsys",	priocntlsys,	5),
5720Sstevel@tonic-gate 	/* 113 */ SYSENT_CL("pathconf",		pathconf,	2),
5730Sstevel@tonic-gate 	/* 114 */ SYSENT_CI("mincore",		mincore,	3),
5740Sstevel@tonic-gate 	/* 115 */ IF_LP64(
5750Sstevel@tonic-gate 			SYSENT_CL("mmap",	smmap64,	6),
5760Sstevel@tonic-gate 			SYSENT_CL("mmap",	smmap32,	6)),
5770Sstevel@tonic-gate 	/* 116 */ SYSENT_CI("mprotect",		mprotect,	3),
5780Sstevel@tonic-gate 	/* 117 */ SYSENT_CI("munmap",		munmap,		2),
5790Sstevel@tonic-gate 	/* 118 */ SYSENT_CL("fpathconf",	fpathconf,	2),
5800Sstevel@tonic-gate 	/* 119 */ SYSENT_2CI("vfork",		vfork,		0),
5810Sstevel@tonic-gate 	/* 120 */ SYSENT_CI("fchdir",		fchdir,		1),
5820Sstevel@tonic-gate 	/* 121 */ SYSENT_CL("readv",		readv,		3),
5830Sstevel@tonic-gate 	/* 122 */ SYSENT_CL("writev",		writev,		3),
5840Sstevel@tonic-gate 	/* 123 */ IF_LP64(
5850Sstevel@tonic-gate 			SYSENT_NOSYS(),
5860Sstevel@tonic-gate 			IF_i386(
5870Sstevel@tonic-gate 				SYSENT_CI("xstat",	xstat,	3),
5880Sstevel@tonic-gate 				SYSENT_NOSYS())),
5890Sstevel@tonic-gate 	/* 124 */ IF_LP64(
5900Sstevel@tonic-gate 			SYSENT_NOSYS(),
5910Sstevel@tonic-gate 			IF_i386(
5920Sstevel@tonic-gate 				SYSENT_CI("lxstat",	lxstat,	3),
5930Sstevel@tonic-gate 				SYSENT_NOSYS())),
5940Sstevel@tonic-gate 	/* 125 */ IF_LP64(
5950Sstevel@tonic-gate 			SYSENT_NOSYS(),
5960Sstevel@tonic-gate 			IF_i386(
5970Sstevel@tonic-gate 				SYSENT_CI("fxstat",	fxstat,	3),
5980Sstevel@tonic-gate 				SYSENT_NOSYS())),
5990Sstevel@tonic-gate 	/* 126 */ IF_LP64(
6000Sstevel@tonic-gate 			SYSENT_NOSYS(),
6010Sstevel@tonic-gate 			IF_i386(
6020Sstevel@tonic-gate 				SYSENT_CI("xmknod",	xmknod,	4),
6030Sstevel@tonic-gate 				SYSENT_NOSYS())),
6048212SMichael.Corcoran@Sun.COM 	/* 127 */ SYSENT_CI("mmapobj",		mmapobjsys,	5),
6050Sstevel@tonic-gate 	/* 128 */ IF_LP64(
6060Sstevel@tonic-gate 			SYSENT_CI("setrlimit",	setrlimit64,	2),
6070Sstevel@tonic-gate 			SYSENT_CI("setrlimit",	setrlimit32,	2)),
6080Sstevel@tonic-gate 	/* 129 */ IF_LP64(
6090Sstevel@tonic-gate 			SYSENT_CI("getrlimit",	getrlimit64,	2),
6100Sstevel@tonic-gate 			SYSENT_CI("getrlimit",	getrlimit32,	2)),
6110Sstevel@tonic-gate 	/* 130 */ SYSENT_CI("lchown",		lchown,		3),
6120Sstevel@tonic-gate 	/* 131 */ SYSENT_CI("memcntl",		memcntl,	6),
6130Sstevel@tonic-gate 	/* 132 */ SYSENT_CI("getpmsg",		getpmsg,	5),
6140Sstevel@tonic-gate 	/* 133 */ SYSENT_CI("putpmsg",		putpmsg,	5),
6150Sstevel@tonic-gate 	/* 134 */ SYSENT_CI("rename",		rename,		2),
6160Sstevel@tonic-gate 	/* 135 */ SYSENT_CI("uname",		uname,		1),
6170Sstevel@tonic-gate 	/* 136 */ SYSENT_CI("setegid",		setegid,	1),
6180Sstevel@tonic-gate 	/* 137 */ SYSENT_CL("sysconfig",	sysconfig,	1),
6190Sstevel@tonic-gate 	/* 138 */ SYSENT_CI("adjtime",		adjtime,	2),
6200Sstevel@tonic-gate 	/* 139 */ SYSENT_CL("systeminfo",	systeminfo,	3),
6213957Sth199096 	/* 140 */ SYSENT_LOADABLE(),		/* sharefs */
6220Sstevel@tonic-gate 	/* 141 */ SYSENT_CI("seteuid",		seteuid,	1),
6233235Sraf 	/* 142 */ SYSENT_2CI("forksys",		forksys,	2),
6240Sstevel@tonic-gate 	/* 143 */ SYSENT_2CI("fork1",		fork1,		0),
6250Sstevel@tonic-gate 	/* 144 */ SYSENT_CI("sigtimedwait",	sigtimedwait,	3),
6260Sstevel@tonic-gate 	/* 145 */ SYSENT_CI("lwp_info",		lwp_info,	1),
6270Sstevel@tonic-gate 	/* 146 */ SYSENT_CI("yield",		yield,		0),
6280Sstevel@tonic-gate 	/* 147 */ SYSENT_CI("lwp_sema_wait",	lwp_sema_wait,	1),
6290Sstevel@tonic-gate 	/* 148 */ SYSENT_CI("lwp_sema_post",	lwp_sema_post,	1),
6300Sstevel@tonic-gate 	/* 149 */ SYSENT_CI("lwp_sema_trywait",	lwp_sema_trywait, 1),
6310Sstevel@tonic-gate 	/* 150 */ SYSENT_CI("lwp_detach",	lwp_detach,	1),
6320Sstevel@tonic-gate 	/* 151 */ SYSENT_CI("corectl",		corectl,	4),
6330Sstevel@tonic-gate 	/* 152 */ SYSENT_CI("modctl",		modctl,		6),
6340Sstevel@tonic-gate 	/* 153 */ SYSENT_CI("fchroot",		fchroot,	1),
6350Sstevel@tonic-gate 	/* 154 */ SYSENT_CI("utimes",		utimes,		2),
6360Sstevel@tonic-gate 	/* 155 */ SYSENT_CI("vhangup",		vhangup,	0),
6370Sstevel@tonic-gate 	/* 156 */ SYSENT_CI("gettimeofday",	gettimeofday,	1),
6380Sstevel@tonic-gate 	/* 157 */ SYSENT_CI("getitimer",	getitimer,	2),
6390Sstevel@tonic-gate 	/* 158 */ SYSENT_CI("setitimer",	setitimer,	3),
6400Sstevel@tonic-gate 	/* 159 */ SYSENT_CI("lwp_create",	syslwp_create,	3),
6410Sstevel@tonic-gate 	/* 160 */ SYSENT_CI("lwp_exit",	(int (*)())syslwp_exit,	0),
6420Sstevel@tonic-gate 	/* 161 */ SYSENT_CI("lwp_suspend",	syslwp_suspend,	1),
6430Sstevel@tonic-gate 	/* 162 */ SYSENT_CI("lwp_continue",	syslwp_continue, 1),
6440Sstevel@tonic-gate 	/* 163 */ SYSENT_CI("lwp_kill",		lwp_kill,	2),
6450Sstevel@tonic-gate 	/* 164 */ SYSENT_CI("lwp_self",		lwp_self,	0),
6460Sstevel@tonic-gate 	/* 165 */ SYSENT_2CI("lwp_sigmask",	lwp_sigmask,	3),
6470Sstevel@tonic-gate 	/* 166 */ IF_x86(
6480Sstevel@tonic-gate 			SYSENT_CI("lwp_private", syslwp_private, 3),
6490Sstevel@tonic-gate 			SYSENT_NOSYS()),
6500Sstevel@tonic-gate 	/* 167 */ SYSENT_CI("lwp_wait",		lwp_wait,	2),
6514574Sraf 	/* 168 */ SYSENT_CI("lwp_mutex_wakeup",	lwp_mutex_wakeup,	2),
6520Sstevel@tonic-gate 	/* 169 */ SYSENT_CI("lwp_mutex_lock",	lwp_mutex_lock,		1),
6530Sstevel@tonic-gate 	/* 170 */ SYSENT_CI("lwp_cond_wait",	lwp_cond_wait,		4),
6540Sstevel@tonic-gate 	/* 171 */ SYSENT_CI("lwp_cond_signal",	lwp_cond_signal,	1),
6550Sstevel@tonic-gate 	/* 172 */ SYSENT_CI("lwp_cond_broadcast", lwp_cond_broadcast,	1),
6560Sstevel@tonic-gate 	/* 173 */ SYSENT_CL("pread",		pread,		4),
6570Sstevel@tonic-gate 	/* 174 */ SYSENT_CL("pwrite ",		pwrite,		4),
6580Sstevel@tonic-gate 	/*
6590Sstevel@tonic-gate 	 * The 64-bit C library maps llseek() to lseek(), so this
6600Sstevel@tonic-gate 	 * is needed as a native syscall only on the 32-bit kernel.
6610Sstevel@tonic-gate 	 */
6620Sstevel@tonic-gate 	/* 175 */ IF_LP64(
6630Sstevel@tonic-gate 			SYSENT_NOSYS(),
6640Sstevel@tonic-gate 			SYSENT_C("llseek",	llseek32,	4)),
6650Sstevel@tonic-gate 	/* 176 */ SYSENT_LOADABLE(),		/* inst_sync */
6662712Snn35248 	/* 177 */ SYSENT_CI("brandsys",		brandsys,	6),
6670Sstevel@tonic-gate 	/* 178 */ SYSENT_LOADABLE(),		/* kaio */
6680Sstevel@tonic-gate 	/* 179 */ SYSENT_LOADABLE(),		/* cpc */
6690Sstevel@tonic-gate 	/* 180 */ SYSENT_CI("lgrpsys",		lgrpsys,	3),
6703247Sgjelinek 	/* 181 */ SYSENT_CI("rusagesys",	rusagesys, 	5),
6710Sstevel@tonic-gate 	/* 182 */ SYSENT_LOADABLE(),		/* portfs */
6720Sstevel@tonic-gate 	/* 183 */ SYSENT_CI("pollsys",		pollsys,	4),
6731676Sjpk 	/* 184 */ SYSENT_CI("labelsys",		labelsys,	5),
6740Sstevel@tonic-gate 	/* 185 */ SYSENT_CI("acl",		acl,		4),
6750Sstevel@tonic-gate 	/* 186 */ SYSENT_AP("auditsys",		auditsys,	2),
6760Sstevel@tonic-gate 	/* 187 */ SYSENT_CI("processor_bind",	processor_bind,	4),
6770Sstevel@tonic-gate 	/* 188 */ SYSENT_CI("processor_info",	processor_info,	2),
6780Sstevel@tonic-gate 	/* 189 */ SYSENT_CI("p_online",		p_online,	2),
6792248Sraf 	/* 190 */ SYSENT_CI("sigqueue",		sigqueue,	5),
6800Sstevel@tonic-gate 	/* 191 */ SYSENT_CI("clock_gettime",	clock_gettime,	2),
6810Sstevel@tonic-gate 	/* 192 */ SYSENT_CI("clock_settime",	clock_settime,	2),
6820Sstevel@tonic-gate 	/* 193 */ SYSENT_CI("clock_getres",	clock_getres,	2),
6830Sstevel@tonic-gate 	/* 194 */ SYSENT_CI("timer_create",	timer_create,	3),
6840Sstevel@tonic-gate 	/* 195 */ SYSENT_CI("timer_delete",	timer_delete,	1),
6850Sstevel@tonic-gate 	/* 196 */ SYSENT_CI("timer_settime",	timer_settime,	4),
6860Sstevel@tonic-gate 	/* 197 */ SYSENT_CI("timer_gettime",	timer_gettime,	2),
6870Sstevel@tonic-gate 	/* 198 */ SYSENT_CI("timer_getoverrun",	timer_getoverrun, 1),
6880Sstevel@tonic-gate 	/* 199 */ SYSENT_CI("nanosleep",	nanosleep,	2),
6890Sstevel@tonic-gate 	/* 200 */ SYSENT_CI("facl",		facl,		4),
6900Sstevel@tonic-gate 	/* 201 */ SYSENT_LOADABLE(),		/* door */
6910Sstevel@tonic-gate 	/* 202 */ SYSENT_CI("setreuid",		setreuid,	2),
6920Sstevel@tonic-gate 	/* 203 */ SYSENT_CI("setregid",		setregid,	2),
6930Sstevel@tonic-gate 	/* 204 */ SYSENT_CI("install_utrap",	install_utrap,	3),
6940Sstevel@tonic-gate 	/* 205 */ SYSENT_CI("signotify",	signotify,	3),
6950Sstevel@tonic-gate 	/* 206 */ SYSENT_CL("schedctl",		schedctl,	0),
6960Sstevel@tonic-gate 	/* 207 */ SYSENT_LOADABLE(),		/* pset */
6970Sstevel@tonic-gate 	/* 208 */ IF_sparc(
6980Sstevel@tonic-gate 		SYSENT_CI("sparc_utrap_install", sparc_utrap_install, 5),
6990Sstevel@tonic-gate 		SYSENT_NOSYS()),
7000Sstevel@tonic-gate 	/* 209 */ SYSENT_CI("resolvepath",	resolvepath,	3),
701*10887SRoger.Faulkner@Sun.COM 	/* 210 */ SYSENT_CI("lwp_mutex_timedlock", lwp_mutex_timedlock,	3),
7020Sstevel@tonic-gate 	/* 211 */ SYSENT_CI("lwp_sema_timedwait", lwp_sema_timedwait,	3),
7030Sstevel@tonic-gate 	/* 212 */ SYSENT_CI("lwp_rwlock_sys",	lwp_rwlock_sys,	3),
7040Sstevel@tonic-gate 	/*
7050Sstevel@tonic-gate 	 * Syscalls 213-225: 32-bit system call support for large files.
7060Sstevel@tonic-gate 	 *
7070Sstevel@tonic-gate 	 * (The 64-bit C library transparently maps these system calls
7080Sstevel@tonic-gate 	 * back to their native versions, so almost all of them are only
7090Sstevel@tonic-gate 	 * needed as native syscalls on the 32-bit kernel).
7100Sstevel@tonic-gate 	 */
7110Sstevel@tonic-gate 	/* 213 */ IF_LP64(
7120Sstevel@tonic-gate 			SYSENT_NOSYS(),
7130Sstevel@tonic-gate 			SYSENT_CI("getdents64",	getdents64,	3)),
7140Sstevel@tonic-gate 	/* 214 */ IF_LP64(
7150Sstevel@tonic-gate 			SYSENT_NOSYS(),
7160Sstevel@tonic-gate 			SYSENT_AP("smmaplf32",	smmaplf32,	7)),
7170Sstevel@tonic-gate 	/* 215 */ IF_LP64(
7180Sstevel@tonic-gate 			SYSENT_NOSYS(),
7190Sstevel@tonic-gate 			SYSENT_CI("stat64",	stat64, 	2)),
7200Sstevel@tonic-gate 	/* 216 */ IF_LP64(
7210Sstevel@tonic-gate 			SYSENT_NOSYS(),
7220Sstevel@tonic-gate 			SYSENT_CI("lstat64",	lstat64,	2)),
7230Sstevel@tonic-gate 	/* 217 */ IF_LP64(
7240Sstevel@tonic-gate 			SYSENT_NOSYS(),
7250Sstevel@tonic-gate 			SYSENT_CI("fstat64", 	fstat64, 	2)),
7260Sstevel@tonic-gate 	/* 218 */ IF_LP64(
7270Sstevel@tonic-gate 			SYSENT_NOSYS(),
7280Sstevel@tonic-gate 			SYSENT_CI("statvfs64", 	statvfs64, 	2)),
7290Sstevel@tonic-gate 	/* 219 */ IF_LP64(
7300Sstevel@tonic-gate 			SYSENT_NOSYS(),
7310Sstevel@tonic-gate 			SYSENT_CI("fstatvfs64",	fstatvfs64, 	2)),
7320Sstevel@tonic-gate 	/* 220 */ IF_LP64(
7330Sstevel@tonic-gate 			SYSENT_NOSYS(),
7340Sstevel@tonic-gate 			SYSENT_CI("setrlimit64", setrlimit64, 	2)),
7350Sstevel@tonic-gate 	/* 221 */ IF_LP64(
7360Sstevel@tonic-gate 			SYSENT_NOSYS(),
7370Sstevel@tonic-gate 			SYSENT_CI("getrlimit64", getrlimit64, 	2)),
7380Sstevel@tonic-gate 	/* 222 */ IF_LP64(
7390Sstevel@tonic-gate 			SYSENT_NOSYS(),
7400Sstevel@tonic-gate 			SYSENT_CI("pread64",	pread64, 	5)),
7410Sstevel@tonic-gate 	/* 223 */ IF_LP64(
7420Sstevel@tonic-gate 			SYSENT_NOSYS(),
7430Sstevel@tonic-gate 			SYSENT_CI("pwrite64", 	pwrite64, 	5)),
7440Sstevel@tonic-gate 	/* 224 */ IF_LP64(
7450Sstevel@tonic-gate 			SYSENT_NOSYS(),
7460Sstevel@tonic-gate 			SYSENT_CI("creat64",	creat64,	2)),
7470Sstevel@tonic-gate 	/* 225 */ IF_LP64(
7480Sstevel@tonic-gate 			SYSENT_NOSYS(),
7490Sstevel@tonic-gate 			SYSENT_CI("open64",	open64,		3)),
7500Sstevel@tonic-gate 	/* 226 */ SYSENT_LOADABLE(),		/* rpcsys */
7511676Sjpk 	/* 227 */ SYSENT_CL("zone",		zone,		5),
7520Sstevel@tonic-gate 	/* 228 */ SYSENT_LOADABLE(),		/* autofssys */
7530Sstevel@tonic-gate 	/* 229 */ SYSENT_CI("getcwd",		getcwd,		2),
7540Sstevel@tonic-gate 	/* 230 */ SYSENT_CI("so_socket",	so_socket,	5),
7550Sstevel@tonic-gate 	/* 231 */ SYSENT_CI("so_socketpair",	so_socketpair,	1),
7560Sstevel@tonic-gate 	/* 232 */ SYSENT_CI("bind",		bind,		4),
7570Sstevel@tonic-gate 	/* 233 */ SYSENT_CI("listen",		listen,		3),
7580Sstevel@tonic-gate 	/* 234 */ SYSENT_CI("accept",		accept,		4),
7590Sstevel@tonic-gate 	/* 235 */ SYSENT_CI("connect",		connect,	4),
7600Sstevel@tonic-gate 	/* 236 */ SYSENT_CI("shutdown",		shutdown,	3),
7610Sstevel@tonic-gate 	/* 237 */ SYSENT_CL("recv",		recv,		4),
7620Sstevel@tonic-gate 	/* 238 */ SYSENT_CL("recvfrom",		recvfrom,	6),
7630Sstevel@tonic-gate 	/* 239 */ SYSENT_CL("recvmsg",		recvmsg,	3),
7640Sstevel@tonic-gate 	/* 240 */ SYSENT_CL("send",		send,		4),
7650Sstevel@tonic-gate 	/* 241 */ SYSENT_CL("sendmsg",		sendmsg,	3),
7660Sstevel@tonic-gate 	/* 242 */ SYSENT_CL("sendto",		sendto,		6),
7670Sstevel@tonic-gate 	/* 243 */ SYSENT_CI("getpeername",	getpeername,	4),
7680Sstevel@tonic-gate 	/* 244 */ SYSENT_CI("getsockname",	getsockname,	4),
7690Sstevel@tonic-gate 	/* 245 */ SYSENT_CI("getsockopt",	getsockopt,	6),
7700Sstevel@tonic-gate 	/* 246 */ SYSENT_CI("setsockopt",	setsockopt,	6),
7710Sstevel@tonic-gate 	/* 247 */ SYSENT_CI("sockconfig",	sockconfig,	4),
7720Sstevel@tonic-gate 	/* 248 */ SYSENT_CI("ntp_gettime",	ntp_gettime,	1),
7730Sstevel@tonic-gate 	/* 249 */ SYSENT_CI("ntp_adjtime",	ntp_adjtime,	1),
7740Sstevel@tonic-gate 	/* 250 */ SYSENT_CI("lwp_mutex_unlock",	lwp_mutex_unlock,	1),
775*10887SRoger.Faulkner@Sun.COM 	/* 251 */ SYSENT_CI("lwp_mutex_trylock", lwp_mutex_trylock,	2),
7769264SRoger.Faulkner@Sun.COM 	/* 252 */ SYSENT_CI("lwp_mutex_register", lwp_mutex_register,	2),
7770Sstevel@tonic-gate 	/* 253 */ SYSENT_CI("cladm",		cladm,		3),
7782712Snn35248 	/* 254 */ SYSENT_CI("uucopy",		uucopy,		3),
7790Sstevel@tonic-gate 	/* 255 */ SYSENT_CI("umount2",		umount2,	2)
7800Sstevel@tonic-gate /* ONC_PLUS EXTRACT START */
7810Sstevel@tonic-gate };
7820Sstevel@tonic-gate /* ONC_PLUS EXTRACT END */
7830Sstevel@tonic-gate 
7840Sstevel@tonic-gate 
7850Sstevel@tonic-gate #ifdef _SYSCALL32_IMPL
7860Sstevel@tonic-gate 
7870Sstevel@tonic-gate extern int ulimit32();
7880Sstevel@tonic-gate extern ssize_t read32();
7890Sstevel@tonic-gate extern ssize_t write32();
7900Sstevel@tonic-gate extern ssize_t pread32();
7910Sstevel@tonic-gate extern ssize_t pwrite32();
7920Sstevel@tonic-gate extern ssize_t readv32();
7930Sstevel@tonic-gate extern ssize_t writev32();
7940Sstevel@tonic-gate extern ssize_t readlink32();
7950Sstevel@tonic-gate extern int open32();
7960Sstevel@tonic-gate extern int creat32();
7970Sstevel@tonic-gate #if (defined(__i386) && !defined(__amd64)) || defined(__i386_COMPAT)
7980Sstevel@tonic-gate extern int xstat32();
7990Sstevel@tonic-gate extern int lxstat32();
8000Sstevel@tonic-gate extern int fxstat32();
8010Sstevel@tonic-gate #endif
8020Sstevel@tonic-gate extern int stat32();
8030Sstevel@tonic-gate extern int fstatat32();
8040Sstevel@tonic-gate extern int lstat32();
8050Sstevel@tonic-gate extern int fstat32();
8060Sstevel@tonic-gate extern int fstatat64_32();
8070Sstevel@tonic-gate extern int stat64_32();
8080Sstevel@tonic-gate extern int lstat64_32();
8090Sstevel@tonic-gate extern int fstat64_32();
8100Sstevel@tonic-gate extern int getmsg32();
8110Sstevel@tonic-gate extern int putmsg32();
8120Sstevel@tonic-gate extern int getpmsg32();
8130Sstevel@tonic-gate extern int putpmsg32();
8140Sstevel@tonic-gate extern int getsetcontext32();
8150Sstevel@tonic-gate extern int statvfs32();
8160Sstevel@tonic-gate extern int fstatvfs32();
8170Sstevel@tonic-gate extern int statvfs64_32();
8180Sstevel@tonic-gate extern int fstatvfs64_32();
8190Sstevel@tonic-gate extern int sigaction32();
8200Sstevel@tonic-gate extern clock32_t times32();
8210Sstevel@tonic-gate extern int stime32();
8220Sstevel@tonic-gate extern int getpagesizes32();
8230Sstevel@tonic-gate extern int sigaltstack32();
8240Sstevel@tonic-gate extern int sigqueue32();
8250Sstevel@tonic-gate extern offset_t	llseek32();
8260Sstevel@tonic-gate extern int waitsys32();
8270Sstevel@tonic-gate 
8280Sstevel@tonic-gate extern ssize_t recv32();
8290Sstevel@tonic-gate extern ssize_t recvfrom32();
8300Sstevel@tonic-gate extern ssize_t send32();
8310Sstevel@tonic-gate extern ssize_t sendto32();
8320Sstevel@tonic-gate 
8330Sstevel@tonic-gate extern int privsys32();
8340Sstevel@tonic-gate extern int ucredsys32();
8350Sstevel@tonic-gate 
8360Sstevel@tonic-gate /* ONC_PLUS EXTRACT START */
8370Sstevel@tonic-gate /*
8380Sstevel@tonic-gate  * sysent table for ILP32 processes running on
8390Sstevel@tonic-gate  * a LP64 kernel.
8400Sstevel@tonic-gate  */
8410Sstevel@tonic-gate struct sysent sysent32[NSYSCALL] =
8420Sstevel@tonic-gate {
8430Sstevel@tonic-gate /* ONC_PLUS EXTRACT END */
8440Sstevel@tonic-gate 	/*  0 */ SYSENT_C("indir",		indir,		1),
8450Sstevel@tonic-gate 	/*  1 */ SYSENT_CI("exit",	(int (*)())rexit,	1),
8460Sstevel@tonic-gate 	/*  2 */ SYSENT_2CI("forkall",		forkall,	0),
8470Sstevel@tonic-gate 	/*  3 */ SYSENT_CI("read",		read32,		3),
8480Sstevel@tonic-gate 	/*  4 */ SYSENT_CI("write",		write32,	3),
8490Sstevel@tonic-gate 	/*  5 */ SYSENT_CI("open",		open32,		3),
8500Sstevel@tonic-gate 	/*  6 */ SYSENT_CI("close",		close,		1),
8510Sstevel@tonic-gate 	/*  7 */ SYSENT_2CI("wait",		wait,		0),
8520Sstevel@tonic-gate 	/*  8 */ SYSENT_CI("creat",		creat32,	2),
8530Sstevel@tonic-gate 	/*  9 */ SYSENT_CI("link",		link,		2),
8540Sstevel@tonic-gate 	/* 10 */ SYSENT_CI("unlink",		unlink,		1),
8550Sstevel@tonic-gate 	/* 11 */ SYSENT_CI("exec",		exec,		2),
8560Sstevel@tonic-gate 	/* 12 */ SYSENT_CI("chdir",		chdir,		1),
8570Sstevel@tonic-gate 	/* 13 */ SYSENT_CI("time",		gtime,		0),
8580Sstevel@tonic-gate 	/* 14 */ SYSENT_CI("mknod",		mknod,		3),
8590Sstevel@tonic-gate 	/* 15 */ SYSENT_CI("chmod",		chmod,		2),
8600Sstevel@tonic-gate 	/* 16 */ SYSENT_CI("chown",		chown,		3),
8610Sstevel@tonic-gate 	/* 17 */ SYSENT_CI("brk",		brk,		1),
8620Sstevel@tonic-gate 	/* 18 */ SYSENT_CI("stat",		stat32,		2),
8630Sstevel@tonic-gate 	/* 19 */ SYSENT_CI("lseek",		lseek32,	3),
8640Sstevel@tonic-gate 	/* 20 */ SYSENT_2CI("getpid",		getpid,		0),
8650Sstevel@tonic-gate 	/* 21 */ SYSENT_AP("mount",		mount,		8),
8660Sstevel@tonic-gate 	/* 22 */ SYSENT_CI("umount",		umount,		1),
8670Sstevel@tonic-gate 	/* 23 */ SYSENT_CI("setuid",		setuid,		1),
8680Sstevel@tonic-gate 	/* 24 */ SYSENT_2CI("getuid",		getuid,		0),
8690Sstevel@tonic-gate 	/* 25 */ SYSENT_CI("stime",		stime32,	1),
8700Sstevel@tonic-gate 	/* 26 */ SYSENT_CI("pcsample",		pcsample,	2),
8710Sstevel@tonic-gate 	/* 27 */ SYSENT_CI("alarm",		alarm,		1),
8720Sstevel@tonic-gate 	/* 28 */ SYSENT_CI("fstat",		fstat32,	2),
8730Sstevel@tonic-gate 	/* 29 */ SYSENT_CI("pause",		pause,		0),
8740Sstevel@tonic-gate 	/* 30 */ SYSENT_CI("utime",		utime,		2),
8750Sstevel@tonic-gate 	/* 31 */ SYSENT_CI("stty",		stty,		2),
8760Sstevel@tonic-gate 	/* 32 */ SYSENT_CI("gtty",		gtty,		2),
8770Sstevel@tonic-gate 	/* 33 */ SYSENT_CI("access",		access,		2),
8780Sstevel@tonic-gate 	/* 34 */ SYSENT_CI("nice",		nice,		1),
8790Sstevel@tonic-gate 	/* 35 */ SYSENT_CI("statfs",		statfs32,	4),
8800Sstevel@tonic-gate 	/* 36 */ SYSENT_CI("sync",		syssync,	0),
8810Sstevel@tonic-gate 	/* 37 */ SYSENT_CI("kill",		kill,		2),
8820Sstevel@tonic-gate 	/* 38 */ SYSENT_CI("fstatfs",		fstatfs32,	4),
8830Sstevel@tonic-gate 	/* 39 */ SYSENT_CI("setpgrp",		setpgrp,	3),
8842712Snn35248 	/* 40 */ SYSENT_CI("uucopystr",		uucopystr,	3),
8850Sstevel@tonic-gate 	/* 41 */ SYSENT_CI("dup",		dup,		1),
8863235Sraf 	/* 42 */ SYSENT_LOADABLE32(),			/* pipe */
8870Sstevel@tonic-gate 	/* 43 */ SYSENT_CI("times",		times32,	1),
8880Sstevel@tonic-gate 	/* 44 */ SYSENT_CI("prof",		profil,		4),
8890Sstevel@tonic-gate 	/* 45 */ SYSENT_LOADABLE32(),			/* (was proc lock) */
8900Sstevel@tonic-gate 	/* 46 */ SYSENT_CI("setgid",		setgid,		1),
8910Sstevel@tonic-gate 	/* 47 */ SYSENT_2CI("getgid",		getgid,		0),
8920Sstevel@tonic-gate 	/* 48 */ SYSENT_CI("sig",		ssig,		2),
8933235Sraf 	/* 49 */ SYSENT_LOADABLE32(),			/* msgsys */
8940Sstevel@tonic-gate 	/* 50 */ IF_386_ABI(
8950Sstevel@tonic-gate 			SYSENT_CI("sysi86",	sysi86,		4),
8960Sstevel@tonic-gate 			SYSENT_LOADABLE()),		/* (was sys3b) */
8970Sstevel@tonic-gate 	/* 51 */ SYSENT_LOADABLE32(),			/* sysacct */
8980Sstevel@tonic-gate 	/* 52 */ SYSENT_LOADABLE32(),			/* shmsys */
8990Sstevel@tonic-gate 	/* 53 */ SYSENT_LOADABLE32(),			/* semsys */
9000Sstevel@tonic-gate 	/* 54 */ SYSENT_CI("ioctl",		ioctl,		3),
9010Sstevel@tonic-gate 	/* 55 */ SYSENT_CI("uadmin",		uadmin,		3),
9020Sstevel@tonic-gate 	/* 56 */ SYSENT_LOADABLE32(),
9030Sstevel@tonic-gate 	/* 57 */ SYSENT_2CI("utssys",		utssys32,	4),
9040Sstevel@tonic-gate 	/* 58 */ SYSENT_CI("fdsync",		fdsync,		2),
9050Sstevel@tonic-gate 	/* 59 */ SYSENT_CI("exece",		exece,		3),
9060Sstevel@tonic-gate 	/* 60 */ SYSENT_CI("umask",		umask,		1),
9070Sstevel@tonic-gate 	/* 61 */ SYSENT_CI("chroot",		chroot,		1),
9080Sstevel@tonic-gate 	/* 62 */ SYSENT_CI("fcntl",		fcntl,		3),
9090Sstevel@tonic-gate 	/* 63 */ SYSENT_CI("ulimit",		ulimit32,	2),
9100Sstevel@tonic-gate 
9110Sstevel@tonic-gate 	/*
9120Sstevel@tonic-gate 	 * The following 6 entries were reserved for the UNIX PC.
9130Sstevel@tonic-gate 	 */
9140Sstevel@tonic-gate 	/* 64 */ SYSENT_LOADABLE32(),
9150Sstevel@tonic-gate 	/* 65 */ SYSENT_LOADABLE32(),
9160Sstevel@tonic-gate 	/* 66 */ SYSENT_LOADABLE32(),
9170Sstevel@tonic-gate 	/* 67 */ SYSENT_LOADABLE32(),		/* file locking call */
9180Sstevel@tonic-gate 	/* 68 */ SYSENT_LOADABLE32(),		/* local system calls */
9190Sstevel@tonic-gate 	/* 69 */ SYSENT_LOADABLE32(),		/* inode open */
9200Sstevel@tonic-gate 
9210Sstevel@tonic-gate 	/* 70 */ SYSENT_CI("tasksys",		tasksys,	5),
9220Sstevel@tonic-gate 	/* 71 */ SYSENT_LOADABLE32(),		/* acctctl */
9230Sstevel@tonic-gate 	/* 72 */ SYSENT_LOADABLE32(),		/* exacct */
9245349Skchow 	/* 73 */ SYSENT_CI("getpagesizes",	getpagesizes32,	3),
9250Sstevel@tonic-gate 	/* 74 */ SYSENT_CI("rctlsys",		rctlsys,	6),
9264321Scasper 	/* 75 */ SYSENT_2CI("sidsys",		sidsys,		4),
9270Sstevel@tonic-gate 	/* 76 */ SYSENT_CI("fsat",		fsat32,		6),
9280Sstevel@tonic-gate 	/* 77 */ SYSENT_CI("lwp_park",		syslwp_park,	3),
9290Sstevel@tonic-gate 	/* 78 */ SYSENT_CI("sendfilev",		sendfilev,	5),
9300Sstevel@tonic-gate 	/* 79 */ SYSENT_CI("rmdir",		rmdir,		1),
9310Sstevel@tonic-gate 	/* 80 */ SYSENT_CI("mkdir",		mkdir,		2),
9320Sstevel@tonic-gate 	/* 81 */ SYSENT_CI("getdents",		getdents32,	3),
9336134Scasper 	/* 82 */ SYSENT_CI("privsys",		privsys32,	6),
9340Sstevel@tonic-gate 	/* 83 */ SYSENT_CI("ucredsys",		ucredsys32,	3),
9350Sstevel@tonic-gate 	/* 84 */ SYSENT_CI("sysfs",		sysfs,		3),
9360Sstevel@tonic-gate 	/* 85 */ SYSENT_CI("getmsg",		getmsg32,	4),
9370Sstevel@tonic-gate 	/* 86 */ SYSENT_CI("putmsg",		putmsg32,	4),
9380Sstevel@tonic-gate 	/* 87 */ SYSENT_CI("poll",		poll,		3),
9390Sstevel@tonic-gate 	/* 88 */ SYSENT_CI("lstat",		lstat32,	2),
9400Sstevel@tonic-gate 	/* 89 */ SYSENT_CI("symlink",		symlink,	2),
9410Sstevel@tonic-gate 	/* 90 */ SYSENT_CI("readlink",		readlink32,	3),
9420Sstevel@tonic-gate 	/* 91 */ SYSENT_CI("setgroups",		setgroups,	2),
9430Sstevel@tonic-gate 	/* 92 */ SYSENT_CI("getgroups",		getgroups,	2),
9440Sstevel@tonic-gate 	/* 93 */ SYSENT_CI("fchmod",		fchmod,		2),
9450Sstevel@tonic-gate 	/* 94 */ SYSENT_CI("fchown",		fchown,		3),
9460Sstevel@tonic-gate 	/* 95 */ SYSENT_CI("sigprocmask",	sigprocmask,	3),
9470Sstevel@tonic-gate 	/* 96 */ SYSENT_CI("sigsuspend",	sigsuspend,	1),
9480Sstevel@tonic-gate 	/* 97 */ SYSENT_CI("sigaltstack",	sigaltstack32,	2),
9490Sstevel@tonic-gate 	/* 98 */ SYSENT_CI("sigaction",		sigaction32,	3),
9500Sstevel@tonic-gate 	/* 99 */ SYSENT_CI("sigpending",	sigpending,	2),
9510Sstevel@tonic-gate 
9520Sstevel@tonic-gate 	/* 100 */ SYSENT_CI("getsetcontext",	getsetcontext32, 2),
9530Sstevel@tonic-gate 	/* 101 */ SYSENT_LOADABLE32(),		/* (was evsys) */
9540Sstevel@tonic-gate 	/* 102 */ SYSENT_LOADABLE32(),		/* (was evtrapret) */
9550Sstevel@tonic-gate 	/* 103 */ SYSENT_CI("statvfs",		statvfs32,	2),
9560Sstevel@tonic-gate 	/* 104 */ SYSENT_CI("fstatvfs",		fstatvfs32,	2),
9570Sstevel@tonic-gate 	/* 105 */ SYSENT_CI("getloadavg",	getloadavg,	2),
9580Sstevel@tonic-gate /* ONC_PLUS EXTRACT START */
9590Sstevel@tonic-gate 	/* 106 */ SYSENT_LOADABLE32(),		/* nfssys */
9600Sstevel@tonic-gate /* ONC_PLUS EXTRACT END */
9610Sstevel@tonic-gate 	/* 107 */ SYSENT_CI("waitsys",		waitsys32,	4),
9620Sstevel@tonic-gate 	/* 108 */ SYSENT_CI("sigsendset",	sigsendsys,	2),
9630Sstevel@tonic-gate 	/* 109 */ IF_x86(
9640Sstevel@tonic-gate 			SYSENT_AP("hrtsys",	hrtsys,		5),
9650Sstevel@tonic-gate 			SYSENT_LOADABLE32()),
96610440SRoger.Faulkner@Sun.COM 	/* 110 */ SYSENT_CI("utimesys",		utimesys,	5),
9674806Sraf 	/* 111 */ SYSENT_CI("sigresend",	sigresend,	3),
9680Sstevel@tonic-gate 	/* 112 */ SYSENT_CI("priocntlsys",	priocntlsys,	5),
9690Sstevel@tonic-gate 	/* 113 */ SYSENT_CI("pathconf",		pathconf,	2),
9700Sstevel@tonic-gate 	/* 114 */ SYSENT_CI("mincore",		mincore,	3),
9710Sstevel@tonic-gate 	/* 115 */ SYSENT_CI("mmap",		smmap32,	6),
9720Sstevel@tonic-gate 	/* 116 */ SYSENT_CI("mprotect",		mprotect,	3),
9730Sstevel@tonic-gate 	/* 117 */ SYSENT_CI("munmap",		munmap,		2),
9740Sstevel@tonic-gate 	/* 118 */ SYSENT_CI("fpathconf",	fpathconf,	2),
9750Sstevel@tonic-gate 	/* 119 */ SYSENT_2CI("vfork",		vfork,		0),
9760Sstevel@tonic-gate 	/* 120 */ SYSENT_CI("fchdir",		fchdir,		1),
9770Sstevel@tonic-gate 	/* 121 */ SYSENT_CI("readv",		readv32,	3),
9780Sstevel@tonic-gate 	/* 122 */ SYSENT_CI("writev",		writev32,	3),
9790Sstevel@tonic-gate 	/* 123 */ IF_386_ABI(
9800Sstevel@tonic-gate 			SYSENT_CI("xstat",	xstat32,	3),
9810Sstevel@tonic-gate 			SYSENT_NOSYS()),
9820Sstevel@tonic-gate 	/* 124 */ IF_386_ABI(
9830Sstevel@tonic-gate 			SYSENT_CI("lxstat",	lxstat32,	3),
9840Sstevel@tonic-gate 			SYSENT_NOSYS()),
9850Sstevel@tonic-gate 	/* 125 */ IF_386_ABI(
9860Sstevel@tonic-gate 			SYSENT_CI("fxstat",	fxstat32,	3),
9870Sstevel@tonic-gate 			SYSENT_NOSYS()),
9880Sstevel@tonic-gate 	/* 126 */ IF_386_ABI(
9890Sstevel@tonic-gate 			SYSENT_CI("xmknod",	xmknod,		4),
9900Sstevel@tonic-gate 			SYSENT_NOSYS()),
9918212SMichael.Corcoran@Sun.COM 	/* 127 */ SYSENT_CI("mmapobj",		mmapobjsys,	5),
9920Sstevel@tonic-gate 	/* 128 */ SYSENT_CI("setrlimit",	setrlimit32,	2),
9930Sstevel@tonic-gate 	/* 129 */ SYSENT_CI("getrlimit",	getrlimit32,	2),
9940Sstevel@tonic-gate 	/* 130 */ SYSENT_CI("lchown",		lchown,		3),
9950Sstevel@tonic-gate 	/* 131 */ SYSENT_CI("memcntl",		memcntl,	6),
9960Sstevel@tonic-gate 	/* 132 */ SYSENT_CI("getpmsg",		getpmsg32,	5),
9970Sstevel@tonic-gate 	/* 133 */ SYSENT_CI("putpmsg",		putpmsg32,	5),
9980Sstevel@tonic-gate 	/* 134 */ SYSENT_CI("rename",		rename,		2),
9990Sstevel@tonic-gate 
10000Sstevel@tonic-gate 	/* 135 */ SYSENT_CI("uname",		uname,		1),
10010Sstevel@tonic-gate 	/* 136 */ SYSENT_CI("setegid",		setegid,	1),
10020Sstevel@tonic-gate 	/* 137 */ SYSENT_CI("sysconfig",	sysconfig,	1),
10030Sstevel@tonic-gate 	/* 138 */ SYSENT_CI("adjtime",		adjtime,	2),
10040Sstevel@tonic-gate 	/* 139 */ SYSENT_CI("systeminfo",	systeminfo,	3),
10053957Sth199096 	/* 140 */ SYSENT_LOADABLE32(),		/* sharefs */
10060Sstevel@tonic-gate 	/* 141 */ SYSENT_CI("seteuid",		seteuid,	1),
10073235Sraf 	/* 142 */ SYSENT_2CI("forksys",		forksys,	2),
10080Sstevel@tonic-gate 	/* 143 */ SYSENT_2CI("fork1",		fork1,		0),
10090Sstevel@tonic-gate 	/* 144 */ SYSENT_CI("sigtimedwait",	sigtimedwait,	3),
10100Sstevel@tonic-gate 	/* 145 */ SYSENT_CI("lwp_info",		lwp_info,	1),
10110Sstevel@tonic-gate 	/* 146 */ SYSENT_CI("yield",		yield,		0),
10120Sstevel@tonic-gate 	/* 147 */ SYSENT_CI("lwp_sema_wait",	lwp_sema_wait,	1),
10130Sstevel@tonic-gate 	/* 148 */ SYSENT_CI("lwp_sema_post",	lwp_sema_post,	1),
10140Sstevel@tonic-gate 	/* 149 */ SYSENT_CI("lwp_sema_trywait",	lwp_sema_trywait, 1),
10150Sstevel@tonic-gate 	/* 150 */ SYSENT_CI("lwp_detach",	lwp_detach,	1),
10160Sstevel@tonic-gate 	/* 151 */ SYSENT_CI("corectl",		corectl,	4),
10170Sstevel@tonic-gate 	/* 152 */ SYSENT_CI("modctl",		modctl,		6),
10180Sstevel@tonic-gate 	/* 153 */ SYSENT_CI("fchroot",		fchroot,	1),
10190Sstevel@tonic-gate 	/* 154 */ SYSENT_CI("utimes",		utimes,		2),
10200Sstevel@tonic-gate 	/* 155 */ SYSENT_CI("vhangup",		vhangup,	0),
10210Sstevel@tonic-gate 	/* 156 */ SYSENT_CI("gettimeofday",	gettimeofday,	1),
10220Sstevel@tonic-gate 	/* 157 */ SYSENT_CI("getitimer",	getitimer,	2),
10230Sstevel@tonic-gate 	/* 158 */ SYSENT_CI("setitimer",	setitimer,	3),
10240Sstevel@tonic-gate 	/* 159 */ SYSENT_CI("lwp_create",	syslwp_create,	3),
10250Sstevel@tonic-gate 	/* 160 */ SYSENT_CI("lwp_exit",	(int (*)())syslwp_exit,	0),
10260Sstevel@tonic-gate 	/* 161 */ SYSENT_CI("lwp_suspend",	syslwp_suspend,	1),
10270Sstevel@tonic-gate 	/* 162 */ SYSENT_CI("lwp_continue",	syslwp_continue, 1),
10280Sstevel@tonic-gate 	/* 163 */ SYSENT_CI("lwp_kill",		lwp_kill,	2),
10290Sstevel@tonic-gate 	/* 164 */ SYSENT_CI("lwp_self",		lwp_self,	0),
10300Sstevel@tonic-gate 	/* 165 */ SYSENT_2CI("lwp_sigmask",	lwp_sigmask,	3),
10310Sstevel@tonic-gate 	/* 166 */ IF_x86(
10320Sstevel@tonic-gate 			SYSENT_CI("lwp_private", syslwp_private, 3),
10330Sstevel@tonic-gate 			SYSENT_NOSYS()),
10340Sstevel@tonic-gate 	/* 167 */ SYSENT_CI("lwp_wait",		lwp_wait,	2),
10354574Sraf 	/* 168 */ SYSENT_CI("lwp_mutex_wakeup",	lwp_mutex_wakeup,	2),
10360Sstevel@tonic-gate 	/* 169 */ SYSENT_CI("lwp_mutex_lock",	lwp_mutex_lock,		1),
10370Sstevel@tonic-gate 	/* 170 */ SYSENT_CI("lwp_cond_wait",	lwp_cond_wait,		4),
10380Sstevel@tonic-gate 	/* 171 */ SYSENT_CI("lwp_cond_signal",	lwp_cond_signal,	1),
10390Sstevel@tonic-gate 	/* 172 */ SYSENT_CI("lwp_cond_broadcast", lwp_cond_broadcast,	1),
10400Sstevel@tonic-gate 	/* 173 */ SYSENT_CI("pread",		pread32,		4),
10410Sstevel@tonic-gate 	/* 174 */ SYSENT_CI("pwrite",		pwrite32,		4),
10420Sstevel@tonic-gate 	/* 175 */ SYSENT_C("llseek",		llseek32,	4),
10430Sstevel@tonic-gate 	/* 176 */ SYSENT_LOADABLE32(),		/* inst_sync */
10442712Snn35248 	/* 177 */ SYSENT_CI("brandsys",		brandsys,	6),
10450Sstevel@tonic-gate 	/* 178 */ SYSENT_LOADABLE32(),		/* kaio */
10460Sstevel@tonic-gate 	/* 179 */ SYSENT_LOADABLE32(),		/* cpc */
10470Sstevel@tonic-gate 	/* 180 */ SYSENT_CI("lgrpsys",		lgrpsys,	3),
10483247Sgjelinek 	/* 181 */ SYSENT_CI("rusagesys",	rusagesys,	5),
10490Sstevel@tonic-gate 	/* 182 */ SYSENT_LOADABLE32(),		/* portfs */
10500Sstevel@tonic-gate 	/* 183 */ SYSENT_CI("pollsys",		pollsys,	4),
10511676Sjpk 	/* 184 */ SYSENT_CI("labelsys",		labelsys,	5),
10520Sstevel@tonic-gate 	/* 185 */ SYSENT_CI("acl",		acl,		4),
10530Sstevel@tonic-gate 	/* 186 */ SYSENT_AP("auditsys",		auditsys,	2),
10540Sstevel@tonic-gate 	/* 187 */ SYSENT_CI("processor_bind",	processor_bind,	4),
10550Sstevel@tonic-gate 	/* 188 */ SYSENT_CI("processor_info",	processor_info,	2),
10560Sstevel@tonic-gate 	/* 189 */ SYSENT_CI("p_online",		p_online,	2),
10572248Sraf 	/* 190 */ SYSENT_CI("sigqueue",		sigqueue32,	5),
10580Sstevel@tonic-gate 	/* 191 */ SYSENT_CI("clock_gettime",	clock_gettime,	2),
10590Sstevel@tonic-gate 	/* 192 */ SYSENT_CI("clock_settime",	clock_settime,	2),
10600Sstevel@tonic-gate 	/* 193 */ SYSENT_CI("clock_getres",	clock_getres,	2),
10610Sstevel@tonic-gate 	/* 194 */ SYSENT_CI("timer_create",	timer_create,	3),
10620Sstevel@tonic-gate 	/* 195 */ SYSENT_CI("timer_delete",	timer_delete,	1),
10630Sstevel@tonic-gate 	/* 196 */ SYSENT_CI("timer_settime",	timer_settime,	4),
10640Sstevel@tonic-gate 	/* 197 */ SYSENT_CI("timer_gettime",	timer_gettime,	2),
10650Sstevel@tonic-gate 	/* 198 */ SYSENT_CI("timer_getoverrun",	timer_getoverrun, 1),
10660Sstevel@tonic-gate 	/* 199 */ SYSENT_CI("nanosleep",	nanosleep,	2),
10670Sstevel@tonic-gate 	/* 200 */ SYSENT_CI("facl",		facl,		4),
10680Sstevel@tonic-gate 	/* 201 */ SYSENT_LOADABLE32(),		/* door */
10690Sstevel@tonic-gate 	/* 202 */ SYSENT_CI("setreuid",		setreuid,	2),
10700Sstevel@tonic-gate 	/* 203 */ SYSENT_CI("setregid",		setregid,	2),
10710Sstevel@tonic-gate 	/* 204 */ SYSENT_CI("install_utrap",	install_utrap,	3),
10720Sstevel@tonic-gate 	/* 205 */ SYSENT_CI("signotify",	signotify,	3),
10730Sstevel@tonic-gate 	/* 206 */ SYSENT_CI("schedctl",		schedctl,	0),
10740Sstevel@tonic-gate 	/* 207 */ SYSENT_LOADABLE32(),		/* pset */
10750Sstevel@tonic-gate 	/* 208 */ SYSENT_LOADABLE32(),
10760Sstevel@tonic-gate 	/* 209 */ SYSENT_CI("resolvepath",	resolvepath,	3),
1077*10887SRoger.Faulkner@Sun.COM 	/* 210 */ SYSENT_CI("lwp_mutex_timedlock", lwp_mutex_timedlock, 3),
10780Sstevel@tonic-gate 	/* 211 */ SYSENT_CI("lwp_sema_timedwait", lwp_sema_timedwait,	3),
10790Sstevel@tonic-gate 	/* 212 */ SYSENT_CI("lwp_rwlock_sys",	lwp_rwlock_sys,	3),
10800Sstevel@tonic-gate 	/*
10810Sstevel@tonic-gate 	 * Syscalls 213-225: 32-bit system call support for large files.
10820Sstevel@tonic-gate 	 */
10830Sstevel@tonic-gate 	/* 213 */ SYSENT_CI("getdents64",	getdents64,	3),
10840Sstevel@tonic-gate 	/* 214 */ SYSENT_AP("smmaplf32", 	smmaplf32, 	7),
10850Sstevel@tonic-gate 	/* 215 */ SYSENT_CI("stat64", 		stat64_32, 	2),
10860Sstevel@tonic-gate 	/* 216 */ SYSENT_CI("lstat64", 		lstat64_32,	2),
10870Sstevel@tonic-gate 	/* 217 */ SYSENT_CI("fstat64", 		fstat64_32, 	2),
10880Sstevel@tonic-gate 	/* 218 */ SYSENT_CI("statvfs64", 	statvfs64_32, 	2),
10890Sstevel@tonic-gate 	/* 219 */ SYSENT_CI("fstatvfs64", 	fstatvfs64_32, 	2),
10900Sstevel@tonic-gate 	/* 220 */ SYSENT_CI("setrlimit64", 	setrlimit64, 	2),
10910Sstevel@tonic-gate 	/* 221 */ SYSENT_CI("getrlimit64", 	getrlimit64, 	2),
10920Sstevel@tonic-gate 	/* 222 */ SYSENT_CI("pread64", 		pread64, 	5),
10930Sstevel@tonic-gate 	/* 223 */ SYSENT_CI("pwrite64", 	pwrite64, 	5),
10940Sstevel@tonic-gate 	/* 224 */ SYSENT_CI("creat64",		creat64,	2),
10950Sstevel@tonic-gate 	/* 225 */ SYSENT_CI("open64",		open64,		3),
10960Sstevel@tonic-gate 	/* 226 */ SYSENT_LOADABLE32(),		/* rpcsys */
10970Sstevel@tonic-gate 	/* 227 */ SYSENT_CI("zone",		zone,		6),
10980Sstevel@tonic-gate 	/* 228 */ SYSENT_LOADABLE32(),		/* autofssys */
10990Sstevel@tonic-gate 	/* 229 */ SYSENT_CI("getcwd",		getcwd,		2),
11000Sstevel@tonic-gate 	/* 230 */ SYSENT_CI("so_socket",	so_socket,	5),
11010Sstevel@tonic-gate 	/* 231 */ SYSENT_CI("so_socketpair",	so_socketpair,	1),
11020Sstevel@tonic-gate 	/* 232 */ SYSENT_CI("bind",		bind,		4),
11030Sstevel@tonic-gate 	/* 233 */ SYSENT_CI("listen",		listen,		3),
11040Sstevel@tonic-gate 	/* 234 */ SYSENT_CI("accept",		accept,		4),
11050Sstevel@tonic-gate 	/* 235 */ SYSENT_CI("connect",		connect,	4),
11060Sstevel@tonic-gate 	/* 236 */ SYSENT_CI("shutdown",		shutdown,	3),
11070Sstevel@tonic-gate 	/* 237 */ SYSENT_CI("recv",		recv32,		4),
11080Sstevel@tonic-gate 	/* 238 */ SYSENT_CI("recvfrom",		recvfrom32,	6),
11090Sstevel@tonic-gate 	/* 239 */ SYSENT_CI("recvmsg",		recvmsg,	3),
11100Sstevel@tonic-gate 	/* 240 */ SYSENT_CI("send",		send32,		4),
11110Sstevel@tonic-gate 	/* 241 */ SYSENT_CI("sendmsg",		sendmsg,	3),
11120Sstevel@tonic-gate 	/* 242 */ SYSENT_CI("sendto",		sendto32,	6),
11130Sstevel@tonic-gate 	/* 243 */ SYSENT_CI("getpeername",	getpeername,	4),
11140Sstevel@tonic-gate 	/* 244 */ SYSENT_CI("getsockname",	getsockname,	4),
11150Sstevel@tonic-gate 	/* 245 */ SYSENT_CI("getsockopt",	getsockopt,	6),
11160Sstevel@tonic-gate 	/* 246 */ SYSENT_CI("setsockopt",	setsockopt,	6),
11170Sstevel@tonic-gate 	/* 247 */ SYSENT_CI("sockconfig",	sockconfig,	4),
11180Sstevel@tonic-gate 	/* 248 */ SYSENT_CI("ntp_gettime",	ntp_gettime,	1),
11190Sstevel@tonic-gate 	/* 249 */ SYSENT_CI("ntp_adjtime",	ntp_adjtime,	1),
11200Sstevel@tonic-gate 	/* 250 */ SYSENT_CI("lwp_mutex_unlock",	lwp_mutex_unlock,	1),
1121*10887SRoger.Faulkner@Sun.COM 	/* 251 */ SYSENT_CI("lwp_mutex_trylock", lwp_mutex_trylock,	2),
11229264SRoger.Faulkner@Sun.COM 	/* 252 */ SYSENT_CI("lwp_mutex_register", lwp_mutex_register,	2),
11230Sstevel@tonic-gate 	/* 253 */ SYSENT_CI("cladm",		cladm,		3),
11242712Snn35248 	/* 254 */ SYSENT_CI("uucopy",		uucopy,		3),
11250Sstevel@tonic-gate 	/* 255 */ SYSENT_CI("umount2",		umount2,	2)
11260Sstevel@tonic-gate /* ONC_PLUS EXTRACT START */
11270Sstevel@tonic-gate };
11280Sstevel@tonic-gate /* ONC_PLUS EXTRACT END */
11290Sstevel@tonic-gate #endif /* _SYSCALL32_IMPL */
11300Sstevel@tonic-gate 
11310Sstevel@tonic-gate /*
11320Sstevel@tonic-gate  * Space allocated and initialized in init_syscallnames().
11330Sstevel@tonic-gate  */
11340Sstevel@tonic-gate char **syscallnames;
11350Sstevel@tonic-gate 
11360Sstevel@tonic-gate systrace_sysent_t *systrace_sysent;
11370Sstevel@tonic-gate void (*systrace_probe)(dtrace_id_t, uintptr_t, uintptr_t,
11382769Sahl     uintptr_t, uintptr_t, uintptr_t, uintptr_t);
11390Sstevel@tonic-gate 
11400Sstevel@tonic-gate /*ARGSUSED*/
11410Sstevel@tonic-gate void
11420Sstevel@tonic-gate systrace_stub(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1,
11432769Sahl     uintptr_t arg2, uintptr_t arg3, uintptr_t arg4, uintptr_t arg5)
11440Sstevel@tonic-gate {}
11450Sstevel@tonic-gate 
11460Sstevel@tonic-gate /*ARGSUSED*/
11470Sstevel@tonic-gate int64_t
11480Sstevel@tonic-gate dtrace_systrace_syscall(uintptr_t arg0, uintptr_t arg1, uintptr_t arg2,
11490Sstevel@tonic-gate     uintptr_t arg3, uintptr_t arg4, uintptr_t arg5)
11500Sstevel@tonic-gate {
11510Sstevel@tonic-gate 	systrace_sysent_t *sy = &systrace_sysent[curthread->t_sysnum];
11520Sstevel@tonic-gate 	dtrace_id_t id;
11530Sstevel@tonic-gate 	int64_t rval;
11540Sstevel@tonic-gate 	proc_t *p;
11550Sstevel@tonic-gate 
11560Sstevel@tonic-gate 	if ((id = sy->stsy_entry) != DTRACE_IDNONE)
11572769Sahl 		(*systrace_probe)(id, arg0, arg1, arg2, arg3, arg4, arg5);
11580Sstevel@tonic-gate 
11590Sstevel@tonic-gate 	/*
11600Sstevel@tonic-gate 	 * We want to explicitly allow DTrace consumers to stop a process
11610Sstevel@tonic-gate 	 * before it actually executes the meat of the syscall.
11620Sstevel@tonic-gate 	 */
11630Sstevel@tonic-gate 	p = ttoproc(curthread);
11640Sstevel@tonic-gate 	mutex_enter(&p->p_lock);
11650Sstevel@tonic-gate 	if (curthread->t_dtrace_stop && !curthread->t_lwp->lwp_nostop) {
11660Sstevel@tonic-gate 		curthread->t_dtrace_stop = 0;
11670Sstevel@tonic-gate 		stop(PR_REQUESTED, 0);
11680Sstevel@tonic-gate 	}
11690Sstevel@tonic-gate 	mutex_exit(&p->p_lock);
11700Sstevel@tonic-gate 
11710Sstevel@tonic-gate 	rval = (*sy->stsy_underlying)(arg0, arg1, arg2, arg3, arg4, arg5);
11720Sstevel@tonic-gate 
11730Sstevel@tonic-gate 	if (ttolwp(curthread)->lwp_errno != 0)
11740Sstevel@tonic-gate 		rval = -1;
11750Sstevel@tonic-gate 
11760Sstevel@tonic-gate 	if ((id = sy->stsy_return) != DTRACE_IDNONE)
11770Sstevel@tonic-gate 		(*systrace_probe)(id, (uintptr_t)rval, (uintptr_t)rval,
11782769Sahl 		    (uintptr_t)((int64_t)rval >> 32), 0, 0, 0);
11790Sstevel@tonic-gate 
11800Sstevel@tonic-gate 	return (rval);
11810Sstevel@tonic-gate }
11820Sstevel@tonic-gate 
11830Sstevel@tonic-gate #ifdef _SYSCALL32_IMPL
11840Sstevel@tonic-gate 
11850Sstevel@tonic-gate systrace_sysent_t *systrace_sysent32;
11860Sstevel@tonic-gate 
11870Sstevel@tonic-gate /*ARGSUSED*/
11880Sstevel@tonic-gate int64_t
11890Sstevel@tonic-gate dtrace_systrace_syscall32(uintptr_t arg0, uintptr_t arg1, uintptr_t arg2,
11900Sstevel@tonic-gate     uintptr_t arg3, uintptr_t arg4, uintptr_t arg5)
11910Sstevel@tonic-gate {
11920Sstevel@tonic-gate 	systrace_sysent_t *sy = &systrace_sysent32[curthread->t_sysnum];
11930Sstevel@tonic-gate 	dtrace_id_t id;
11940Sstevel@tonic-gate 	int64_t rval;
11950Sstevel@tonic-gate 	proc_t *p;
11960Sstevel@tonic-gate 
11970Sstevel@tonic-gate 	if ((id = sy->stsy_entry) != DTRACE_IDNONE)
11982769Sahl 		(*systrace_probe)(id, arg0, arg1, arg2, arg3, arg4, arg5);
11990Sstevel@tonic-gate 
12000Sstevel@tonic-gate 	/*
12010Sstevel@tonic-gate 	 * We want to explicitly allow DTrace consumers to stop a process
12020Sstevel@tonic-gate 	 * before it actually executes the meat of the syscall.
12030Sstevel@tonic-gate 	 */
12040Sstevel@tonic-gate 	p = ttoproc(curthread);
12050Sstevel@tonic-gate 	mutex_enter(&p->p_lock);
12060Sstevel@tonic-gate 	if (curthread->t_dtrace_stop && !curthread->t_lwp->lwp_nostop) {
12070Sstevel@tonic-gate 		curthread->t_dtrace_stop = 0;
12080Sstevel@tonic-gate 		stop(PR_REQUESTED, 0);
12090Sstevel@tonic-gate 	}
12100Sstevel@tonic-gate 	mutex_exit(&p->p_lock);
12110Sstevel@tonic-gate 
12120Sstevel@tonic-gate 	rval = (*sy->stsy_underlying)(arg0, arg1, arg2, arg3, arg4, arg5);
12130Sstevel@tonic-gate 
12140Sstevel@tonic-gate 	if (ttolwp(curthread)->lwp_errno != 0)
12150Sstevel@tonic-gate 		rval = -1;
12160Sstevel@tonic-gate 
12170Sstevel@tonic-gate 	if ((id = sy->stsy_return) != DTRACE_IDNONE)
12180Sstevel@tonic-gate 		(*systrace_probe)(id, (uintptr_t)rval, (uintptr_t)rval,
12192769Sahl 		    (uintptr_t)((uint64_t)rval >> 32), 0, 0, 0);
12200Sstevel@tonic-gate 
12210Sstevel@tonic-gate 	return (rval);
12220Sstevel@tonic-gate }
12230Sstevel@tonic-gate 
12240Sstevel@tonic-gate #endif
12250Sstevel@tonic-gate 
12260Sstevel@tonic-gate void
12270Sstevel@tonic-gate dtrace_systrace_rtt(void)
12280Sstevel@tonic-gate {
12290Sstevel@tonic-gate 	systrace_sysent_t *sy;
12300Sstevel@tonic-gate 	dtrace_id_t id;
12310Sstevel@tonic-gate 
12320Sstevel@tonic-gate 	if (get_udatamodel() == DATAMODEL_NATIVE) {
12330Sstevel@tonic-gate 		if (systrace_sysent == NULL)
12340Sstevel@tonic-gate 			return;
12350Sstevel@tonic-gate 
12360Sstevel@tonic-gate 		sy = &systrace_sysent[curthread->t_sysnum];
12370Sstevel@tonic-gate #ifdef _SYSCALL32_IMPL
12380Sstevel@tonic-gate 	} else {
12390Sstevel@tonic-gate 		if (systrace_sysent32 == NULL)
12400Sstevel@tonic-gate 			return;
12410Sstevel@tonic-gate 
12420Sstevel@tonic-gate 		sy = &systrace_sysent32[curthread->t_sysnum];
12430Sstevel@tonic-gate #endif
12440Sstevel@tonic-gate 	}
12450Sstevel@tonic-gate 
12460Sstevel@tonic-gate 	if ((id = sy->stsy_return) != DTRACE_IDNONE)
12472769Sahl 		(*systrace_probe)(id, 0, 0, 0, 0, 0, 0);
12480Sstevel@tonic-gate }
1249