Skip to content

Commit

Permalink
include/threadman_kernel.h: Added event flag attributes and more even…
Browse files Browse the repository at this point in the history
…t wait types.
  • Loading branch information
Felix-Dev committed May 3, 2014
1 parent 5d3a0bb commit b75b95a
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions include/threadman_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,6 @@ int sceKernelDeleteMutex(int);

/* Event flags */

enum SceEventFlagWaitTypes {
/** Wait for all bits in the pattern to be set */
SCE_EVENT_WAITAND = 0,
/** Wait for one or more bits in the pattern to be set */
SCE_EVENT_WAITOR = 1,
/** Clear the wait pattern when it matches */
SCE_EVENT_WAITCLEAR = 0x20
};

typedef struct {
SceSize size;
char name[32];
Expand All @@ -94,6 +85,27 @@ typedef struct {
SceSize size;
} SceKernelEventFlagOptParam;

/* Event flag attributes. */
#define SCE_KERNEL_EA_SINGLE (0x0000) /** Multiple thread waits are prohibited. */
#define SCE_KERNEL_EA_MULTI (0x0200) /** Multiple thread waits are permitted. */

// NOTE: Deprecated. These types will be replaced by the below wait modes in future revisions.
enum SceEventFlagWaitTypes {
/** Wait for all bits in the pattern to be set */
SCE_EVENT_WAITAND = 0,
/** Wait for one or more bits in the pattern to be set */
SCE_EVENT_WAITOR = 1,
/** Clear the wait pattern when it matches */
SCE_EVENT_WAITCLEAR = 0x20
};

/* Event flag wait modes. */
#define SCE_KERNEL_EW_AND (0x00) /** Wait for all bits in the bit pattern to be set. */
#define SCE_KERNEL_EW_OR (0x01) /** Wait for one or more bits in the bit pattern to be set. */
#define SCE_KERNEL_EW_CLEAR_ALL (0x10) /** Clear all bits after wait condition is satisfied. */
#define SCE_KERNEL_EW_CLEAR_PAT (0x20) /** Clear bits specified by bit pattern after wait condition is satisfied. */
#define SCE_KERNEL_EW_CLEAR SCE_KERNEL_EW_CLEAR_ALL

SceUID sceKernelCreateEventFlag(const char *name, int attr, int bits, SceKernelEventFlagOptParam *opt);
int sceKernelSetEventFlag(SceUID evid, u32 bits);
int sceKernelClearEventFlag(SceUID evid, u32 bits);
Expand Down

0 comments on commit b75b95a

Please sign in to comment.