Commit a65a4d7e authored by Thomas Richter's avatar Thomas Richter Committed by Heiko Carstens
Browse files

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: default avatarThomas Richter <tmricht@linux.ibm.com>
Reviewed-by: default avatarJan Polensky <japo@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent 6fe66b21
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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)
{