mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 08:33:17 +02:00
s390/pai_crypto: Add common pai_add() function
To support one common PAI PMU device driver which handles both PMUs pai_crypto and pai_ext, use a common naming scheme for structures and variables suitable for both device drivers. Add a common usable function pai_add() for the event on a CPU. Call this common pai_add() from paicrypt_add(). Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> Reviewed-by: Jan Polensky <japo@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
parent
6fe66b2157
commit
a65a4d7e80
|
|
@ -411,10 +411,11 @@ static void paicrypt_start(struct perf_event *event, int flags)
|
|||
pai_start(event, flags, paicrypt_getall);
|
||||
}
|
||||
|
||||
static int paicrypt_add(struct perf_event *event, int flags)
|
||||
static int pai_add(struct perf_event *event, int flags)
|
||||
{
|
||||
struct pai_mapptr *mp = this_cpu_ptr(pai_root.mapptr);
|
||||
struct pai_map *cpump = mp->mapptr;
|
||||
int idx = PAI_PMU_IDX(event);
|
||||
unsigned long ccd;
|
||||
|
||||
if (++cpump->active_events == 1) {
|
||||
|
|
@ -423,11 +424,16 @@ static int paicrypt_add(struct perf_event *event, int flags)
|
|||
local_ctl_set_bit(0, CR0_CRYPTOGRAPHY_COUNTER_BIT);
|
||||
}
|
||||
if (flags & PERF_EF_START)
|
||||
paicrypt_start(event, PERF_EF_RELOAD);
|
||||
pai_pmu[idx].pmu->start(event, PERF_EF_RELOAD);
|
||||
event->hw.state = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int paicrypt_add(struct perf_event *event, int flags)
|
||||
{
|
||||
return pai_add(event, flags);
|
||||
}
|
||||
|
||||
static void pai_have_sample(struct perf_event *, struct pai_map *);
|
||||
static void paicrypt_stop(struct perf_event *event, int flags)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user