⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sema.c

📁 The main purpose of this project is to add a new scheduling algorithm to GeekOS and to implement a s
💻 C
字号:
/* * Semaphores * Copyright (c) 2003, Jeffrey K. Hollingsworth <hollings@cs.umd.edu> * Copyright (c) 2004, David H. Hovemeyer <daveho@cs.umd.edu> * $Revision: 1.11 $ *  * This is free software.  You are permitted to use, * redistribute, and modify it as specified in the file "COPYING". */#include <geekos/syscall.h>#include <string.h>#include <sema.h>DEF_SYSCALL(Create_Semaphore,SYS_CREATESEMAPHORE,int,(const char *name, int ival),    const char *arg0 = name; size_t arg1 = strlen(name); int arg2 = ival;,    SYSCALL_REGS_3)DEF_SYSCALL(P,SYS_P,int,(int s),int arg0 = s;,SYSCALL_REGS_1)DEF_SYSCALL(V,SYS_V,int,(int s),int arg0 = s;,SYSCALL_REGS_1)DEF_SYSCALL(Destroy_Semaphore,SYS_DESTROYSEMAPHORE,int,(int s),int arg0 = s;,SYSCALL_REGS_1)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -