// 提出请求的任务用这个字段互斥地添加请求到request_queue
// 同时也和disk任务互斥
- semaphore_t request_mutex;
+ mutex_t request_mutex;
// 请求队列
disk_request_queue_t request_queue;
// 只会唤醒进程,但不会立即重新调度进程
void up(semaphore_t *s);
+typedef semaphore_t mutex_t;
+
#define DECLARE_MUTEX(name) semaphore_t name = SEMAPHORE_INITIALIZER(name, 1)
#define INIT_MUTEX(ptr) \
(ptr)->cnt = 1; \
INIT_LIST_HEAD(&((ptr)->wait_list)); \
} while (0)
-void mutex_lock(semaphore_t *);
-void mutex_unlock(semaphore_t *);
+void mutex_lock(mutex_t *);
+void mutex_unlock(mutex_t *);
"sysexit_return_address:"
: "=a"(__sysc_ret__)
: "a"(SYSC_WAIT), "c"(ring3_entry));
+
+ for (int i = 100000000; i > 0; i--) {
+ for (int j = 1; j > 0; j--) {
+ asm("nop;nop;nop;");
+ }
+ }
}
}