/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/asm_linkage.h>
/*
* Kernel function call invocation
*/
#if defined(__lint)
/*ARGSUSED*/
{
return (0);
}
#else
/*
* A jump table containing the addresses for register argument copy
* code.
*/
/*
* This is going to be fun. We were called with the function pointer
* in in %rsi, argc in %rdx, and a pointer to an array of uintptr_t's
* (the arguments to be passed) in %rcx. In the worst case, we need
* to move the first six arguments from the array to %rdi, %rsi, %rdx,
* %rcx, %r8, and %r9. The remaining arguments need to be copied from
* the array to 0(%rsp), 8(%rsp), and so on. Then we can call the
* function.
*/
/*
* More than six arguments. Reserve space for the seventh and beyond on
* the stack, and copy them in. To make the copy easier, we're going to
* pretend to reserve space on the stack for all of the arguments, thus
* allowing us to use the same scaling for the store as we do for the
* load. When we're done copying the excess arguments, we'll move %rsp
* back, reclaiming the extra space we reserved.
*/
jg 1b
/*
* Excess arguments have been copied and stripped from argc (or there
* weren't any to begin with). Copy the first five to their ABI-
* designated registers. We have to do this somewhat carefully, as
* argc (%rdx) and argv (%rsi) are in to-be-trampled registers.
*/
/* Arguments are copied. Time to call the function */
/*
* Deallocate the stack-based arguments, if any, and return to the
* caller.
*/
#endif