mirror of
https://github.com/torvalds/linux.git
synced 2026-12-05 04:44:03 +00:00
Making perf_reg_value function global (formely reg_value), because it's going to be used globaly across all code providing the dwarf post unwind feature. Changing its prototype to be generic: -int reg_value(unw_word_t *valp, struct regs_dump *regs, int id) +int perf_reg_value(u64 *valp, struct regs_dump *regs, int id); Changing the valp type from libunwind specific 'unw_word_t' to u64. Signed-off-by: Jiri Olsa <[email protected]> Acked-by: Jean Pihet <[email protected]> Cc: Corey Ashford <[email protected]> Cc: David Ahern <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jean Pihet <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
20 lines
298 B
C
20 lines
298 B
C
#include <errno.h>
|
|
#include "perf_regs.h"
|
|
|
|
int perf_reg_value(u64 *valp, struct regs_dump *regs, int id)
|
|
{
|
|
int i, idx = 0;
|
|
u64 mask = regs->mask;
|
|
|
|
if (!(mask & (1 << id)))
|
|
return -EINVAL;
|
|
|
|
for (i = 0; i < id; i++) {
|
|
if (mask & (1 << i))
|
|
idx++;
|
|
}
|
|
|
|
*valp = regs->regs[idx];
|
|
return 0;
|
|
}
|