Compare commits
No commits in common. "62f6128ba1006c1f606c5973a21b30364326f864" and "9607b4205a6b4beb8f0f7c63fa466020e8d30489" have entirely different histories.
62f6128ba1
...
9607b4205a
Binary file not shown.
|
@ -67,21 +67,25 @@ namespace Kernel
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint64_t start_time = SystemTimer::get().ms_since_boot();
|
const uint64_t start_time = SystemTimer::get().ms_since_boot();
|
||||||
while (!(m_done_mask & cid_mask) && SystemTimer::get().ms_since_boot() < start_time + s_nvme_command_poll_timeout_ms)
|
while (SystemTimer::get().ms_since_boot() < start_time + s_nvme_command_poll_timeout_ms)
|
||||||
continue;
|
{
|
||||||
|
|
||||||
// FIXME: Here is a possible race condition if done mask is set before
|
|
||||||
// scheduler has put the current thread blocking.
|
|
||||||
// EINTR should also be handled here.
|
|
||||||
while (!(m_done_mask & cid_mask) && SystemTimer::get().ms_since_boot() < start_time + s_nvme_command_timeout_ms)
|
|
||||||
Scheduler::get().block_current_thread(&m_semaphore, start_time + s_nvme_command_timeout_ms);
|
|
||||||
|
|
||||||
if (m_done_mask & cid_mask)
|
if (m_done_mask & cid_mask)
|
||||||
{
|
{
|
||||||
uint16_t status = m_status_codes[cid];
|
uint16_t status = m_status_codes[cid];
|
||||||
m_used_mask &= ~cid_mask;
|
m_used_mask &= ~cid_mask;
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while (SystemTimer::get().ms_since_boot() < start_time + s_nvme_command_timeout_ms)
|
||||||
|
{
|
||||||
|
if (m_done_mask & cid_mask)
|
||||||
|
{
|
||||||
|
uint16_t status = m_status_codes[cid];
|
||||||
|
m_used_mask &= ~cid_mask;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_used_mask &= ~cid_mask;
|
m_used_mask &= ~cid_mask;
|
||||||
return 0xFFFF;
|
return 0xFFFF;
|
||||||
|
|
|
@ -27,7 +27,7 @@ int main()
|
||||||
if (signal(SIGINT, [](int) {}) == SIG_ERR)
|
if (signal(SIGINT, [](int) {}) == SIG_ERR)
|
||||||
perror("signal");
|
perror("signal");
|
||||||
|
|
||||||
if (load_keymap("/usr/share/keymaps/us.keymap") == -1)
|
if (load_keymap("/usr/share/keymaps/fi.keymap") == -1)
|
||||||
perror("load_keymap");
|
perror("load_keymap");
|
||||||
|
|
||||||
if (fork() == 0)
|
if (fork() == 0)
|
||||||
|
|
Loading…
Reference in New Issue