Make UEFI boot-platform build again
[haiku.git] / headers / private / kernel / UserEvent.h
blob5a7e5c23026ff6d8743dceebefe9f23d6aa44613
1 /*
2 * Copyright 2014, Paweł Dziepak, pdziepak@quarnos.org.
3 * Copyright 2011, Ingo Weinhold, ingo_weinhold@gmx.de.
4 * Distributed under the terms of the MIT License.
5 */
6 #ifndef _KERNEL_USER_EVENT_H
7 #define _KERNEL_USER_EVENT_H
10 #include <signal.h>
12 #include <SupportDefs.h>
14 #include <DPC.h>
15 #include <thread.h>
18 namespace BKernel {
21 struct Team;
22 struct Thread;
25 struct UserEvent : public BReferenceable {
26 virtual ~UserEvent();
28 virtual status_t Fire() = 0;
32 struct SignalEvent : UserEvent, private DPCCallback {
33 virtual ~SignalEvent();
35 void SetUserValue(union sigval userValue);
37 virtual status_t Fire();
39 protected:
40 struct EventSignal;
42 protected:
43 SignalEvent(EventSignal* signal);
45 protected:
46 EventSignal* fSignal;
47 int32 fPendingDPC;
51 struct TeamSignalEvent : SignalEvent {
52 static TeamSignalEvent* Create(Team* team, uint32 signalNumber,
53 int32 signalCode, int32 errorCode);
55 virtual status_t Fire();
57 protected:
58 virtual void DoDPC(DPCQueue* queue);
60 private:
61 TeamSignalEvent(Team* team,
62 EventSignal* signal);
64 private:
65 Team* fTeam;
69 struct ThreadSignalEvent : SignalEvent {
70 static ThreadSignalEvent* Create(Thread* thread, uint32 signalNumber,
71 int32 signalCode, int32 errorCode,
72 pid_t sendingTeam);
74 virtual status_t Fire();
76 protected:
77 virtual void DoDPC(DPCQueue* queue);
79 private:
80 ThreadSignalEvent(Thread* thread,
81 EventSignal* signal);
83 private:
84 Thread* fThread;
88 struct CreateThreadEvent : UserEvent, private DPCCallback {
89 static CreateThreadEvent* Create(
90 const ThreadCreationAttributes& attributes);
92 virtual status_t Fire();
94 private:
95 CreateThreadEvent(
96 const ThreadCreationAttributes& attributes);
98 virtual void DoDPC(DPCQueue* queue);
100 private:
101 ThreadCreationAttributes fCreationAttributes;
102 char fThreadName[B_OS_NAME_LENGTH];
103 int32 fPendingDPC;
107 } // namespace BKernel
110 using BKernel::CreateThreadEvent;
111 using BKernel::SignalEvent;
112 using BKernel::TeamSignalEvent;
113 using BKernel::ThreadSignalEvent;
114 using BKernel::UserEvent;
117 #endif // _KERNEL_USER_EVENT_H