/usr/src/blcr-0.8.5/include/blcr_ksyms.h is in blcr-dkms 0.8.5-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | /*
* Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c)
* 2003, The Regents of the University of California, through Lawrence
* Berkeley National Laboratory (subject to receipt of any required
* approvals from the U.S. Dept. of Energy). All rights reserved.
*
* Portions may be copyrighted by others, as may be noted in specific
* copyright notices within specific files.
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: blcr_ksyms.h,v 1.18.8.4 2012/12/23 04:36:35 phargrov Exp $
*/
#ifndef _CR_KSYMS_H
#define _CR_KSYMS_H 1
/* Give the linker a literal address for a symbol.
* Note that the case is preserved in the preprocessor symbols.
*
* Note that the CR_IMPORT_K*() must come AFTER the last use in a given
* source file, or in a separate source file. Otherwise, the assembler
* may generate PC-relative calls that the ELF-validation code in some
* 2.6.x kernels (e.g. FC3) will reject. To meet this requirement,
* BLCR is currently putting all IMPORTS in a separate kernel module.
*
*
* Example:
* #if defined(CR_KDATA_foo) && CR_KDATA_foo
* CR_IMPORT_KDATA(foo)
* #endif
*
* Or, if you have the address
* _CR_IMPORT_KDATA(foo, 0xabcd0123)
*/
#include "blcr_config.h"
#ifndef EXPORT_SYMBOL_GPL
#define EXPORT_SYMBOL_GPL EXPORT_SYMBOL
#endif
#if defined(__i386__) || defined(__x86_64__)
#ifdef CONFIG_RELOCATABLE
#ifndef CR_EXPORTED_KCODE___register_chrdev
#define _CR_RELOC_KSYM(_addr) (_addr - CR_EXPORTED_KCODE_register_chrdev + register_chrdev)
#else
#define _CR_RELOC_KSYM(_addr) (_addr - CR_EXPORTED_KCODE___register_chrdev + __register_chrdev)
#endif
#else
#define _CR_RELOC_KSYM(_addr) _addr
#endif
#define _CR_IMPORT_KSYM1(_name, _addr, _type) \
__asm__ (".weak " #_name "\n\t" \
".type " #_name "," #_type "\n\t" \
".equ " #_name "," #_addr "\n\t");
#define _CR_IMPORT_KSYM(_name, _addr, _type) _CR_IMPORT_KSYM1(_name, _addr, _type) EXPORT_SYMBOL_GPL(_name);
#define _CR_IMPORT_KDATA(_name,_addr) _CR_IMPORT_KSYM(_name, _CR_RELOC_KSYM(_addr), @object)
#define _CR_IMPORT_KCODE(_name,_addr) _CR_IMPORT_KSYM(_name, _CR_RELOC_KSYM(_addr), @function)
#elif defined(__powerpc__) && (BITS_PER_LONG == 64)
#define _CR_IMPORT_KSYM1(_name, _addr, _type) \
__asm__ (".weak " #_name "\n\t" \
".type " #_name "," #_type "\n\t" \
".equ " #_name "," #_addr "\n\t");
#define _CR_IMPORT_KSYM(_name, _addr, _type) _CR_IMPORT_KSYM1(_name, _addr, _type) EXPORT_SYMBOL_GPL(_name);
#define _CR_IMPORT_KDATA(_name,_addr) _CR_IMPORT_KSYM(_name, _addr, @object)
#define _CR_IMPORT_KCODE(_name,_addr) _CR_IMPORT_KSYM(_name, _addr, @object)
#elif defined(__powerpc__) && (BITS_PER_LONG == 32)
#define _CR_IMPORT_KSYM1(_name, _addr, _type) \
__asm__ (".weak " #_name "\n\t" \
".type " #_name "," #_type "\n\t" \
".equ " #_name "," #_addr "\n\t");
#define _CR_IMPORT_KSYM(_name, _addr, _type) _CR_IMPORT_KSYM1(_name, _addr, _type) EXPORT_SYMBOL_GPL(_name);
#define _CR_IMPORT_KDATA(_name,_addr) _CR_IMPORT_KSYM(_name, _addr, @object)
#define _CR_IMPORT_KCODE(_name,_addr) _CR_IMPORT_KSYM(_name, _addr, @function)
#elif defined(__arm__)
#define _CR_IMPORT_KSYM1(_name, _addr, _type) \
__asm__ (".weak " #_name "\n\t" \
".type " #_name "," #_type "\n\t" \
".equ " #_name "," #_addr "\n\t");
#define _CR_IMPORT_KSYM(_name, _addr, _type) _CR_IMPORT_KSYM1(_name, _addr, _type) EXPORT_SYMBOL_GPL(_name);
#define _CR_IMPORT_KDATA(_name,_addr) _CR_IMPORT_KSYM(_name, _addr, %object)
#define _CR_IMPORT_KCODE(_name,_addr) _CR_IMPORT_KSYM(_name, _addr, %function)
#elif defined(__sparc__)
#define _CR_IMPORT_KSYM1(_name, _addr, _type) \
__asm__ (".weak " #_name "\n\t" \
".type " #_name "," #_type "\n\t" \
".equ " #_name "," #_addr "\n\t");
#define _CR_IMPORT_KSYM(_name, _addr, _type) _CR_IMPORT_KSYM1(_name, _addr, _type) EXPORT_SYMBOL_GPL(_name);
#define _CR_IMPORT_KDATA(_name,_addr) _CR_IMPORT_KSYM(_name, _addr, @object)
#define _CR_IMPORT_KCODE(_name,_addr) _CR_IMPORT_KSYM(_name, _addr, @function)
#else
#error "Add your architecture to blcr_ksyms.h"
#endif
#define CR_IMPORT_KDATA(_name) _CR_IMPORT_KDATA(_name, CR_KDATA_##_name)
#define CR_IMPORT_KCODE(_name) _CR_IMPORT_KCODE(_name, CR_KCODE_##_name)
#endif
|