1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22/* 23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27#pragma ident "%Z%%M% %I% %E% SMI" 28 29#include <sys/asm_linkage.h> 30 31/* 32 * Kernel function call invocation 33 */ 34 35#if defined(__lint) 36/*ARGSUSED*/ 37uintptr_t 38kaif_invoke(uintptr_t funcva, uint_t argc, const uintptr_t argv[]) 39{ 40 return (0); 41} 42#else 43 44 ENTRY_NP(kaif_invoke) 45 46 pushl %ebp 47 movl %esp, %ebp 48 pushl %edi 49 50 movl 0xc(%ebp), %ecx /* argc */ 51 movl 0x10(%ebp), %edi /* argv */ 52 53 /* push the contents of argv onto the stack */ 541: cmpl $0, %ecx 55 je 2f 56 dec %ecx 57 pushl (%edi, %ecx, 4) 58 jmp 1b 59 60 /* call the function */ 612: movl 0x8(%ebp), %eax 62 call *%eax 63 64 /* pop the arguments */ 65 movl 0xc(%ebp), %ecx 66 sall $2, %ecx 67 addl %ecx, %esp 68 69 popl %edi 70 leave 71 ret 72 73 SET_SIZE(kaif_invoke) 74 75#endif 76