Re: [PATCH 03/16] riscv: kgdb: Use generated instruction headers

Nam Cao <[email protected]>
Newsgroups org.infradead.lists.kvm-riscv,org.infradead.lists.linux-riscv,org.kernel.vger.kvm,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest
Message-ID <[email protected]>
Charlie Jenkins via B4 Relay
<[email protected]> writes:
> +#define riscv_insn_branch(_insn, regs_ptr, _opcode, _pc, _comparison, type)     \
> +	({                                                                      \
> +		unsigned long _ret;                                             \
> +		if ((type)riscv_insn_reg_get_val(                               \
> +			    regs_ptr,                                           \
> +			    riscv_insn_##_insn##_extract_xs1(_opcode))          \
> +			    _comparison(type) riscv_insn_reg_get_val(           \
> +				    regs_ptr,                                   \
> +				    riscv_insn_##_insn##_extract_xs2(_opcode))) \
> +			_ret = riscv_insn_##_insn##_extract_imm(_opcode);       \

Should be
		_ret = _pc + riscv_insn_##_insn##_extract_imm(_opcode);

> +		else                                                            \
> +			_ret = _pc + 4;                                         \
> +		_ret;                                                           \
> +	})
> +

-- 
kvm-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kvm-riscv
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.