Main Page   Modules   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

/projects/cubeos/src_current/kernel/ssem.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define ssem_post(x)   x++;
 post operation, should only be called in disabled() state. More...

#define ssem_signal(x)   ssem_post(x)
 alias of ssem_port(), for thomas. More...

#define ssem_wait(x)   x--;while(x<0)
 spinlock wait, does not return a propper value. More...

#define ssem_trywait(x)   (x<0)
 tests if a ssem_wait() might block. More...

#define ssem_getvalue(x, i)   (*i=x)
 reads the semaphore value. More...

#define ssem_init(x, i, v)   (x=v)
 to fulfill posix conventions. Quite useless for CubeOS, but anyway ... More...

#define ssem_destroy(x)   (0)
 to fulfill posix conventions. Quite useless for CubeOS, but anyway ... More...


Typedefs

typedef int ssem_t


Detailed Description

simple semaphores with spin lock, to be used if waiting one quantum would be too long. warning: not thread-aware, not deadlock-safe, don't use it for new things unless you know exactly what you're doing !!! These semaphores are SAFE as long as there is only one producer and one consumer, like in i2cd. However, they are not Mutex-Safe !!!

Definition in file ssem.h.


Define Documentation

#define ssem_destroy      (0)
 

to fulfill posix conventions. Quite useless for CubeOS, but anyway ...

Definition at line 38 of file ssem.h.

#define ssem_getvalue x,
     (*i=x)
 

reads the semaphore value.

Definition at line 35 of file ssem.h.

#define ssem_init x,
i,
     (x=v)
 

to fulfill posix conventions. Quite useless for CubeOS, but anyway ...

Definition at line 37 of file ssem.h.

#define ssem_post      x++;
 

post operation, should only be called in disabled() state.

Definition at line 31 of file ssem.h.

#define ssem_signal      ssem_post(x)
 

alias of ssem_port(), for thomas.

Definition at line 32 of file ssem.h.

Referenced by _I2C_slave_handler, and GenerateStop.

#define ssem_trywait      (x<0)
 

tests if a ssem_wait() might block.

Definition at line 34 of file ssem.h.

#define ssem_wait      x--;while(x<0)
 

spinlock wait, does not return a propper value.

Definition at line 33 of file ssem.h.

Referenced by I2C_slprocess, and I2C_Start_I2C_Transfer.


Typedef Documentation

typedef int ssem_t
 

Definition at line 29 of file ssem.h.


Generated on Thu Feb 20 15:38:55 2003 for cubeOS by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002