source: svn/newcon3bcm2_21bu/magnum/syslib/framework/7552/bsyslib.h @ 26

Last change on this file since 26 was 26, checked in by phkim, 11 years ago
  1. phkim
  2. 서경방소에서 kctv 로고 변경
  • Property svn:executable set to *
File size: 8.8 KB
Line 
1/***************************************************************************
2*     Copyright (c) 2004-2008, Broadcom Corporation
3*     All Rights Reserved
4*     Confidential Property of Broadcom Corporation
5*
6*  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7*  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8*  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9*
10* $brcm_Workfile: bsyslib.h $
11* $brcm_Revision: Hydra_Software_Devel/2 $
12* $brcm_Date: 4/3/08 2:33p $
13*
14* Revision History:
15*
16* $brcm_Log: /magnum/syslib/framework/noarch/bsyslib.h $
17*
18* Hydra_Software_Devel/2   4/3/08 2:33p bandrews
19* PR40090: synclib needs to have different contexts for syslib callbacks
20* and synclib callbacks
21*
22* Hydra_Software_Devel/1   3/24/08 3:08p bandrews
23* PR40865: Fixed
24*
25* Hydra_Software_Devel/7   1/25/08 9:24p bandrews
26* PR36148: Extracted callback code into separate file
27*
28* Hydra_Software_Devel/6   1/3/08 5:17p bandrews
29* PR37951: Updated based on initial feedback
30*
31* Hydra_Software_Devel/5   12/17/07 1:11p bandrews
32* PR36149: Updated per feedback from impl reviewq
33*
34* Hydra_Software_Devel/4   12/12/07 3:50p bandrews
35* PR36149: Fixed dependency on berr
36*
37* Hydra_Software_Devel/3   12/6/07 5:12p bandrews
38* PR36149: Fixed extra comma and separated handle from settings
39*
40* Hydra_Software_Devel/2   12/6/07 5:01p bandrews
41* PR36149: Added timer create/destroy to separate isr from task time
42* stuff
43*
44* Hydra_Software_Devel/1   10/16/07 2:09p bandrews
45* PR36149: Initial check-in
46***************************************************************************/
47
48#include "bstd.h"
49#include "bkni.h"
50
51#ifndef BSYSLIB_H__
52#define BSYSLIB_H__
53
54/* 20071214 bandrews - Removed.  Replace with scheduling a zero-length timer */
55#ifdef BSYSLIB_TASK_SUPPORT
56
57/*
58Summary:
59Delegate signature for a generic task function.  This is a task-time call,
60not a new OS "task" / thread.
61Description:
62A task delegate to be run at task time
63*/
64typedef void (*BSYSlib_Task)
65(
66        void * pvParm1, /* user context param 1 */
67        int iParm2 /* user context param 2 */
68);
69
70/*
71Summary:
72Settings for starting a task
73*/
74typedef struct
75{
76        BSYSlib_Task pfDoTask; /* the task to start */ 
77        void * pvParm1; /* first user context parameter to the task delegate */ 
78        int iParm2; /* second user context parameter to the task delegate */ 
79} BSYSlib_Task_Settings;
80
81/*
82Summary:
83Task-scheduling isr-time delegate signature
84Description:
85Schedules a task to be run out of isr context
86*/
87typedef BERR_Code (*BSYSlib_Task_Schedule_isr)
88(
89        void * pvParm1, /* first user context parameter to the schedule function [in] */ 
90        int iParm2, /* second user context parameter to the schedule function [in] */ 
91        const BSYSlib_Task_Settings * psSettings /* the task settings [in] */ 
92);
93
94/*
95Summary:
96Encapsulates the task callback function plus context
97*/
98typedef struct BSYSlib_TaskCallback
99{
100        BSYSlib_Task_Schedule_isr pfSchedule_isr; /* schedule signature */
101        void * pvParm1; /* first user context parameter used for the task callback */
102        int iParm; /* second user context parameter used for the task callback */
103} BSYSlib_EventCallback;
104
105#endif
106
107/*
108Summary:
109A task-time event-handling delegate signature
110Description:
111Called when the specified event this handler was registered for occurs
112*/
113typedef BERR_Code (*BSYSlib_Event_Handler)
114(
115        void * pvParm1, /* first user context parameter [in] */ 
116        int iParm2, /* second user context parameter [in] */ 
117        BKNI_EventHandle hEvent /* the event that occurred [in] */
118);
119
120/*
121Summary:
122Settings for listening to an event
123*/
124typedef struct
125{
126        BKNI_EventHandle hEvent; /* the event to be handled */
127        BSYSlib_Event_Handler pfEventOccurred; /* the delegate to handle the event */
128        void * pvParm1; /* user context param for the event handler */
129        int iParm2; /* user context param2 for the event handler */
130} BSYSlib_Event_Settings;
131
132/*
133Summary:
134Adds an event handler for the specified event
135Description:
136Task-time delegate signature for adding event handlers to events
137*/
138typedef BERR_Code (*BSYSlib_Event_AddHandler)
139(
140        void * pvParm1, /* user context param for the add function [in] */
141        int iParm2, /* user context param2 for the add function [in] */
142        const BSYSlib_Event_Settings * psSettings /* the event handler settings for the handler to add [in] */
143);
144
145/*
146Summary:
147Removes an event handler for the specified event
148Description:
149Task-time delegate signature for removing event handlers from events
150*/
151typedef BERR_Code (*BSYSlib_Event_RemoveHandler)
152(
153        void * pvParm1, /* user context param for the remove function [in] */
154        int iParm2, /* user context param2 for the remove function [in] */
155        const BSYSlib_Event_Settings * psSettings /* the event handler settings for the handler to remove [in] */
156);
157
158/*
159Summary:
160Encapsulates all event-related callback functions plus context
161*/
162typedef struct BSYSlib_EventCallback
163{
164        BSYSlib_Event_AddHandler pfAdd; /* add signature */
165        BSYSlib_Event_RemoveHandler pfRemove; /* remove signature */
166        void * pvParm1; /* first user context parameter used for the event callbacks */
167        int iParm2; /* second user context parameter used for the event callbacks */
168} BSYSlib_EventCallback;
169
170/*
171Summary:
172Generic timer handle
173*/ 
174typedef void * BSYSlib_Timer_Handle;
175
176/*
177Summary:
178Edge-triggered timer expiry notification function
179Description:
180Task-time timer expiry delegate signature
181*/ 
182typedef BERR_Code (*BSYSlib_Timer_ExpiryHandler) 
183( 
184        void * pvParm1, /* first user context parameter [in] */ 
185        int iParm2, /* second user context parameter [in] */ 
186        BSYSlib_Timer_Handle hTimer /* the handle of the timer that expired [in] */ 
187);
188
189/*
190Summary:
191Settings for starting a timer
192*/
193typedef struct
194{
195        unsigned long ulTimeout; /* timeout of timer */
196        BSYSlib_Timer_ExpiryHandler pfTimerExpired; /* the handler function to call back when the timer expires */
197        void * pvParm1; /* first user context parameter to the expiry handler function */
198        int iParm2; /* second user context parameter to the expiry handler function */ 
199} BSYSlib_Timer_Settings;
200
201/*
202Summary:
203Timer creation delegate.
204Description:
205The system will allocate resources for a timer.  The system should keep track of the timer through the specified handle.
206*/
207typedef BERR_Code (*BSYSlib_Timer_Create) 
208( 
209        void * pvParm1, /* first user context parameter to the start function [in] */ 
210        int iParm2, /* second user context parameter to the start function [in] */ 
211        BSYSlib_Timer_Handle * phTimer /* handle of timer [out] */ 
212);
213
214/*
215Summary:
216Timer destruction delegate
217Description:
218The system will destroy resources associated with the specified timer handle.
219*/
220typedef void (*BSYSlib_Timer_Destroy) 
221( 
222        void * pvParm1, /* first user context parameter to the start function [in] */ 
223        int iParm2, /* second user context parameter to the start function [in] */ 
224        BSYSlib_Timer_Handle hTimer /* handle of timer [in] */ 
225);
226
227/*
228Summary:
229Timer start delegate.
230Description:
231The system will start the timer specified by handle (and created earlier) with the specified timeout and callback function.
232*/
233typedef BERR_Code (*BSYSlib_Timer_Start_isr) 
234( 
235        void * pvParm1, /* first user context parameter to the start function [in] */ 
236        int iParm2, /* second user context parameter to the start function [in] */ 
237        BSYSlib_Timer_Handle hTimer, /* the handle of the timer */
238        const BSYSlib_Timer_Settings * psSettings /* the timer settings [in] */
239);
240
241/*
242Summary:
243Timer cancel delegate.
244Description:
245The system will cancel the timer with the specified handle.
246*/
247typedef BERR_Code (*BSYSlib_Timer_Cancel_isr)
248(
249        void * pvParm1, /* first user context parameter [in] */ 
250        int iParm2, /* second user context parameter [in] */ 
251        BSYSlib_Timer_Handle hTimer /* handle of timer [in] */ 
252);
253
254/*
255Summary:
256Encapsulates all timer-related callback functions plus context
257*/
258typedef struct BSYSlib_TimerCallback
259{
260        BSYSlib_Timer_Create pfCreate; /* create signature */
261        BSYSlib_Timer_Destroy pfDestroy; /* destroy signature */
262        BSYSlib_Timer_Start_isr pfStart_isr; /* start signature */
263        BSYSlib_Timer_Cancel_isr pfCancel_isr; /* cancel signature */
264        void * pvParm1; /* first user context parameter used for the timer callbacks */
265        int iParm2; /* second user context parameter used for the timer callbacks */
266} BSYSlib_TimerCallback;
267
268/*
269Summary:
270Retrieves the current system time
271*/
272typedef BERR_Code (*BSYSlib_GetTime_isr)
273(
274        void * pvParm1, /* first user context parameter to the get time function [in] */ 
275        int iParm2, /* second user context parameter to the get time function [in] */ 
276        unsigned long * pulNow /* the current time in ms [out] */ 
277);
278
279/*
280Summary:
281Encapsulates system-time-related callback functions plus context
282*/
283typedef struct BSYSlib_TimeCallback
284{
285        BSYSlib_GetTime_isr pfGetTime_isr; /* get time signature */
286        void * pvParm1; /* first user context parameter used for the get time callback */
287        int iParm2; /* second user context parameter used for the get time callback */
288} BSYSlib_TimeCallback;
289
290#endif /* BSYSLIB_H__ */
291
Note: See TracBrowser for help on using the repository browser.