modstubs.s revision c892ebf1bef94f4f922f282c11516677c134dbe0
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#if !defined(lint)
#include "assym.h"
#endif /* !lint */
#include <sys/asm_linkage.h>
#if defined(lint)
#else /* lint */
/*
* WARNING: there is no check for forgetting to write END_MODULE,
* and if you do, the kernel will most likely crash. Be careful
*
* This file assumes that all of the contributions to the data segment
* will be contiguous in the output file, even though they are separated
* by pieces of text. This is safe for all assemblers I know of now...
*/
/*
* This file uses ansi preprocessor features:
*
* 1. #define mac(a) extra_ ## a --> mac(x) expands to extra_a
* The old version of this is
* #define mac(a) extra_/.*.*./a
* but this fails if the argument has spaces "mac ( x )"
* (Ignore the dots above, I had to put them in to keep this a comment.)
*
* 2. #define mac(a) #a --> mac(x) expands to "x"
* The old version is
* #define mac(a) "a"
*
* For some reason, the 5.0 preprocessor isn't happy with the above usage.
* For now, we're not using these ansi features.
*
* The reason is that "the 5.0 ANSI preprocessor" is built into the compiler
* and is a tokenizing preprocessor. This means, when confronted by something
* other than C token generation rules, strange things occur. In this case,
* when confronted by an assembly file, it would turn the token ".globl" into
* two tokens "." and "globl". For this reason, the traditional, non-ANSI
* preprocessor is used on assembly files.
*
* It would be desirable to have a non-tokenizing cpp (accp?) to use for this.
*/
/*
* This file contains the stubs routines for modules which can be autoloaded.
*/
/*
* See the 'struct mod_modinfo' definition to see what this structure
* is trying to achieve here.
*/
/*
* XX64 - This still needs some repair.
* (a) define 'pointer alignment' and use it
* (b) define '.pword' or equivalent, and use it (to mean .word or .xword).
*/
.seg ".data"; \
.byte 0; \
.word 0; \
.word 0; \
.word 0;
#define END_MODULE(module) \
/*
* "weak stub", don't load on account of this call
*/
/*
* "non-unloadable stub", don't bother 'holding' module if it's already loaded
* since the module cannot be unloaded.
*
* User *MUST* guarantee the module is not unloadable (no _fini routine).
*/
/*
* Macro for modstubbed system calls whose modules are not unloadable.
*
* System call modstubs needs special handling for the case where
* the modstub is a system call, because %fp comes from user frame.
*/
/* "weak stub" for non-unloadable module, don't load on account of this call */
.seg ".data"; \
.align 8; \
.word 0; /* 0 */ \
.word 0; /* 8 */ \
.word 0; /* 10 */ \
.word 0; /* 18 */ \
/*
* The flag MODS_INSTALLED is stored in the stub data and is used to
* indicate if a module is installed and initialized. This flag is used
* instead of the mod_stub_info->mods_modinfo->mod_installed flag
* to minimize the number of pointer de-references for each function
* call (and also to avoid possible TLB misses which could be induced
* by dereferencing these pointers.)
*/
restore; \
restore; \
restore; \
b stubs_common_code; \
restore; \
restore; \
b stubs_common_code; \
restore; \
restore; \
b stubs_common_code; \
.section ".text"
/*
* We branch here with the fcnname_info pointer in l5
* and the frame size in %l4.
*/
1:
/* Copy stack frame */
bg,a 1b
2:
bne,a 1f
1:
ret /* return to caller */
.seg ".text"
/*
* WARNING WARNING WARNING!!!!!!
*
* On the MODULE macro you MUST NOT use any spaces!!! They are
* significant to the preprocessor. With ansi c there is a way around this
* but for some reason (yet to be investigated) ansi didn't work for other
* reasons!
*
* When zero is used as the return function, the system will call
* panic if the stub can't be resolved.
*/
/*
* Stubs for devfs. A non-unloadable module.
*/
#ifndef DEVFS_MODULE
#endif
/*
* Stubs for /dev fs.
*/
#ifndef DEV_MODULE
#endif
/*
* Stubs for specfs. A non-unloadable module.
*/
#ifndef SPEC_MODULE
#endif
/*
* Stubs for sockfs. A non-unloadable module.
*/
#ifndef SOCK_MODULE
#ifdef _SYSCALL32_IMPL
#endif /* _SYSCALL32_IMPL */
#endif
/*
* IPsec stubs.
*/
#ifndef IPSECAH_MODULE
#endif
#ifndef IPSECESP_MODULE
#endif
#ifndef KEYSOCK_MODULE
#endif
#ifndef SPDSOCK_MODULE
#endif
#ifndef NATTYMOD_MODULE
#endif
/*
* Stubs for nfs common code.
* XXX nfs_getvnodeops should go away with removal of kludge in vnode.c
*/
#ifndef NFS_MODULE
#endif
/*
* Stubs for nfs_dlboot (diskless booting).
*/
#ifndef NFS_DLBOOT_MODULE
#endif
/*
* Stubs for nfs server-only code.
*/
#ifndef NFSSRV_MODULE
#endif
/*
* Stubs for kernel lock manager.
*/
#ifndef KLM_MODULE
#endif
#ifndef KLMOPS_MODULE
#endif
/*
* Stubs for kernel TLI module
* XXX currently we never allow this to unload
*/
#ifndef TLI_MODULE
#endif
/*
* Stubs for kernel RPC module
* XXX currently we never allow this to unload
*/
#ifndef RPC_MODULE
#endif
/*
* Stubs for des
*/
#ifndef DES_MODULE
#endif
/*
* Stubs for procfs. A non-unloadable module.
*/
#ifndef PROC_MODULE
#ifdef _SYSCALL32_IMPL
#endif /* _SYSCALL32_IMPL */
#endif
/*
* Stubs for fifofs
*/
#ifndef FIFO_MODULE
#endif
/*
* Stubs for ufs
*
* This is needed to support the old quotactl system call.
* When the old sysent stuff goes away, this will need to be revisited.
*/
#ifndef UFS_MODULE
#endif
/*
* Stubs for namefs
*/
#ifndef NAMEFS_MODULE
#endif
/*
* Stubs for ts_dptbl
*/
#ifndef TS_DPTBL_MODULE
#endif
/*
* Stubs for rt_dptbl
*/
#ifndef RT_DPTBL_MODULE
#endif
/*
* Stubs for ia_dptbl
*/
#ifndef IA_DPTBL_MODULE
#endif
/*
* Stubs for FSS scheduler
*/
#ifndef FSS_MODULE
#endif
/*
* Stubs for fx_dptbl
*/
#ifndef FX_DPTBL_MODULE
#endif
/*
* Stubs for kb (only needed for 'win')
*/
#ifndef KB_MODULE
END_MODULE(kb);
#endif
/*
* Stubs for swapgeneric
*/
#ifndef SWAPGENERIC_MODULE
#endif
/*
* Stubs for bootdev
*/
#ifndef BOOTDEV_MODULE
#endif
/*
* stubs for strplumb...
*/
#ifndef STRPLUMB_MODULE
#endif
/*
* Stubs for console configuration module
*/
#ifndef CONSCONFIG_MODULE
#endif
/*
* Stubs for zs (uart) module
*/
#ifndef ZS_MODULE
END_MODULE(zs);
#endif
/*
* Stubs for accounting.
*/
#ifndef SYSACCT_MODULE
#endif
/*
* Stubs for semaphore routines. sem.c
*/
#ifndef SEMSYS_MODULE
#endif
/*
* Stubs for shmem routines. shm.c
*/
#ifndef SHMSYS_MODULE
#endif
/*
* Stubs for doors
*/
#ifndef DOORFS_MODULE
#endif
/*
* Stubs for dma routines. dmaga.c
* (These are only needed for cross-checks, not autoloading)
*/
#ifndef DMA_MODULE
#endif
/*
* Stubs for auditing.
*/
#ifndef C2AUDIT_MODULE
#endif
/*
* Stubs for kernel rpc security service module
*/
#ifndef RPCSEC_MODULE
#endif
/*
* Stubs for rpc RPCSEC_GSS security service module
*/
#ifndef RPCSEC_GSS_MODULE
#endif
#ifndef SAD_MODULE
#endif
#ifndef IWSCN_MODULE
#endif
/*
* Stubs for checkpoint-resume module
*/
#ifndef CPR_MODULE
#endif
/*
* Stubs for VIS module
*/
#ifndef VIS_MODULE
#endif
/*
* Stubs for kernel probes (tnf module). Not unloadable.
*/
#ifndef TNF_MODULE
#endif
/*
* Clustering: stubs for bootstrapping.
*/
#ifndef CL_BOOTSTRAP
#endif
/*
* Clustering: stubs for cluster infrastructure.
*/
#ifndef CL_COMM_MODULE
#endif
/*
* Clustering: stubs for global file system operations.
*/
#ifndef PXFS_MODULE
#endif
/*
*/
#ifndef PCICFG_E_MODULE
END_MODULE(pcicfg.e);
#endif
/*
*/
#ifndef PCIEHPC_MODULE
#endif
/*
*/
#ifndef PCISHPC_MODULE
#endif
#ifndef PCIHP_MODULE
#endif
/*
*/
#ifndef KCF_MODULE
#endif
/*
* Stubs for sha1. A non-unloadable module.
*/
#ifndef SHA1_MODULE
#endif
/*
* The following stubs are used by the mac module.
* Since dls and dld already depend on mac, these
* stubs are needed to avoid circular dependencies.
*/
#ifndef DLS_MODULE
#endif
#ifndef DLD_MODULE
#endif
/*
* Stubs for kssl, the kernel SSL proxy
*/
#ifndef KSSL_MODULE
#endif
.seg ".text"
#endif /* lint */