diff options
author | Kazunori Asayama <asayama@sm.sony.co.jp> | 2009-02-17 18:20:45 -0800 |
---|---|---|
committer | Yuji Mano <yuji.mano@am.sony.com> | 2009-02-17 18:20:45 -0800 |
commit | 149070f7971cfecc02d869e895c7369d83ae541b (patch) | |
tree | 52afe200a780835e31cf243d0d47803bfe5d48f5 | |
parent | 267d7be97d54d25472b9e55b64eff699f32b2421 (diff) | |
download | mars-src-149070f7971cfecc02d869e895c7369d83ae541b.tar.gz |
base: Retry to read mbox on error
This patch modifies handler thread to retry access to mailboxes on
error so that handler thread doesn't fail with debugger.
Signed-off-by: Kazunori Asayama <asayama@sm.sony.co.jp>
Signed-off-by: Yuji Mano <yuji.mano@am.sony.com>
-rw-r--r-- | base/src/host/lib/mpu_cell.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/base/src/host/lib/mpu_cell.c b/base/src/host/lib/mpu_cell.c index 2580726..66d8905 100644 --- a/base/src/host/lib/mpu_cell.c +++ b/base/src/host/lib/mpu_cell.c @@ -115,12 +115,16 @@ static void *mpu_handler_thread(void *arg) ret = spe_out_intr_mbox_read(spe, &ea_l, 1, SPE_MBOX_ANY_BLOCKING); - if (ret < 1) - goto error; - - ret = spe_out_mbox_read(spe, &ea_h, 1); - if (ret != 1) + if (ret == 0) goto error; + else if (ret == -1) + continue; + + do { + ret = spe_out_mbox_read(spe, &ea_h, 1); + if (ret == -1 && errno != EINTR) + goto error; + } while (ret != 1); ea = ((uint64_t)ea_h << 32) | ea_l; if (ea == MARS_HOST_SIGNAL_EXIT) |