1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
__code consoleread2ReadSyscallImpl(struct ReadSyscallImpl* read_syscall,struct InputArg* input, struct inode* ip, __code next(...)) {
if (input->r == input->w) {
if (proc->killed) {
release(&input->lock);
ilock(ip);
KernelRet* kernel_ret = createKernelRetImpl(cbc_context);
goto kernel_ret->cbc_return(-1);
}
goto cbc_sleep(&input->r, &input->lock, cbc_consoleread2);
}
goto read_sycall->consoleread1();
}
__code consoleread2ReadSyscallImpl_stub(struct Context* cbc_context) {
ReadSyscallImpl* read_syscall = (ReadSyscallImpl*)GearImpl(cbc_context, ReadSyscall, read_syscall);
inode* ip = Gearef(cbc_context, ReadSyscall)->ip;
enum Code next = Gearef(cbc_context, ReadSyscall)->next;
struct InputArg* input = GeareData(kernel_context, InputArg);
goto consoleread2ReadSyscallImpl(cbc_context, read_syscall, ip, next);
}
__code consoleread2ReadSyscallImpl_wait_lock(struct Context* cbc_context) {
srtruct KernelContext* kcontext = &kernel_context;
goto semaphore->p(consoleread2ReadSyscallImpl);
}
|