mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 21:57:34 +00:00
Make VFS test environment build again.
This commit is contained in:
parent
83172e6a4b
commit
981a3ae4b3
12 changed files with 40 additions and 34 deletions
|
@ -7,6 +7,7 @@
|
|||
#include "IO.h"
|
||||
#include "i386.h"
|
||||
#include "PIC.h"
|
||||
#include <AK/Lock.h>
|
||||
|
||||
//#define DISK_DEBUG
|
||||
|
||||
|
@ -55,7 +56,7 @@ static bool waitForInterrupt()
|
|||
#endif
|
||||
// FIXME: Add timeout.
|
||||
while (!interrupted) {
|
||||
yield();
|
||||
sched_yield();
|
||||
}
|
||||
#ifdef DISK_DEBUG
|
||||
kprintf("disk: got interrupt!\n");
|
||||
|
|
|
@ -388,7 +388,7 @@ int Process::exec(const String& path, Vector<String>&& arguments, Vector<String>
|
|||
#endif
|
||||
|
||||
if (current == this)
|
||||
yield();
|
||||
sched_yield();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -814,7 +814,7 @@ void Process::send_signal(int signal, Process* sender)
|
|||
dbgprintf("signal: %s(%u) sent %d to %s(%u)\n", sender->name().characters(), sender->pid(), signal, name().characters(), pid());
|
||||
|
||||
if (sender == this) {
|
||||
yield();
|
||||
sched_yield();
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
@ -865,7 +865,7 @@ void Process::doHouseKeeping()
|
|||
s_deadProcesses->clear();
|
||||
}
|
||||
|
||||
void yield()
|
||||
int sched_yield()
|
||||
{
|
||||
if (!current) {
|
||||
kprintf( "PANIC: yield() with !current" );
|
||||
|
@ -876,10 +876,11 @@ void yield()
|
|||
|
||||
InterruptDisabler disabler;
|
||||
if (!scheduleNewProcess())
|
||||
return;
|
||||
return 1;
|
||||
|
||||
//kprintf("yield() jumping to new process: %x (%s)\n", current->farPtr().selector, current->name().characters());
|
||||
switchNow();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void switchNow()
|
||||
|
@ -1121,7 +1122,7 @@ ssize_t Process::sys$read(int fd, void* outbuf, size_t nread)
|
|||
if (!descriptor->hasDataAvailableForRead()) {
|
||||
m_fdBlockedOnRead = fd;
|
||||
block(BlockedRead);
|
||||
yield();
|
||||
sched_yield();
|
||||
}
|
||||
}
|
||||
nread = descriptor->read((byte*)outbuf, nread);
|
||||
|
@ -1351,7 +1352,7 @@ pid_t Process::sys$waitpid(pid_t waitee, int* wstatus, int options)
|
|||
m_waitee = waitee;
|
||||
m_waiteeStatus = 0;
|
||||
block(BlockedWait);
|
||||
yield();
|
||||
sched_yield();
|
||||
if (wstatus)
|
||||
*wstatus = m_waiteeStatus;
|
||||
return m_waitee;
|
||||
|
@ -1374,7 +1375,7 @@ void Process::block(Process::State state)
|
|||
void block(Process::State state)
|
||||
{
|
||||
current->block(state);
|
||||
yield();
|
||||
sched_yield();
|
||||
}
|
||||
|
||||
void sleep(DWORD ticks)
|
||||
|
@ -1382,7 +1383,7 @@ void sleep(DWORD ticks)
|
|||
ASSERT(current->state() == Process::Running);
|
||||
current->setWakeupTime(system.uptime + ticks);
|
||||
current->block(Process::BlockedSleep);
|
||||
yield();
|
||||
sched_yield();
|
||||
}
|
||||
|
||||
Process* Process::kernelProcess()
|
||||
|
|
|
@ -284,7 +284,7 @@ static inline const char* toString(Process::State state)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
extern void yield();
|
||||
extern int sched_yield();
|
||||
extern bool scheduleNewProcess();
|
||||
extern void switchNow();
|
||||
extern void block(Process::State);
|
||||
|
|
|
@ -48,7 +48,7 @@ static DWORD handle(RegisterDump& regs, DWORD function, DWORD arg1, DWORD arg2,
|
|||
ASSERT_INTERRUPTS_ENABLED();
|
||||
switch (function) {
|
||||
case Syscall::SC_yield:
|
||||
yield();
|
||||
sched_yield();
|
||||
break;
|
||||
case Syscall::SC_putch:
|
||||
Console::the().putChar(arg1 & 0xff);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue