mirror of
https://github.com/torvalds/linux.git
synced 2026-04-20 15:53:59 -04:00
Adds two tests. One is a simple test to ensure that the new registers LMRR and LMSER are properly maintained. The other actually uses the existing EBB test infrastructure to test that LMRR and LMSER behave as documented. Signed-off-by: Jack Miller <jack@codezen.org> Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
38 lines
564 B
C
38 lines
564 B
C
/*
|
|
* Copyright 2016, Jack Miller, IBM Corp.
|
|
* Licensed under GPLv2.
|
|
*/
|
|
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
|
|
#include "ebb.h"
|
|
#include "ebb_lmr.h"
|
|
|
|
#define CHECKS 10000
|
|
|
|
int ebb_lmr_regs(void)
|
|
{
|
|
int i;
|
|
|
|
SKIP_IF(!lmr_is_supported());
|
|
|
|
ebb_global_enable();
|
|
|
|
for (i = 0; i < CHECKS; i++) {
|
|
mtspr(SPRN_LMRR, i << 25); // skip size and rsvd bits
|
|
mtspr(SPRN_LMSER, i);
|
|
|
|
FAIL_IF(mfspr(SPRN_LMRR) != (i << 25));
|
|
FAIL_IF(mfspr(SPRN_LMSER) != i);
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
int main(void)
|
|
{
|
|
return test_harness(ebb_lmr_regs, "ebb_lmr_regs");
|
|
}
|