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

Commit 0735ac1f authored by Herbert Xu's avatar Herbert Xu
Browse files

hwrng: via_rng - Fix asm constraints



The inline asm to invoke xstore did not specify the constraints
correctly.  In particular, dx/di should have been marked as output
registers as well as input as they're modified by xstore.

Thanks to Mario Holbe for creating this patch and testing it.

Tested-by: default avatarMario 'BitKoenig' Holbe <Mario.Holbe@TU-Ilmenau.DE>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent dffa1844
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -81,8 +81,7 @@ static inline u32 xstore(u32 *addr, u32 edx_in)
	ts_state = irq_ts_save();

	asm(".byte 0x0F,0xA7,0xC0 /* xstore %%edi (addr=%0) */"
		:"=m"(*addr), "=a"(eax_out)
		:"D"(addr), "d"(edx_in));
		: "=m" (*addr), "=a" (eax_out), "+d" (edx_in), "+D" (addr));

	irq_ts_restore(ts_state);
	return eax_out;