Based on 1 normalized pattern(s): licensed under gplv2 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 99 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Steve Winslow <swinslow@gmail.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190528170027.163048684@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
41 lines
673 B
C
41 lines
673 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Copyright 2014, Michael Ellerman, IBM Corp.
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#include "ebb.h"
|
|
|
|
|
|
/*
|
|
* Test basic access to the EBB regs, they should be user accessible with no
|
|
* kernel interaction required.
|
|
*/
|
|
int reg_access(void)
|
|
{
|
|
uint64_t val, expected;
|
|
|
|
SKIP_IF(!ebb_is_supported());
|
|
|
|
expected = 0x8000000100000000ull;
|
|
mtspr(SPRN_BESCR, expected);
|
|
val = mfspr(SPRN_BESCR);
|
|
|
|
FAIL_IF(val != expected);
|
|
|
|
expected = 0x0000000001000000ull;
|
|
mtspr(SPRN_EBBHR, expected);
|
|
val = mfspr(SPRN_EBBHR);
|
|
|
|
FAIL_IF(val != expected);
|
|
|
|
return 0;
|
|
}
|
|
|
|
int main(void)
|
|
{
|
|
return test_harness(reg_access, "reg_access");
|
|
}
|