1 #ifndef _LINUX_IMMEDIATE_H
2 #define _LINUX_IMMEDIATE_H
5 * Immediate values, can be updated at runtime and save cache lines.
7 * (C) Copyright 2007 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 #include <asm/immediate.h>
29 * imv_set - set immediate variable (with locking)
30 * @name: immediate value name
33 * Sets the value of @name, taking the module_mutex if required by
36 #define imv_set(name, i) \
40 module_imv_update(); \
44 * Internal update functions.
46 extern void core_imv_update(void);
47 extern void imv_update_range(const struct __imv
*begin
,
48 const struct __imv
*end
);
49 extern void imv_unref_core_init(void);
50 extern void imv_unref(struct __imv
*begin
, struct __imv
*end
, void *start
,
56 * Generic immediate values: a simple, standard, memory load.
60 * imv_read - read immediate variable
61 * @name: immediate value name
63 * Reads the value of @name.
65 #define imv_read(name) _imv_read(name)
68 * imv_set - set immediate variable (with locking)
69 * @name: immediate value name
72 * Sets the value of @name, taking the module_mutex if required by
75 #define imv_set(name, i) (name##__imv = (i))
77 static inline void core_imv_update(void) { }
78 static inline void imv_unref_core_init(void) { }
82 #define DECLARE_IMV(type, name) extern __typeof__(type) name##__imv
83 #define DEFINE_IMV(type, name) __typeof__(type) name##__imv
85 #define EXPORT_IMV_SYMBOL(name) EXPORT_SYMBOL(name##__imv)
86 #define EXPORT_IMV_SYMBOL_GPL(name) EXPORT_SYMBOL_GPL(name##__imv)
89 * _imv_read - Read immediate value with standard memory load.
90 * @name: immediate value name
92 * Force a data read of the immediate value instead of the immediate value
93 * based mechanism. Useful for __init and __exit section data read.
95 #define _imv_read(name) (name##__imv)
This page took 0.032725 seconds and 4 git commands to generate.