Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d0a69d9f authored by Mark Rutland's avatar Mark Rutland Committed by Will Deacon
Browse files

arm64: dcc: simplify accessors



A while back we added {read,write}_sysreg accessors to handle accesses
to system registers, without the usual boilerplate asm volatile,
temporary variable, etc.

This patch makes use of these in the arm64 DCC accessors to make the
code shorter and clearer.

Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent cd5f22d7
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -21,21 +21,16 @@
#define __ASM_DCC_H

#include <asm/barrier.h>
#include <asm/sysreg.h>

static inline u32 __dcc_getstatus(void)
{
	u32 ret;

	asm volatile("mrs %0, mdccsr_el0" : "=r" (ret));

	return ret;
	return read_sysreg(mdccsr_el0);
}

static inline char __dcc_getchar(void)
{
	char c;

	asm volatile("mrs %0, dbgdtrrx_el0" : "=r" (c));
	char c = read_sysreg(dbgdtrrx_el0);
	isb();

	return c;
@@ -47,8 +42,7 @@ static inline void __dcc_putchar(char c)
	 * The typecast is to make absolutely certain that 'c' is
	 * zero-extended.
	 */
	asm volatile("msr dbgdtrtx_el0, %0"
			: : "r" ((unsigned long)(unsigned char)c));
	write_sysreg((unsigned char)c, dbgdtrtx_el0);
	isb();
}