PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
thevent.h
Go to the documentation of this file.
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org>
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
16#ifndef __THEVENT_H__
17#define __THEVENT_H__
18
19#include <types.h>
20#include <irx.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26/* Defines for WaitEventFlag */
27#define WEF_AND 0
28#define WEF_OR 1
29#define WEF_CLEAR 0x10
30
31// Attributes for event flags
33#define EA_SINGLE 0
35#define EA_MULTI 2
36
37typedef struct
38{
39 u32 attr;
40 u32 option;
41 u32 bits;
43
44typedef struct
45{
47 u32 attr;
49 u32 option;
56 int reserved1;
57 int reserved2;
59
60int CreateEventFlag(iop_event_t *event);
61int DeleteEventFlag(int ef);
62
63int SetEventFlag(int ef, u32 bits);
64int iSetEventFlag(int ef, u32 bits);
65
66int ClearEventFlag(int ef, u32 bits);
67int iClearEventFlag(int ef, u32 bits);
68
69int WaitEventFlag(int ef, u32 bits, int mode, u32 *resbits);
70
71int PollEventFlag(int ef, u32 bits, int mode, u32 *resbits);
72
73int ReferEventFlagStatus(int ef, iop_event_info_t *info);
74int iReferEventFlagStatus(int ef, iop_event_info_t *info);
75
76// clang-format off
77#define thevent_IMPORTS \
78 thevent_IMPORTS_start \
79 \
80 I_CreateEventFlag \
81 I_DeleteEventFlag \
82 \
83 I_SetEventFlag \
84 I_iSetEventFlag \
85 \
86 I_ClearEventFlag \
87 I_iClearEventFlag \
88 \
89 I_WaitEventFlag \
90 \
91 I_PollEventFlag \
92 \
93 I_ReferEventFlagStatus \
94 I_iReferEventFlagStatus \
95 \
96 thevent_IMPORTS_end END_IMPORT_TABLE
97// clang-format on
98
99#define thevent_IMPORTS_start DECLARE_IMPORT_TABLE(thevent, 1, 1)
100#define thevent_IMPORTS_end END_IMPORT_TABLE
101
102#define I_CreateEventFlag DECLARE_IMPORT(4, CreateEventFlag)
103#define I_DeleteEventFlag DECLARE_IMPORT(5, DeleteEventFlag)
104#define I_SetEventFlag DECLARE_IMPORT(6, SetEventFlag)
105#define I_iSetEventFlag DECLARE_IMPORT(7, iSetEventFlag)
106#define I_ClearEventFlag DECLARE_IMPORT(8, ClearEventFlag)
107#define I_iClearEventFlag DECLARE_IMPORT(9, iClearEventFlag)
108#define I_WaitEventFlag DECLARE_IMPORT(10, WaitEventFlag)
109#define I_PollEventFlag DECLARE_IMPORT(11, PollEventFlag)
110#define I_ReferEventFlagStatus DECLARE_IMPORT(13, ReferEventFlagStatus)
111#define I_iReferEventFlagStatus DECLARE_IMPORT(14, iReferEventFlagStatus)
112
113#ifdef __cplusplus
114}
115#endif
116
117#endif /* __THEVENT_H__ */