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 file is released under the GPLv2.
10 * See the file COPYING for more details.
15 #include <asm/immediate.h>
18 * imv_set - set immediate variable (with locking)
19 * @name: immediate value name
22 * Sets the value of @name, taking the module_mutex if required by
25 #define imv_set(name, i) \
29 module_imv_update(); \
33 * Internal update functions.
35 extern void core_imv_update(void);
36 extern void imv_update_range(const struct __imv
*begin
,
37 const struct __imv
*end
);
38 extern void imv_unref_core_init(void);
39 extern void imv_unref(struct __imv
*begin
, struct __imv
*end
, void *start
,
45 * Generic immediate values: a simple, standard, memory load.
49 * imv_read - read immediate variable
50 * @name: immediate value name
52 * Reads the value of @name.
54 #define imv_read(name) _imv_read(name)
57 * imv_set - set immediate variable (with locking)
58 * @name: immediate value name
61 * Sets the value of @name, taking the module_mutex if required by
64 #define imv_set(name, i) (name##__imv = (i))
66 static inline void core_imv_update(void) { }
67 static inline void imv_unref_core_init(void) { }
71 #define DECLARE_IMV(type, name) extern __typeof__(type) name##__imv
72 #define DEFINE_IMV(type, name) __typeof__(type) name##__imv
74 #define EXPORT_IMV_SYMBOL(name) EXPORT_SYMBOL(name##__imv)
75 #define EXPORT_IMV_SYMBOL_GPL(name) EXPORT_SYMBOL_GPL(name##__imv)
78 * _imv_read - Read immediate value with standard memory load.
79 * @name: immediate value name
81 * Force a data read of the immediate value instead of the immediate value
82 * based mechanism. Useful for __init and __exit section data read.
84 #define _imv_read(name) (name##__imv)
This page took 0.031244 seconds and 4 git commands to generate.