mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-28 20:41:52 -06:00
osdep: Create qemu_getauxval and qemu_init_auxval
Abstract away dependence on a system implementation of getauxval. Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
7dc65c02fe
commit
b6a3e690b4
5 changed files with 102 additions and 0 deletions
|
@ -215,4 +215,29 @@ bool fips_get_state(void);
|
|||
*/
|
||||
char *qemu_get_local_state_pathname(const char *relative_pathname);
|
||||
|
||||
/**
|
||||
* qemu_getauxval:
|
||||
* @type: the auxiliary vector key to lookup
|
||||
*
|
||||
* Search the auxiliary vector for @type, returning the value
|
||||
* or 0 if @type is not present.
|
||||
*/
|
||||
#if defined(CONFIG_GETAUXVAL) || defined(__linux__)
|
||||
unsigned long qemu_getauxval(unsigned long type);
|
||||
#else
|
||||
static inline unsigned long qemu_getauxval(unsigned long type) { return 0; }
|
||||
#endif
|
||||
|
||||
/**
|
||||
* qemu_init_auxval:
|
||||
* @envp: the third argument to main
|
||||
*
|
||||
* If supported and required, locate the auxiliary vector at program startup.
|
||||
*/
|
||||
#if defined(CONFIG_GETAUXVAL) || !defined(__linux__)
|
||||
static inline void qemu_init_auxval(char **envp) { }
|
||||
#else
|
||||
void qemu_init_auxval(char **envp);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue