[16] | 1 | /*************************************************************************** |
---|
| 2 | * |
---|
| 3 | * Copyright (C) 2001 International Business Machines |
---|
| 4 | * All rights reserved. |
---|
| 5 | * |
---|
| 6 | * This file is part of the GPFS mmfslinux kernel module. |
---|
| 7 | * |
---|
| 8 | * Redistribution and use in source and binary forms, with or without |
---|
| 9 | * modification, are permitted provided that the following conditions |
---|
| 10 | * are met: |
---|
| 11 | * |
---|
| 12 | * 1. Redistributions of source code must retain the above copyright notice, |
---|
| 13 | * this list of conditions and the following disclaimer. |
---|
| 14 | * 2. Redistributions in binary form must reproduce the above copyright |
---|
| 15 | * notice, this list of conditions and the following disclaimer in the |
---|
| 16 | * documentation and/or other materials provided with the distribution. |
---|
| 17 | * 3. The name of the author may not be used to endorse or promote products |
---|
| 18 | * derived from this software without specific prior written |
---|
| 19 | * permission. |
---|
| 20 | * |
---|
| 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
---|
| 22 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
---|
| 23 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
---|
| 24 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
---|
| 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
---|
| 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
---|
| 27 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
---|
| 28 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
---|
| 29 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
---|
| 30 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 31 | * |
---|
| 32 | *************************************************************************** */ |
---|
| 33 | /* @(#)42 1.13 src/avs/fs/mmfs/ts/kernext/gpl-linux/tracedev-ksyms.c, mmfs, avs_rgpfs24, rgpfs240610b 10/28/05 11:21:21 */ |
---|
| 34 | /* |
---|
| 35 | * Export symbols for tracing module (tracedev) |
---|
| 36 | * |
---|
| 37 | * Define new global variables with GPFS_EXPORT_SYMBOL(varname). |
---|
| 38 | * Define new functions with GPFS_EXPORT_FUNC(varname). |
---|
| 39 | * |
---|
| 40 | * The latter will automatically spit out a generic function |
---|
| 41 | * prototype. The prototype format doesn't matter here, but |
---|
| 42 | * it is important to let the compiler know that something |
---|
| 43 | * is really a function (or else incorrect code is spewed out |
---|
| 44 | * on IA64 for the relocation entry which trips up insmod; |
---|
| 45 | * the i386 platform doesn't have this feature). |
---|
| 46 | * |
---|
| 47 | * |
---|
| 48 | */ |
---|
| 49 | |
---|
| 50 | #ifndef KTRACE |
---|
| 51 | |
---|
| 52 | /* If trace is built into kernel, pick up GPFS flag definitions from a file |
---|
| 53 | rather than requiring them to be defined on the command line. Also, put |
---|
| 54 | trace global variables here rather than in GPFS kernel module so that |
---|
| 55 | they can be referenced by code in kernel. */ |
---|
| 56 | #ifndef MODULE |
---|
| 57 | #define DEFINE_TRACE_GBL_VARS |
---|
| 58 | /* #include <linux/ktrace.h> */ |
---|
| 59 | #endif |
---|
| 60 | |
---|
| 61 | #include <linux/version.h> |
---|
| 62 | #include <linux/module.h> |
---|
| 63 | #define GPFS_GPL |
---|
| 64 | |
---|
| 65 | #ifdef GPFS_EXPORT_KSYMS |
---|
| 66 | |
---|
| 67 | /* Use GPFS_EXPORT_SYMBOL for exporting a variable */ |
---|
| 68 | /* Use GPFS_EXPORT_FUNC for exporting a function */ |
---|
| 69 | |
---|
| 70 | #if LINUX_KERNEL_VERSION > 2061300 |
---|
| 71 | #define GPFS_EXPORT_SYMBOL(VAR) EXPORT_SYMBOL(VAR); |
---|
| 72 | #define GPFS_EXPORT_FUNC(FNAME) extern void FNAME (); \ |
---|
| 73 | EXPORT_SYMBOL(FNAME); |
---|
| 74 | #else |
---|
| 75 | #if LINUX_KERNEL_VERSION > 2050000 |
---|
| 76 | #define GPFS_EXPORT_SYMBOL(VAR) EXPORT_SYMBOL_NOVERS(VAR); |
---|
| 77 | #else |
---|
| 78 | #define GPFS_EXPORT_SYMBOL(VAR) extern VAR; EXPORT_SYMBOL_NOVERS(VAR); |
---|
| 79 | #endif |
---|
| 80 | #define GPFS_EXPORT_FUNC(FNAME) extern void FNAME (); \ |
---|
| 81 | EXPORT_SYMBOL_NOVERS(FNAME); |
---|
| 82 | #endif |
---|
| 83 | |
---|
| 84 | /* ************** */ |
---|
| 85 | /* Export section */ |
---|
| 86 | /* ************** */ |
---|
| 87 | #ifndef GPFS_PRINTF |
---|
| 88 | GPFS_EXPORT_FUNC(_STrace); |
---|
| 89 | GPFS_EXPORT_FUNC(_STraceNB); |
---|
| 90 | GPFS_EXPORT_FUNC(_XTrace); |
---|
| 91 | GPFS_EXPORT_FUNC(_XTraceNB); |
---|
| 92 | #if 0 |
---|
| 93 | GPFS_EXPORT_SYMBOL(lxthe); |
---|
| 94 | #endif |
---|
| 95 | GPFS_EXPORT_FUNC(trc_fsync); |
---|
| 96 | #ifndef MODULE |
---|
| 97 | EXPORT_SYMBOL_NOVERS(TraceFlagsP); |
---|
| 98 | #endif |
---|
| 99 | #endif /* ! GPFS_PRINTF */ |
---|
| 100 | |
---|
| 101 | #endif /* GPFS_EXPORT_KSYMS */ |
---|
| 102 | #endif /* ! KTRACE */ |
---|