diff options
author | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2021-01-06 17:19:24 +0000 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2021-01-21 14:05:15 +0000 |
commit | 058308066c9ee3d08361a61cc36835abfe5ecfb6 (patch) | |
tree | d28a0d32d025f750f213b023cc3078d2aeb8a258 /elf/dl-tunables.h | |
parent | ff6d62e9edb5dce537a6dd4a237d6053f331f09c (diff) | |
download | glibc-058308066c9ee3d08361a61cc36835abfe5ecfb6.tar.gz glibc-058308066c9ee3d08361a61cc36835abfe5ecfb6.tar.xz glibc-058308066c9ee3d08361a61cc36835abfe5ecfb6.zip |
elf: Make the tunable struct definition internal only
The representation of the tunables including type information and the tunable list structure are only used in the implementation not in the tunables api that is exposed to usage within glibc. This patch moves the representation related definitions into the existing dl-tunable-types.h and uses that only for implementation. The tunable callback and related types are moved to dl-tunables.h because they are part of the tunables api. This reduces the details exposed in the tunables api so the internals are easier to change. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'elf/dl-tunables.h')
-rw-r--r-- | elf/dl-tunables.h | 35 |
1 files changed, 8 insertions, 27 deletions
diff --git a/elf/dl-tunables.h b/elf/dl-tunables.h index dfa16c1977..971376ba8d 100644 --- a/elf/dl-tunables.h +++ b/elf/dl-tunables.h @@ -21,8 +21,6 @@ #ifndef _TUNABLES_H_ #define _TUNABLES_H_ -#include <stdbool.h> - #if !HAVE_TUNABLES static inline void __always_inline @@ -31,34 +29,17 @@ __tunables_init (char **unused __attribute__ ((unused))) /* This is optimized out if tunables are not enabled. */ } #else - +# include <stdbool.h> # include <stddef.h> -# include "dl-tunable-types.h" +# include <stdint.h> -/* A tunable. */ -struct _tunable +typedef union { - const char *name; /* Internal name of the tunable. */ - tunable_type_t type; /* Data type of the tunable. */ - tunable_val_t val; /* The value. */ - bool initialized; /* Flag to indicate that the tunable is - initialized. */ - tunable_seclevel_t security_level; /* Specify the security level for the - tunable with respect to AT_SECURE - programs. See description of - tunable_seclevel_t to see a - description of the values. - - Note that even if the tunable is - read, it may not get used by the - target module if the value is - considered unsafe. */ - /* Compatibility elements. */ - const char *env_alias; /* The compatibility environment - variable name. */ -}; - -typedef struct _tunable tunable_t; + int64_t numval; + const char *strval; +} tunable_val_t; + +typedef void (*tunable_callback_t) (tunable_val_t *); /* Full name for a tunable is top_ns.tunable_ns.id. */ # define TUNABLE_NAME_S(top,ns,id) #top "." #ns "." #id |