[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RISU v2 12/17] Simplify syncing with master
From: |
Richard Henderson |
Subject: |
[RISU v2 12/17] Simplify syncing with master |
Date: |
Mon, 18 May 2020 19:53:50 -0700 |
Do not pass status like RES_BAD_IO from apprentice to master.
This means that when master reports i/o error that we know it
came from master; the apprentice will report its own i/o error.
Signed-off-by: Richard Henderson <address@hidden>
---
reginfo.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/reginfo.c b/reginfo.c
index c37c5df..31bc699 100644
--- a/reginfo.c
+++ b/reginfo.c
@@ -90,10 +90,9 @@ RisuResult recv_and_compare_register_info(void *uc)
}
if (header.risu_op != op) {
- /* We are out of sync */
- res = RES_BAD_IO;
- respond(res);
- return res;
+ /* We are out of sync. Tell master to exit. */
+ respond(RES_END);
+ return RES_BAD_IO;
}
/* send OK for the header */
@@ -115,7 +114,7 @@ RisuResult recv_and_compare_register_info(void *uc)
} else if (op == OP_TESTEND) {
res = RES_END;
}
- respond(res);
+ respond(res == RES_OK ? RES_OK : RES_END);
break;
case OP_SETMEMBLOCK:
memblock = (void *)(uintptr_t)get_reginfo_paramreg(&apprentice_ri);
@@ -133,7 +132,7 @@ RisuResult recv_and_compare_register_info(void *uc)
/* memory mismatch */
res = RES_MISMATCH;
}
- respond(res);
+ respond(res == RES_OK ? RES_OK : RES_END);
break;
default:
abort();
--
2.20.1
- [RISU v2 07/17] Add enum RisuOp, (continued)
- [RISU v2 07/17] Add enum RisuOp, Richard Henderson, 2020/05/18
- [RISU v2 08/17] Add enum RisuResult, Richard Henderson, 2020/05/18
- [RISU v2 09/17] Unify i/o functions and use RisuResult, Richard Henderson, 2020/05/18
- [RISU v2 11/17] Always write for --master, Richard Henderson, 2020/05/18
- [RISU v2 10/17] Pass non-OK result back through siglongjmp, Richard Henderson, 2020/05/18
- [RISU v2 12/17] Simplify syncing with master,
Richard Henderson <=
- [RISU v2 13/17] Split RES_MISMATCH for registers and memory, Richard Henderson, 2020/05/18
- [RISU v2 14/17] Add magic and size to the trace header, Richard Henderson, 2020/05/18
- [RISU v2 15/17] Compute reginfo_size based on the reginfo, Richard Henderson, 2020/05/18
- [RISU v2 16/17] aarch64: Reorg sve reginfo to save space, Richard Henderson, 2020/05/18