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

Commit 43d30939 authored by Ralf Baechle's avatar Ralf Baechle
Browse files

MIPS: BMIPS: Fix compilation for BMIPS5000



Commit 02b849f7 ("MIPS: Get rid of the
use of .macro in C code.") replaced the macro usage but missed
the accessors in bmips.h, causing the following build error:

  CC      arch/mips/kernel/smp-bmips.o
{standard input}: Assembler messages:
{standard input}:951: Error: Unrecognized opcode `_ssnop'
{standard input}:952: Error: Unrecognized opcode `_ssnop'
(...)
make[6]: *** [arch/mips/kernel/smp-bmips.o] Error 1

Fix by rewriting the inline assembler using existing inline functions.
The generated code should stay unchanged.

Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
Patchwork: https://patchwork.linux-mips.org/patch/5644/


Reviewed-by: default avatarJonas Gorski <jogo@openwrt.org>
parent 7848ea79
Loading
Loading
Loading
Loading
+22 −33
Original line number Original line Diff line number Diff line
@@ -65,44 +65,33 @@ static inline unsigned long bmips_read_zscm_reg(unsigned int offset)
{
{
	unsigned long ret;
	unsigned long ret;


	__asm__ __volatile__(
	barrier();
		".set push\n"
	cache_op(Index_Load_Tag_S, ZSCM_REG_BASE + offset);
		".set noreorder\n"
	__sync();
		"cache %1, 0(%2)\n"
	_ssnop();
		"sync\n"
	_ssnop();
		"_ssnop\n"
	_ssnop();
		"_ssnop\n"
	_ssnop();
		"_ssnop\n"
	_ssnop();
		"_ssnop\n"
	_ssnop();
		"_ssnop\n"
	_ssnop();
		"_ssnop\n"
	ret = read_c0_ddatalo();
		"_ssnop\n"
	_ssnop();
		"mfc0 %0, $28, 3\n"

		"_ssnop\n"
		".set pop\n"
		: "=&r" (ret)
		: "i" (Index_Load_Tag_S), "r" (ZSCM_REG_BASE + offset)
		: "memory");
	return ret;
	return ret;
}
}


static inline void bmips_write_zscm_reg(unsigned int offset, unsigned long data)
static inline void bmips_write_zscm_reg(unsigned int offset, unsigned long data)
{
{
	__asm__ __volatile__(
	write_c0_ddatalo(data);
		".set push\n"
	_ssnop();
		".set noreorder\n"
	_ssnop();
		"mtc0 %0, $28, 3\n"
	_ssnop();
		"_ssnop\n"
	cache_op(Index_Store_Tag_S, ZSCM_REG_BASE + offset);
		"_ssnop\n"
	_ssnop();
		"_ssnop\n"
	_ssnop();
		"cache %1, 0(%2)\n"
	_ssnop();
		"_ssnop\n"
	barrier();
		"_ssnop\n"
		"_ssnop\n"
		: /* no outputs */
		: "r" (data),
		  "i" (Index_Store_Tag_S), "r" (ZSCM_REG_BASE + offset)
		: "memory");
}
}


#endif /* !defined(__ASSEMBLY__) */
#endif /* !defined(__ASSEMBLY__) */