mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-31 06:28:22 +00:00
cpu: change _cpu()->thread calls to current_thread() to fix smp race
This commit is contained in:
@@ -324,7 +324,7 @@ static void enqueueandwait(queuepair_t *queuepair, entrypair_t *entries) {
|
||||
|
||||
*queuepair->submission.doorbell = queuepair->submission.index;
|
||||
sched_preparesleep(false);
|
||||
entries->thread = _cpu()->thread;
|
||||
entries->thread = current_thread();
|
||||
spinlock_release(&queuepair->lock);
|
||||
sched_yield();
|
||||
interrupt_set(intstatus);
|
||||
|
||||
@@ -88,7 +88,7 @@ static void vioblk_enqueue(vioblkdev_t *blkdev, requestheader_t *headerphys, voi
|
||||
VIO_QUEUE_DRV_RING(&blkdev->queue)[driveridx % blkdev->queue.size] = idx;
|
||||
|
||||
sched_preparesleep(false);
|
||||
blkdev->queuewaiting[idx / 3] = _cpu()->thread;
|
||||
blkdev->queuewaiting[idx / 3] = current_thread();
|
||||
|
||||
++VIO_QUEUE_DRV_IDX(&blkdev->queue);
|
||||
*blkdev->queue.notify = 0;
|
||||
|
||||
Reference in New Issue
Block a user