bugfix: exec执行的文件不存在时,自动退出进程。

This commit is contained in:
fslongjin
2022-06-09 21:56:32 +08:00
parent f37a090989
commit 2a47569473
16 changed files with 100 additions and 103 deletions

View File

@ -38,7 +38,6 @@ void spin_init(spinlock_t *lock)
*/
void spin_lock(spinlock_t *lock)
{
preempt_disable();
__asm__ __volatile__("1: \n\t"
"lock decq %0 \n\t" // 尝试-1
"jns 3f \n\t" // 加锁成功跳转到步骤3
@ -49,13 +48,14 @@ void spin_lock(spinlock_t *lock)
"jmp 1b \n\t" // 尝试加锁
"3:"
: "=m"(lock->lock)::"memory");
preempt_disable();
}
void spin_unlock(spinlock_t *lock)
{
preempt_enable();
__asm__ __volatile__("movq $1, %0 \n\t"
: "=m"(lock->lock)::"memory");
preempt_enable();
}
/**