RTEMS 7.0-rc1
Loading...
Searching...
No Matches
tm27.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0+-with-RTEMS-exception */
2
7/*
8 * The license and distribution terms for this file may be
9 * found in the file LICENSE in this distribution or at
10 * http://www.rtems.org/license/LICENSE.
11 */
12
13#ifndef _RTEMS_TMTEST27
14#error "This is an RTEMS internal file you must not include directly."
15#endif
16
17#ifndef __tm27_h
18#define __tm27_h
19
20/*
21 * Define the interrupt mechanism for Time Test 27
22 */
23
24#include <bsp/irq.h>
25
26#define MUST_WAIT_FOR_INTERRUPT 1
27
28#define Install_tm27_vector( handler ) \
29 rtems_interrupt_handler_install( \
30 TX3904_IRQ_TMR0, "benchmark", 0, \
31 handler, NULL );
32
33#define Cause_tm27_intr() \
34 do { \
35 uint32_t _clicks = 20; \
36 TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_CCDR, 0x3 ); \
37 TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_CPRA, _clicks ); \
38 TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_TISR, 0x00 ); \
39 TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_ITMR, 0x8001 ); \
40 TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_TCR, 0xC0 ); \
41 *((volatile uint32_t*) 0xFFFFC01C) = 0x00000700; \
42 } while(0)
43
44#define Clear_tm27_intr() \
45 do { \
46 TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_ITMR, 0x0001 ); \
47 TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_CCDR, 0x3 ); \
48 TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_TISR, 0x00 ); \
49 } while(0)
50
51#define Lower_tm27_intr() \
52 mips_enable_in_interrupt_mask( 0xff01 );
53
54#endif