00001 /* src_experimental/kernel/ssem.h 00002 CubeOS Version 0.4.90 experimental 00003 Copyright (C) 1999,2000 Holger Kenn 00004 00005 CubeOS is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or any later version. 00009 00010 CubeOS is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 */ 00016 #ifndef SSEM_H 00017 00018 #define SSEM_H 00019 00029 typedef int ssem_t; 00030 00031 #define ssem_post(x) x++; 00032 #define ssem_signal(x) ssem_post(x) 00033 #define ssem_wait(x) x--;while(x<0) 00034 #define ssem_trywait(x) (x<0) 00035 #define ssem_getvalue(x,i) (*i=x) 00036 00037 #define ssem_init(x,i,v) (x=v) 00038 #define ssem_destroy(x) (0) 00039 00040 #endif