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

Commit 60c4ba99 authored by Richard Kuo's avatar Richard Kuo
Browse files

Hexagon: add support for new v4+ registers



Add support for a couple new v4+ registers, along with
newer save/restore pt_regs.

Signed-off-by: default avatarRichard Kuo <rkuo@codeaurora.org>
parent 444dd742
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -57,10 +57,17 @@ struct pt_regs {
	};
	union {
		struct {
			unsigned long gp;
			unsigned long ugp;
			unsigned long gp;
		};
		long long int gpugp;
	};
	union {
		struct {
			unsigned long cs0;
			unsigned long cs1;
		};
		long long int ugpgp;
		long long int cs1cs0;
	};
	/*
	* Be extremely careful with rearranging these, if at all.  Some code
+6 −0
Original line number Diff line number Diff line
@@ -55,9 +55,15 @@ struct user_regs_struct {
	unsigned long pc;
	unsigned long cause;
	unsigned long badva;
#if CONFIG_HEXAGON_ARCH_VERSION < 4
	unsigned long pad1;  /* pad out to 48 words total */
	unsigned long pad2;  /* pad out to 48 words total */
	unsigned long pad3;  /* pad out to 48 words total */
#else
	unsigned long cs0;
	unsigned long cs1;
	unsigned long pad1;  /* pad out to 48 words total */
#endif
};

#endif
+2 −1
Original line number Diff line number Diff line
@@ -44,7 +44,8 @@ int main(void)

	COMMENT("Hexagon pt_regs definitions");
	OFFSET(_PT_SYSCALL_NR, pt_regs, syscall_nr);
	OFFSET(_PT_UGPGP, pt_regs, ugpgp);
	OFFSET(_PT_GPUGP, pt_regs, gpugp);
	OFFSET(_PT_CS1CS0, pt_regs, cs1cs0);
	OFFSET(_PT_R3130, pt_regs, r3130);
	OFFSET(_PT_R2928, pt_regs, r2928);
	OFFSET(_PT_R2726, pt_regs, r2726);
+2 −0
Original line number Diff line number Diff line
@@ -70,6 +70,8 @@ struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM] = {
	{ "lc1", GDB_SIZEOF_REG, offsetof(struct pt_regs, lc1)},
	{ " gp", GDB_SIZEOF_REG, offsetof(struct pt_regs, gp)},
	{ "ugp", GDB_SIZEOF_REG, offsetof(struct pt_regs, ugp)},
	{ "cs0", GDB_SIZEOF_REG, offsetof(struct pt_regs, cs0)},
	{ "cs1", GDB_SIZEOF_REG, offsetof(struct pt_regs, cs1)},
	{ "psp", GDB_SIZEOF_REG, offsetof(struct pt_regs, hvmer.vmpsp)},
	{ "elr", GDB_SIZEOF_REG, offsetof(struct pt_regs, hvmer.vmel)},
	{ "est", GDB_SIZEOF_REG, offsetof(struct pt_regs, hvmer.vmest)},
+9 −0
Original line number Diff line number Diff line
@@ -76,6 +76,10 @@ static int genregs_get(struct task_struct *target,
	dummy = pt_cause(regs);
	ONEXT(&dummy, cause);
	ONEXT(&pt_badva(regs), badva);
#if CONFIG_HEXAGON_ARCH_VERSION >=4
	ONEXT(&regs->cs0, cs0);
	ONEXT(&regs->cs1, cs1);
#endif

	/* Pad the rest with zeros, if needed */
	if (!ret)
@@ -123,6 +127,11 @@ static int genregs_set(struct task_struct *target,
	INEXT(&bucket, cause);
	INEXT(&bucket, badva);

#if CONFIG_HEXAGON_ARCH_VERSION >=4
	INEXT(&regs->cs0, cs0);
	INEXT(&regs->cs1, cs1);
#endif

	/* Ignore the rest, if needed */
	if (!ret)
		ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
Loading