[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RISU PATCH v4 12/29] Simplify syncing with master
From: |
Richard Henderson |
Subject: |
[RISU PATCH v4 12/29] Simplify syncing with master |
Date: |
Fri, 8 Jul 2022 21:16:43 +0530 |
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.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
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.34.1
- [RISU PATCH v4 01/29] Use bool for tracing variables, (continued)
- [RISU PATCH v4 01/29] Use bool for tracing variables, Richard Henderson, 2022/07/08
- [RISU PATCH v4 02/29] Unify master_fd and apprentice_fd to comm_fd, Richard Henderson, 2022/07/08
- [RISU PATCH v4 03/29] Hoist trace file and socket opening, Richard Henderson, 2022/07/08
- [RISU PATCH v4 04/29] Adjust tracefile open for write, Richard Henderson, 2022/07/08
- [RISU PATCH v4 05/29] Use EXIT_FAILURE, EXIT_SUCCESS, Richard Henderson, 2022/07/08
- [RISU PATCH v4 06/29] Make some risu.c symbols static, Richard Henderson, 2022/07/08
- [RISU PATCH v4 07/29] Add enum RisuOp, Richard Henderson, 2022/07/08
- [RISU PATCH v4 08/29] Add enum RisuResult, Richard Henderson, 2022/07/08
- [RISU PATCH v4 09/29] Unify i/o functions and use RisuResult, Richard Henderson, 2022/07/08
- [RISU PATCH v4 10/29] Pass non-OK result back through siglongjmp, Richard Henderson, 2022/07/08
- [RISU PATCH v4 12/29] Simplify syncing with master,
Richard Henderson <=
- [RISU PATCH v4 13/29] Split RES_MISMATCH for registers and memory, Richard Henderson, 2022/07/08
- [RISU PATCH v4 11/29] Always write for --master, Richard Henderson, 2022/07/08
- [RISU PATCH v4 14/29] Merge reginfo.c into risu.c, Richard Henderson, 2022/07/08
- [RISU PATCH v4 15/29] Rearrange reginfo and memblock buffers, Richard Henderson, 2022/07/08
- [RISU PATCH v4 16/29] Split out recv_register_info, Richard Henderson, 2022/07/08
- [RISU PATCH v4 19/29] aarch64: Assume system support for SVE, Richard Henderson, 2022/07/08