1 /*
2 * Copyright (c) 2013, Texas Instruments Incorporated
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * * Neither the name of Texas Instruments Incorporated nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32 /*
33 * ======== Timer.xdc ========
34 *
35 *
36 */
37
38 package ti.sysbios.timers.dmtimer;
39
40 import xdc.rov.ViewInfo;
41
42 import xdc.runtime.Assert;
43 import xdc.runtime.Error;
44 import xdc.runtime.Types;
45 import ti.sysbios.interfaces.ITimer;
46 import ti.sysbios.hal.Hwi;
47
48 /*!
49 * ======== Timer ========
50 * Timer Peripheral Manager.
51 *
52 * This Timer module manages the Dual Mode timer (dmtimer) peripherals
53 * available on the ARM and C6000 devices (see
54 * {@link ./doc-files/TimerTables.html Timer Mapping Tables} for supported
55 * device information).
56 *
57 * The dmtimer Timer module supports the timer in 'one shot', 'continuous',
58 * and 'dynamic' modes.
59 *
60 * In 'one shot' mode, a timer function will "fire" (run) when the timer period
61 * expires (counts up to zero). In 'one shot' mode this will only happen
62 * once.
63 *
64 * In 'continuous' mode, the specified timer function will "fire" every
65 * time the period expires, throughout the lifetime of the program. When the
66 * period expires in 'continuous mode', the period is then reset to its
67 * original value and then begins counting up to zero again. At this point
68 * the timer function will fire again and the cycle repeats itself.
69 *
70 * In 'dynamic' mode, the specified timer function will "fire" every
71 * time the period expires. But the period of the timer can be changed
72 * dynamically, to correspond to the next tick interrupt needed from the
73 * timer. The timer will continually count upwards, and the timer's compare
74 * mode is used to generate an interrupt when a specific threshold count is
75 * reached. This mode is used by the SYS/BIOS Clock module, for implementing
76 * dynamic tick suppression, which reduces the number of interrupts from the
77 * timer to the minimum required for currently scheduled timeouts.
78 *
79 * @p(html) 80 * <h3> Calling Context </h3>
81 * <table border="1" cellpadding="3">
82 * <colgroup span="1"></colgroup> <colgroup span="5" align="center">
83 * </colgroup>
84 *
85 * <tr><th> Function </th><th> Hwi </th><th> Swi </th>
86 * <th> Task </th><th> Main </th><th> Startup </th></tr>
87 * <!-- -->
88 * <tr><td> {@link #getNumTimers} </td><td> Y </td>
89 * <td> Y </td><td> Y </td><td> Y </td><td> N </td></tr>
90 * <tr><td> {@link #getStatus} </td><td> Y </td>
91 * <td> Y </td><td> Y </td><td> Y </td><td> N </td></tr>
92 * <tr><td> {@link #Params_init} </td><td> Y </td>
93 * <td> Y </td><td> Y </td><td> Y </td><td> N </td></tr>
94 * <tr><td> {@link #construct} </td><td> Y </td>
95 * <td> Y </td><td> Y </td><td> Y </td><td> N </td></tr>
96 * <tr><td> {@link #create} </td><td> N </td>
97 * <td> N </td><td> Y </td><td> Y </td><td> N </td></tr>
98 * <tr><td> {@link #delete} </td><td> N </td>
99 * <td> N </td><td> Y </td><td> Y </td><td> N </td></tr>
100 * <tr><td> {@link #destruct} </td><td> Y </td>
101 * <td> Y </td><td> Y </td><td> Y </td><td> N </td></tr>
102 * <tr><td> {@link #getCount} </td><td> Y </td>
103 * <td> Y </td><td> Y </td><td> N </td><td> N </td></tr>
104 * <tr><td> {@link #getFreq} </td><td> Y </td>
105 * <td> Y </td><td> Y </td><td> Y </td><td> N </td></tr>
106 * <tr><td> {@link #getFunc} </td><td> Y </td>
107 * <td> Y </td><td> Y </td><td> Y </td><td> N </td></tr>
108 * <tr><td> {@link #getPeriod} </td><td> Y </td>
109 * <td> Y </td><td> Y </td><td> Y </td><td> N </td></tr>
110 * <tr><td> {@link #reconfig} </td><td> Y </td>
111 * <td> Y </td><td> Y </td><td> Y </td><td> N </td></tr>
112 * <tr><td> {@link #setFunc} </td><td> Y </td>
113 * <td> Y </td><td> Y </td><td> Y </td><td> N </td></tr>
114 * <tr><td> {@link #setPeriod} </td><td> Y </td>
115 * <td> Y </td><td> Y </td><td> Y </td><td> N </td></tr>
116 * <tr><td> {@link #setPeriodMicroSecs} </td><td> Y </td>
117 * <td> Y </td><td> Y </td><td> Y </td><td> N </td></tr>
118 * <tr><td> {@link #start} </td><td> Y </td>
119 * <td> Y </td><td> Y </td><td> N </td><td> N </td></tr>
120 * <tr><td> {@link #stop} </td><td> Y </td>
121 * <td> Y </td><td> Y </td><td> N </td><td> N </td></tr>
122 * <tr><td colspan="6"> Definitions: <br />
123 * <ul>
124 * <li> <b>Hwi</b>: API is callable from a Hwi thread. </li>
125 * <li> <b>Swi</b>: API is callable from a Swi thread. </li>
126 * <li> <b>Task</b>: API is callable from a Task thread. </li>
127 * <li> <b>Main</b>: API is callable during any of these phases: </li>
128 * <ul>
129 * <li> In your module startup after this module is started
130 * (e.g. Timer_Module_startupDone() returns TRUE). </li>
131 * <li> During xdc.runtime.Startup.lastFxns. </li>
132 * <li> During main().</li>
133 * <li> During BIOS.startupFxns.</li>
134 * </ul>
135 * <li> <b>Startup</b>: API is callable during any of these phases:</li>
136 * <ul>
137 * <li> During xdc.runtime.Startup.firstFxns.</li>
138 * <li> In your module startup before this module is started
139 * (e.g. Timer_Module_startupDone() returns FALSE).</li>
140 * </ul>
141 * </ul>
142 * </td></tr>
143 *
144 * </table>
145 * @p 146 *
147 * @p(html) 148 * <h3> Timer Mapping Tables </h3>
149 * <p>
150 * The Timer module allows the user to use and configure the various timers
151 * that exist on a particular device. This is achieved by specifying a timer
152 * ID when calling {@link ti.sysbios.hal.Timer#Timer_create}.
153 * However, the timer ID
154 * specified may not always map to that timer; for example, specifying an ID
155 * value of 1 does not necessarily mean that this will map to "GPTimer1".
156 * These tables are provided to show which timers map to which timer IDs.
157 * </p>
158 * {@link ./doc-files/TimerTables.html Timer Mapping Tables}
159 * @p 160 */
161 @InstanceFinalize /* To cleanup */
162 @InstanceInitError /* To report unavailability of timer */
163 @ModuleStartup /* to configure static timers */
164
165 module Timer inherits ti.sysbios.interfaces.ITimer
166 {
167 /*! override supportsDynamic - this Timer does support RunMode_DYNAMIC */
168 overridemetaonlyconfig Bool supportsDynamic = true;
169
170 /*! Max value of Timer period for PeriodType_COUNTS*/
171 const UInt MAX_PERIOD = 0xffffffff;
172
173 /*! L4 interface Configuration Register (TIOCP_CFG). */
174 struct TiocpCfg {
175 Bits8 idlemode; /*! 0=force-idle;1=no-idle;2=Smart-idle;3=Smart-idle */
176 Bits8 emufree; /*! 0=counter frozen; 1=counter free-running */
177 Bits8 softreset; /*! 0=normal mode; 1=soft reset */
178 };
179
180 /*! Interrupt Enable Register (TIER). */
181 struct Tier {
182 Bits8 mat_it_ena; /*! Enable match interrupt */
183 Bits8 ovf_it_ena; /*! Enable overflow interrupt */
184 Bits8 tcar_it_ena; /*! Enable capture interrupt */
185 };
186
187 /*! WakepUp Enable Register (TWER). */
188 struct Twer {
189 Bits8 mat_wup_ena; /*! Enable match wake-up */
190 Bits8 ovf_wup_ena; /*! Enable overflow wake-up */
191 Bits8 tcar_wup_ena; /*! Enable capture wake-up */
192 };
193
194 /*! Control Register (TCLR). */
195 struct Tclr {
196 Bits32 ptv; /*! Trigger output mode */
197 Bits8 pre; /*! Prescalar enable */
198 Bits8 ce; /*! Compare enable */
199 Bits8 scpwm;/*! Pulse-width modulation */
200 Bits16 tcm; /*! Transition capture mode */
201 Bits16 trg; /*! Trigger output mode */
202 Bits8 pt; /*! Pulse or toggle select bit */
203 Bits8 captmode; /*! Capture mode select bit */
204 Bits8 gpocfg; /*! PWM output/event detection input pin */
205 };
206
207 /*! L4 Interface Synchronization Control Register (TSICR). */
208 struct Tsicr {
209 Bits8 sft; /*! Reset software functional registers */
210 Bits8 posted; /*! Posted mode selection */
211 };
212
213 /*! Timer Settings. */
214 metaonlystruct TimerSetting {
215 Bool master; /*! specifies whether this is the master */
216 Ptr baseAddr; /*! specify the base address */
217 Int intNum; /*! specify which interrupt vector */
218 String name; /*! specify the timer name */
219 };
220
221 /*!
222 * ======== BasicView ========
223 * @_nodoc 224 */
225 metaonlystruct BasicView {
226 Ptr halTimerHandle;
227 String label;
228 UInt id;
229 String name;
230 String startMode;
231 String runMode;
232 UInt period;
233 String periodType;
234 UInt intNum;
235 String eventId;
236 String tickFxn[];
237 UArg arg;
238 String extFreqLow;
239 String extFreqHigh;
240 String hwiHandle;
241 };
242
243 /*!
244 * ======== DeviceView ========
245 * @_nodoc 246 */
247 metaonlystruct DeviceView {
248 UInt id;
249 String deviceAddr;
250 UInt intNum;
251 String eventId;
252 String runMode;
253 String timerState;
254 UInt period;
255 String currCount;
256 String remainingCount;
257 };
258
259 /*!
260 * ======== ModuleView ========
261 * @_nodoc 262 */
263 metaonlystruct ModuleView {
264 String availMask; /* avaliable 32-bit timer halves */
265 String intFrequency[]; /* internal frequency in Hz */
266 }
267
268 /*!
269 * ======== rovViewInfo ========
270 * @_nodoc 271 */
272 @Facet
273 metaonlyconfig ViewInfo.Instance rovViewInfo =
274 ViewInfo.create({
275 viewMap: [
276 [
277 'Basic',
278 {
279 type: ViewInfo.INSTANCE,
280 viewInitFxn: 'viewInitBasic',
281 structName: 'BasicView'
282 }
283 ],
284 [
285 'Device',
286 {
287 type: ViewInfo.INSTANCE,
288 viewInitFxn: 'viewInitDevice',
289 structName: 'DeviceView'
290 }
291 ],
292 [
293 'Module',
294 {
295 type: ViewInfo.MODULE,
296 viewInitFxn: 'viewInitModule',
297 structName: 'ModuleView'
298 }
299 ],
300 ]
301 });
302
303 /*!
304 * Assert raised when statically created timer is not available
305 */
306 config xdc.runtime.Assert.Id A_notAvailable = {
307 msg: "A_notAvailable: statically created timer not available"
308 };
309
310 /*!
311 * Error raised when timer id specified is not supported.
312 */
313 config Error.Id E_invalidTimer = {
314 msg: "E_invalidTimer: Invalid Timer Id %d"
315 };
316
317 /*!
318 * Error raised when timer requested is in use
319 */
320 config Error.Id E_notAvailable = {
321 msg: "E_notAvailable: Timer not available %d"
322 };
323
324 /*!
325 * Error raised when period requested is not supported
326 */
327 config Error.Id E_cannotSupport = {
328 msg: "E_cannotSupport: Timer cannot support requested period %d"
329 };
330
331 /*!
332 * Error raised when timer frequency does not match expected frequency
333 *
334 * BIOS does not configure the DMTimer clock source and expects this
335 * configuration to be performed via a GEL script or on the host OS. This
336 * error is raised if BIOS detects a mismatch between {@link #intFreq} and
337 * the actual operating frequency. The check is performed by comparing
338 * the timestamp operating frequency with the DMTimer frequency.
339 *
340 * To change the expected timer frequency to match the actual operating
341 * frequency, use the following example configuration:
342 * @p(code) 343 * var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
344 * Timer.intFreq.lo = 20000000; //For 20Mhz
345 * Timer.intFreq.hi = 0;
346 * @p 347 *
348 * This check can be skipped by setting {@link #checkFrequency} to FALSE.
349 */
350 config Error.Id E_freqMismatch = {
351 msg: "E_freqMismatch: Frequency mismatch: Expected %d Hz, actual: %d Hz. You need to modify Timer.intFreq.lo to match the actual frequency."
352 };
353
354 /*!
355 * Error raised when intNum not supplied by user or device table
356 */
357 config Error.Id E_badIntNum = {
358 msg: "E_badIntNum: Timer requires a valid intNum. Please use DMTimer module's timerSettings config param to assign a valid intNum for the selected timer."
359 };
360
361 /*!
362 * ======== anyMask ========
363 * Available mask to be used when select = Timer_ANY.
364 *
365 * Default value is device specific.
366 */
367 config Bits32 anyMask;
368
369 /*!
370 * ======== checkFrequency ========
371 * Whether to check the timer operating frequency at startup
372 *
373 * When this flag is set to 'TRUE', the Timer module will verify that the
374 * operating frequency equals the frequency at which BIOS expects the
375 * timers to operate. This check is performed by checking the timer count
376 * rate against the {@link xdc.runtime.Timestamp} count rate.
377 */
378 config Bool checkFrequency = true;
379
380 /*!
381 * ======== timerSettings ========
382 * Global Control configuration for each physical timer.
383 */
384 metaonlyconfig TimerSetting timerSettings[] = [];
385
386 /*!
387 * ======== intFreq ========
388 * Default internal timer input clock frequency.
389 *
390 * If intFreq is set, its value will be copied into all
391 * {@link #intFreqs}[] array entries except any entry which was
392 * explicitly written to in the application's config script.
393 *
394 * For example, if intFreq is set to {hi:0, lo:32768} on a device
395 * with 3 timers, it will be copied into intFreqs[0], intFreqs[1] &
396 * intFreqs[2]. If the application explicitly sets one of the
397 * {@link #intFreqs}[] entries, say intFreqs[1], then intFreq is not
398 * copied into intFreqs[1] and intFreqs[1] retains the value it was
399 * set to in the config script.
400 */
401 metaonlyconfig Types.FreqHz intFreq = {lo: 0, hi: 0};
402
403 /*!
404 * ======== intFreqs ========
405 * Default internal timer input clock frequency array.
406 *
407 * This array can be used to change the input clock frequency
408 * for a particular timer.
409 *
410 * For example, if it is required to change the input clock frequency
411 * for timer id 2 to 32768Hz on a device that has 4 timers, the
412 * intFreqs[2] config param can be set to {hi:0, lo:32768} in the
413 * config script.
414 *
415 * For a list of default timer frequencies for different devices,
416 * please refer {@link ./doc-files/TimerTables.html Timer Mapping Tables}.
417 */
418 metaonlyconfig Types.FreqHz intFreqs[];
419
420 /*!
421 * ======== stub ========
422 * @_nodoc 423 * Timer requires acknowledgement
424 *
425 * @param(arg) timer object passed in as argument.
426 */
427 @DirectCall
428 Void stub(UArg arg);
429
430 /*!
431 * ======== dynStub ========
432 * @_nodoc 433 * Acknowledges timer interrupt and sets next threshold for interrupt.
434 *
435 * @param(arg) timer object passed in as argument.
436 */
437 @DirectCall
438 Void dynStub(UArg arg);
439
440 /*!
441 * ======== getHandle ========
442 * Get Handle associated with a timer id.
443 *
444 * @param(id) timer Id
445 * @b(returns) timer handle
446 */
447 @DirectCall
448 Handle getHandle(UInt id);
449
450 instance:
451
452 /*!
453 * ======== tiocpCfg ========
454 * Initial Timer TIOCP_CFG Register bit settings.
455 *
456 * For a detailed description of this timer register, please
457 * refer to your device's Technical Reference Manual.
458 */
459 config TiocpCfg tiocpCfg = {idlemode: 0, emufree: 0, softreset: 1};
460
461 /*!
462 * ======== tier ========
463 * Initial Timer IRQSTATUS_SET Register bit settings.
464 *
465 * For a detailed description of this timer register, please
466 * refer to your device's Technical Reference Manual.
467 */
468 config Tier tier = {mat_it_ena: 0, ovf_it_ena: 1, tcar_it_ena: 0};
469
470 /*!
471 * ======== twer ========
472 * Initial Timer IRQ Wakeup Enable Register bit settings.
473 *
474 * For a detailed description of this timer register, please
475 * refer to your device's Technical Reference Manual.
476 */
477 config Twer twer = {mat_wup_ena: 0, ovf_wup_ena: 0, tcar_wup_ena: 0};
478
479 /*!
480 * ======== tclr ========
481 * Initial Timer Control Register bit settings.
482 *
483 * For a detailed description of this timer register, please
484 * refer to your device's Technical Reference Manual.
485 */
486 config Tclr tclr = {ptv: 0, pre: 0, ce: 0, scpwm: 0, tcm: 0, trg: 0,
487 pt: 0, captmode: 0, gpocfg: 0};
488
489 /*!
490 * ======== tsicr ========
491 * Initial Timer Synchronous Interface Control Register bit settings.
492 *
493 * For a detailed description of this timer register, please
494 * refer to your device's Technical Reference Manual.
495 */
496 config Tsicr tsicr = {sft: 0, posted: 0};
497
498 /*!
499 * ======== tmar ========
500 * Initial Timer Match Register setting.
501 *
502 * For a detailed description of this timer register, please
503 * refer to your device's Technical Reference Manual.
504 */
505 config UInt32 tmar = 0;
506
507 /*!
508 * ======== intNum ========
509 * Hwi interrupt number to be used by Timer.
510 */
511 config Int intNum = -1;
512
513 /*!
514 * ======== eventId ========
515 * Hwi event Id to be used by Timer.
516 */
517 config Int eventId = -1;
518
519 /*! Hwi Params for Hwi Object. Default is null. */
520 config Hwi.Params *hwiParams = null;
521
522 /*!
523 * ======== reconfig ========
524 * Used to modify static timer instances at runtime.
525 *
526 * @param(timerParams) timer Params
527 * @param(tickFxn) functions that runs when timer expires
528 */
529 @DirectCall
530 Void reconfig(FuncPtr tickFxn, const Params *timerParams, Error.Block *eb);
531
532 /*!
533 * ======== getRollovers ========
534 * @_nodoc 535 * Returns the total number of timer rollovers since the timer was
536 * started. This API is used internally for implementing timestamping
537 * when the timer is shared with Clock, and running with RunMode_DYNAMIC.
538 * It has no other intended purpose.
539 *
540 * @b(returns) number of rollovers since timer was started
541 */
542 @DirectCall
543 UInt32 getRollovers();
544
545 /*!
546 * ======== enableTimestamping ========
547 * @_nodoc 548 * Enables the timer to be used for timestamping purposes. This API is
549 * used internally for enabling timestamping when the timer is shared with
550 * Clock, and running with RunMode_DYNAMIC. It has no other intended
551 * purpose.
552 *
553 */
554 @DirectCall
555 Void enableTimestamping();
556
557 /*!
558 * ======== restoreRegisters ========
559 * Restore timer registers to their nominal state following a power down.
560 *
561 * All registers are restored to their nominal operating state, except
562 * for those registers and bits associated with starting the timer.
563 *
564 * Following a power down, the user should do the following to restore
565 * and restart the timer:
566 *
567 * @p(code) 568 * Timer_handle timer;
569 * Error_Block eb;
570 *
571 * Timer_restoreRegisters(timer, &eb);
572 * Timer_start(timer);
573 * @p 574 *
575 */
576 @DirectCall
577 Void restoreRegisters(Error.Block *eb);
578
579 /*! @_nodoc 580 * ======== getIntNum ========
581 * Get Timer's Interrupt number.
582 *
583 * @b(returns) Timer's Interrupt number
584 */
585 @DirectCall
586 Int getIntNum();
587
588 internal: /* not for client use */
589
590
591 /*! Information about timer */
592 struct TimerDevice {
593 Int intNum;
594 Int eventId;
595 Ptr baseAddr;
596 };
597
598 /*! Device-specific Timer implementation. */
599 proxy TimerSupportProxy inherits ti.sysbios.interfaces.ITimerSupport;
600
601 /*!
602 * ======== startupNeeded ========
603 * This flag is use to prevent Timer_startup code (includes postInit(),
604 * deviceConfig(), initDevice() to be brought in un-necessarily.
605 */
606 config Bool startupNeeded = false;
607
608 /*!
609 * ======== numTimerDevices ========
610 * The number of logical timers on a device.
611 */
612 config Int numTimerDevices;
613
614 /*
615 * ======== deviceConfig ========
616 * Configure the timer.
617 */
618 Int deviceConfig(Object *timer, Error.Block *eb);
619
620 /*
621 * ======== initDevice ========
622 * reset timer to its resting state
623 */
624 Void initDevice(Object *timer, Error.Block *eb);
625
626 /*
627 * ======== initObj ========
628 * Initialize the instance state object
629 */
630 Void initObj(Object *timer, FuncPtr tickFxn, const Params *timerParams);
631
632 /*
633 * ======== postInit ========
634 * finish initializing static and dynamic Timers
635 */
636 Int postInit(Object *timer, Error.Block *eb);
637
638 /*
639 * ======== checkOverflow ========
640 */
641 Bool checkOverflow(UInt32 a, UInt32 b);
642
643 /*
644 * ======== getNextAvailableTimerId ========
645 */
646 UInt getNextAvailableTimerId(Object *timer);
647
648 /*!
649 * ======== spinLoop ========
650 * used by trigger function.
651 */
652 Void spinLoop(UInt count);
653
654 /*!
655 * ======== checkFreq ========
656 * Used to verify that the DMTimer is operating at the right frequency.
657 */
658 Void checkFreq(Timer.Object *obj);
659
660 /*! Instance state structure */
661 struct Instance_State {
662 Bool staticInst; /* statically created or not */
663 Int id; /* logical timer id. */
664 UInt tiocpCfg;
665 UInt tmar;
666 UInt tier;
667 UInt twer;
668 UInt tclr;
669 UInt tsicr;
670 ITimer.RunMode runMode; /* timer mode */
671 ITimer.StartMode startMode; /* timer mode */
672 UInt period; /* period */
673 ITimer.PeriodType periodType; /* type (microsecs, inst) */
674 UInt intNum; /* intr num */
675 Int eventId; /* event Id */
676 UArg arg; /* isrFxn arg */
677 Hwi.FuncPtr tickFxn; /* Timer fxn plugged into Hwi */
678 Types.FreqHz extFreq; /* ext freq */
679 Hwi.Handle hwi; /* hwi inst */
680 UInt prevThreshold; /* previous interrupt thresh */
681 UInt rollovers; /* total timer rollovers */
682 /*
683 * Used by Timer Startup to decide whether to use default Event Id
684 * from the device Table or use the User provided Event Id
685 */
686 Bool useDefaultEventId;
687 }
688
689 /*! Module state structure */
690 struct Module_State {
691 Bits32 availMask; /* avaliable 32-bit timer halves */
692 Types.FreqHz intFreqs[]; /* internal frequency in Hz */
693 TimerDevice device[]; /* timer device information */
694 Handle handles[]; /* handles based on logical id */
695 Bool firstInit;
696 }
697 }