First public contribution.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32\include\nkernsmp\nk_event.h
16 // WARNING: This file contains some APIs which are internal and are subject
17 // to change without notice. Such APIs should therefore not be used
18 // outside the Kernel and Hardware Services package.
21 #ifndef __NK_EVENT_H__
22 #define __NK_EVENT_H__
30 /********************************************
32 ********************************************/
37 General event handler callback
39 typedef void (*NEventFn)(TAny*);
44 General event handler structure
46 struct NEventHandler : public SDblQueLink // link into active queue
48 inline NEventHandler()
49 : iHState(0), iTied(0), iPtr(0), iFn(0)
54 enum TEventHandlerType
56 EEventHandlerIrq=0xFCu,
57 EEventHandlerNTimer=0xFDu,
58 EEventHandlerIDFC=0xFEu,
59 EEventHandlerDummy=0xFFu,
76 volatile TUint32 iHState; // state information
77 volatile TUint8 iHType; // type of event handler
83 NSchedulable* volatile iTied; // pointer to tied thread/group
84 TDfcQue* volatile iDfcQ; // doubles as pointer to DFC queue
85 }; // since DFCs can't be tied
86 TAny* volatile iPtr; // argument to callback
87 volatile NEventFn iFn; // callback function
88 SDblQueLink iTiedLink; // link to tied/group for cleanup purposes
90 static TSpinLock TiedLock; // Protects iTied member of all NEventHandlers