diff mbox series

[3/4] main: Drop special commands for getting/setting few sprs

Message ID 20200723052641.561009-4-amitay@ozlabs.org
State Accepted
Headers show
Series Improve getspr/putspr command | expand

Commit Message

Amitay Isaacs July 23, 2020, 5:26 a.m. UTC
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
---
 src/main.c | 12 ------------
 src/reg.c  | 49 -------------------------------------------------
 2 files changed, 61 deletions(-)
diff mbox series

Patch

diff --git a/src/main.c b/src/main.c
index 032bcd8..0ed6b92 100644
--- a/src/main.c
+++ b/src/main.c
@@ -68,23 +68,19 @@  static int probe(void);
 extern struct optcmd_cmd
 	optcmd_getscom, optcmd_putscom,	optcmd_getcfam, optcmd_putcfam,
 	optcmd_getgpr, optcmd_putgpr, optcmd_getspr, optcmd_putspr,
-	optcmd_getnia, optcmd_putnia, optcmd_getmsr, optcmd_putmsr,
 	optcmd_getring, optcmd_start, optcmd_stop, optcmd_step,
 	optcmd_threadstatus, optcmd_sreset, optcmd_regs, optcmd_probe,
 	optcmd_getmem, optcmd_putmem, optcmd_getmemio, optcmd_putmemio,
 	optcmd_getmempba, optcmd_putmempba,
-	optcmd_getxer, optcmd_putxer, optcmd_getcr, optcmd_putcr,
 	optcmd_gdbserver, optcmd_istep;
 
 static struct optcmd_cmd *cmds[] = {
 	&optcmd_getscom, &optcmd_putscom, &optcmd_getcfam, &optcmd_putcfam,
 	&optcmd_getgpr, &optcmd_putgpr, &optcmd_getspr, &optcmd_putspr,
-	&optcmd_getnia, &optcmd_putnia, &optcmd_getmsr, &optcmd_putmsr,
 	&optcmd_getring, &optcmd_start, &optcmd_stop, &optcmd_step,
 	&optcmd_threadstatus, &optcmd_sreset, &optcmd_regs, &optcmd_probe,
 	&optcmd_getmem, &optcmd_putmem, &optcmd_getmemio, &optcmd_putmemio,
 	&optcmd_getmempba, &optcmd_putmempba,
-	&optcmd_getxer, &optcmd_putxer, &optcmd_getcr, &optcmd_putcr,
 	&optcmd_gdbserver, &optcmd_istep,
 };
 
@@ -99,16 +95,8 @@  struct action {
 static struct action actions[] = {
 	{ "getgpr",  "<gpr>", "Read General Purpose Register (GPR)" },
 	{ "putgpr",  "<gpr> <value>", "Write General Purpose Register (GPR)" },
-	{ "getnia",  "", "Get Next Instruction Address (NIA)" },
-	{ "putnia",  "<value>", "Write Next Instrution Address (NIA)" },
 	{ "getspr",  "<spr>", "Get Special Purpose Register (SPR)" },
 	{ "putspr",  "<spr> <value>", "Write Special Purpose Register (SPR)" },
-	{ "getmsr",  "", "Get Machine State Register (MSR)" },
-	{ "putmsr",  "<value>", "Write Machine State Register (MSR)" },
-	{ "getcr",  "", "Get Condition Register (CR)" },
-	{ "putcr",  "<value>", "Write Condition Register (CR)" },
-	{ "getxer",  "", "Get Fixed Point Exception Register (XER)" },
-	{ "putxer",  "<value>", "Write Fixed Point Exception Register (XER)" },
 	{ "getring", "<addr> <len>", "Read a ring. Length must be correct" },
 	{ "start",   "", "Start thread" },
 	{ "step",    "<count>", "Set a thread <count> instructions" },
diff --git a/src/reg.c b/src/reg.c
index cab8d4d..56f5118 100644
--- a/src/reg.c
+++ b/src/reg.c
@@ -166,18 +166,6 @@  static int putgpr(int gpr, uint64_t data)
 }
 OPTCMD_DEFINE_CMD_WITH_ARGS(putgpr, putgpr, (GPR, DATA));
 
-static int getnia(void)
-{
-	return getreg(REG_NIA);
-}
-OPTCMD_DEFINE_CMD(getnia, getnia);
-
-static int putnia(uint64_t nia)
-{
-	return putreg(REG_NIA, &nia);
-}
-OPTCMD_DEFINE_CMD_WITH_ARGS(putnia, putnia, (DATA));
-
 static int getspr(int spr)
 {
 	return getreg(spr + REG_R31);
@@ -189,40 +177,3 @@  static int putspr(int spr, uint64_t data)
 	return putreg(spr + REG_R31, &data);
 }
 OPTCMD_DEFINE_CMD_WITH_ARGS(putspr, putspr, (SPR, DATA));
-
-static int getmsr(void)
-{
-	return getreg(REG_MSR);
-}
-OPTCMD_DEFINE_CMD(getmsr, getmsr);
-
-static int putmsr(uint64_t data)
-{
-	return putreg(REG_MSR, &data);
-}
-OPTCMD_DEFINE_CMD_WITH_ARGS(putmsr, putmsr, (DATA));
-
-static int getxer(void)
-{
-	return getreg(REG_XER);
-}
-OPTCMD_DEFINE_CMD(getxer, getxer);
-
-static int putxer(uint64_t data)
-{
-	return putreg(REG_XER, &data);
-}
-OPTCMD_DEFINE_CMD_WITH_ARGS(putxer, putxer, (DATA));
-
-static int getcr(void)
-{
-	return getreg(REG_CR);
-}
-OPTCMD_DEFINE_CMD(getcr, getcr);
-
-static int putcr(uint32_t data)
-{
-	uint64_t u64 = data;
-	return putreg(REG_CR, &u64);
-}
-OPTCMD_DEFINE_CMD_WITH_ARGS(putcr, putcr, (DATA32));