This instance will be upgraded to Heptapod 0.27.1 on 2021-12-02 at 15:00 UTC+1 (a few minutes of down time)

Commit 4a8058b5 authored by alex@thinkpad's avatar alex@thinkpad
Browse files

QEMU logging: updated DryOS and VxWorks task switch handling

It was quite hard to pass the test suite, as there were lots of edge cases:

- context switch may happen either in a timer interrupt, or in a regular task (e.g. msleep, sempahores and so on)
- context switch is not atomic - it happens a few instructions (or function calls!) afterh updating the current task pointer
- until the registers are swapped for the new task, we are still on the stack of the previous task
- there may be dummy task switches (i.e. from one task to the same task)
- an interrupt can occur in the middle of a (non-atomic) context switch (!)
- VxWorks models do not even use a unique task ID (!)

Result: QEMU no longer crashes during logging tests!

Issue: these cameras do not appear to use an unique task ID. Workaround: assign our own task IDs.

--HG--
branch : qemu
parent 2db600ab6a08
This diff is collapsed.
......@@ -1721,6 +1721,30 @@ uint8_t eos_get_current_task_id(EOSState *s)
uint32_t current_task_ptr = eos_get_mem_w(s, s->model->current_task_addr);
if (current_task_ptr > 0x1000 && current_task_ptr < 0x1000000)
{
if (s->model->digic_version < 4)
{
/* VxWorks doesn't seem to use unique task IDs; why?! */
/* workaround: assume unique current_task_ptr, and assign our own ID */
static uint32_t current_tasks[0xFE]; /* two special IDs, don't use them */
for (int i = 0; i < 0xFE; i++)
{
if (current_tasks[i] == current_task_ptr)
{
/* found! */
return i;
}
if (current_tasks[i] == 0)
{
current_tasks[i] = current_task_ptr;
return i;
}
}
/* let's hope we are not going to require so many unique tasks */
assert(0);
}
uint32_t current_task = eos_get_mem_w(s, current_task_ptr + 0x40);
return current_task & 0xFF;
}
......
672b79aeefee2f5765abb04accfaa6e6 calls-main.log
8a8a4744ceae10b9f0f3881af0a6aaf2 calls-main.log
a18b3f010834cc38d889741c2dce8609 calls-main.idc
93d425d6fedc73c798aca8fc56ff8793 calls-main-basic.log
fb54e2429c77951362ca770bcec8933e calls-main-basic.log
1674a4b389d3029fed46bd80402e15f5 calls-main-basic.idc
44f19702b521c38c9bc529bddcfd44fa calls-main.log
38042e3b3de80afceb8dd111df37cfb2 calls-main.log
ce16a02dd60d16e87692acb188184ac6 calls-main.idc
f0417045cf18d546b3cf5900ee1f2be9 calls-main-basic.log
18f865355911cbe4961b2466247ec124 calls-main-basic.idc
bf112febab4fafc19b4261b5381f40a1 calls-main.log
415280a39ce8b51b3e9c83af31206cfc calls-main.log
c310c66d6684fd7dc319234b5cf5baf1 calls-main.idc
c949287c4f558bd8cf8f35ef629f7fe3 calls-main-basic.log
19d480bfc9051e3af4b6a5d8657f3f40 calls-main-basic.idc
c059c8994ef4ed621b0fa3633568bbe9 calls-main.log
114a8d6083ef50474299bc1e92a58a1d calls-main.log
ecd6d5387f67d9e5217667abfe77ba39 calls-main.idc
15b8f9f8556c2d4d398c0a1f77dc68d4 calls-main-basic.log
d6b9e95190de59db585e9808af5189eb calls-main-basic.idc
de8f5fc347e27226e3a5933683888dd5 calls-main.log
8f26fa0209a6fbcd7c151fd5940480bc calls-main.log
09efd77939ee2593ee25130f1da11fb1 calls-main.idc
57478c9c14217ef8ff17c87ec9474ed7 calls-main-basic.log
4a6ef02a69a39aecae65789c8b7c771f calls-main-basic.idc
c494431de7db60a177c692bd5fa651a5 calls-main.log
386db8272141da25b7218e5e513d0718 calls-main.log
656362cdb566fc62b583985a2f76387d calls-main.idc
26b421a65040a7309e4ac5fe51533e4d calls-main-basic.log
eb2b848b0e8cf83b377448d5cb29ba55 calls-main-basic.log
1feea5839d655ec93ef72e2b02cd9a26 calls-main-basic.idc
8a1a3766aeaddbbabe527b7ef047e6f1 calls-main.log
02a76c44d6800161c1c5217bff4a1c89 calls-main.log
01bee4107685a37aab630f4d8dc75c59 calls-main.idc
8f69d99dca18f9b26253015d8476c0d4 calls-main-basic.log
26ce7e457c4bc6d2c8284bed1357d763 calls-main-basic.log
cac7ddcb65c7920821e07d4c830a4241 calls-main-basic.idc
45d6b78d2150600e339ddb525fd703bb calls-main.log
bb55065fc1f61e423e9b1ae993f4891b calls-main.idc
a0fc1204e7c3f40ed44fd47716233588 calls-main-basic.log
f0e1c5e53bad977ee47e4d2fdf8d7099 calls-main-basic.idc
306e6a42e376e9775fa357a5cd6f4844 calls-main.log
c5d16bfedb294662f3906b4ae7c02be4 calls-main.log
6846d32d354489ff60e3e72f02a76872 calls-main.idc
afc6093d055562b38290f3fd1cc0ec41 calls-main-basic.log
8af51850b1a1e2da2c1543fead830dea calls-main-basic.log
c797d8456ef0615a77f57fee2aa06155 calls-main-basic.idc
45f2113f08c2fa3c896853d168d460b8 calls-main.log
9c8529eb214d19cd9e9bdb46b9ce680c calls-main.log
a54a8661f1867bd88e1d2c1505775796 calls-main.idc
2abe8953b7126ef649eda9bfa32b78dc calls-main-basic.log
ce21a436f2714a712875800b925c4963 calls-main-basic.idc
356e81cb0c6e7bc78973b2f8b7bc1935 calls-main.log
d330758f5c501a350622b7cb8e59dadb calls-main.log
f7ba48c5c532f7f13f827a0ebcc813a0 calls-main.idc
527137077931894c2e6bd087cb5dbddf calls-main-basic.log
f909683ef0653b376ab7b01ca52b4980 calls-main-basic.idc
2454a3893f381278b30d937722bd5020 calls-main.log
b9d8d6e871cbec1b23d0ef7f65f335d2 calls-main.log
0ff92cd01367df5068e7f9338496066f calls-main.idc
52463d80c40a32d2a5d18d96c180159c calls-main-basic.log
47ead2914539b37628dc4cc988e22cbf calls-main-basic.idc
41b2a50c6fcaf6ac75bc08a16627ea77 calls-main.log
5618b1da2b495f577f85c75a8c74131b calls-main.log
8c7adf8e93b9d462773c17bc59e93b20 calls-main.idc
95a552ab8217b27f92b25795d3a88685 calls-main-basic.log
826fd1f81cfbc078275602b3d8c852b2 calls-main-basic.log
59367fa00bc567cd67b5b0f0e4434001 calls-main-basic.idc
65ead90f7534dbba58bec09f8e8abc7d calls-main.log
76ad46105369ec8a75c27fc1ebee9969 calls-main.log
ddecdf61a3fdab8688a4b6c98fe7753e calls-main.idc
a3e9a5b9fe39ac9f6e1b1e1bfa5705e7 calls-main-basic.log
85f3e9dccd0eb0322e59a2e956da2c95 calls-main-basic.idc
9d8808b2ffb17f36b4d33d549faa516f calls-main.log
470ffb27aa360e214fadf3b1b88eb277 calls-main.log
8be8b4a740aaec131db362355652ab87 calls-main.idc
3e9b1bf58cbc987068f9e3be0a5f345f calls-main-basic.log
e8c25daaf0f0c69d7158e496a17e78af calls-main-basic.idc
ebb978fd81e651f471e4c48687043cdd calls-main.log
f26a74af5bcdcd07a3fe474f6888b60c calls-main.idc
642e2ad742da7cdb6340b2c8d344b816 calls-main.log
316e615a7bed3788b540fe70ad86c5af calls-main.idc
a96ccf25237a6b2b0b3f9129e1ce2d7b calls-main-basic.log
1aacee8d0b8b83f838a2b35a7f7fd3ad calls-main-basic.idc
198affe8bff957d6afb0409516f3a20f calls-main.log
ea0d2f5063c0aad1e2cd492042c14531 calls-main.log
570e66dbf03a556b32564ec72d053a48 calls-main.idc
1036ea285cb96febb885c365eaa3eb32 calls-main-basic.log
222e6960c42fa888871e00fc27cdd2b7 calls-main-basic.idc
76bf4b14dfbe00e8dfb1c10dbfd446f0 calls-main.log
bce86759656d17b8d657ef55406734c9 calls-main.log
f167da05be089c2f783adb6ceeacd548 calls-main.idc
fcfa8c37435a70c883663729a22a3f4e calls-main-basic.log
8daee3f1079934a0ca7897c2d66b1554 calls-main-basic.idc
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment