annotate packages/kernel/current/tests/intr0.cxx @ 2979:00ddfb443539

* tests/intr0.cxx (intr0_main): Fix a compiler warning by changing a CHECK() statement.
author sergeig
date Wed, 24 Nov 2010 18:40:20 +0000
parents 74dbf4c3f2e1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
1 //=================================================================
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
2 //
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
3 // intr0.cxx
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
4 //
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
5 // Interrupt test 0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
6 //
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
7 //=================================================================
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
8 // ####ECOSGPLCOPYRIGHTBEGIN####
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
9 // -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
10 // This file is part of eCos, the Embedded Configurable Operating System.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
11 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 182
diff changeset
12 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
13 // eCos is free software; you can redistribute it and/or modify it under
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
14 // the terms of the GNU General Public License as published by the Free
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
15 // Software Foundation; either version 2 or (at your option) any later
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
16 // version.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 182
diff changeset
17 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
18 // eCos is distributed in the hope that it will be useful, but WITHOUT
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
19 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
20 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
21 // for more details.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 182
diff changeset
22 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
23 // You should have received a copy of the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
24 // along with eCos; if not, write to the Free Software Foundation, Inc.,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
25 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 182
diff changeset
26 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
27 // As a special exception, if other files instantiate templates or use
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
28 // macros or inline functions from this file, or you compile this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
29 // and link it with other works to produce a work based on this file,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
30 // this file does not by itself cause the resulting work to be covered by
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
31 // the GNU General Public License. However the source code for this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
32 // must still be made available in accordance with section (3) of the GNU
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
33 // General Public License v2.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 182
diff changeset
34 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
35 // This exception does not invalidate any other reasons why a work based
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
36 // on this file might be covered by the GNU General Public License.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
37 // -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2432
diff changeset
38 // ####ECOSGPLCOPYRIGHTEND####
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
39 //=================================================================
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
40 //#####DESCRIPTIONBEGIN####
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
41 //
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
42 // Author(s): dsm
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
43 // Contributors: dsm, jlarmour
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
44 // Date: 1999-02-16
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
45 // Description: Very basic test of interrupt objects
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
46 // Options:
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
47 // CYGIMP_KERNEL_INTERRUPTS_DSRS_TABLE
2266
13625e7b9d1f Implement FIFO variant of scheduling of DSRs and make it the
nickg
parents: 210
diff changeset
48 // CYGNUM_KERNEL_INTERRUPTS_DSRS_TABLE_SIZE
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
49 // CYGIMP_KERNEL_INTERRUPTS_DSRS_LIST
2266
13625e7b9d1f Implement FIFO variant of scheduling of DSRs and make it the
nickg
parents: 210
diff changeset
50 // CYGSEM_KERNEL_INTERRUPTS_DSRS_LIST_FIFO
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
51 //####DESCRIPTIONEND####
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
52
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
53 #include <pkgconf/kernel.h>
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
54
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
55 #include <cyg/kernel/intr.hxx>
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
56 #include <cyg/hal/hal_intr.h>
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
57
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
58 #include <cyg/infra/testcase.h>
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
59
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
60 #include "testaux.hxx"
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
61
2432
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
62 #ifdef HAL_INTR_TEST_PRIO_A
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
63 # define PRIO_A HAL_INTR_TEST_PRIO_A
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
64 #else
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
65 # define PRIO_A 0
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
66 #endif
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
67
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
68 #ifdef HAL_INTR_TEST_PRIO_B
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
69 # define PRIO_B HAL_INTR_TEST_PRIO_B
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
70 #else
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
71 # define PRIO_B 1
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
72 #endif
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
73
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
74 #ifdef HAL_INTR_TEST_PRIO_C
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
75 # define PRIO_C HAL_INTR_TEST_PRIO_C
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
76 #else
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
77 # define PRIO_C 1
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
78 #endif
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
79
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
80 static cyg_ISR isr0, isr1;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
81 static cyg_DSR dsr0, dsr1;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
82
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
83 static char intr0_obj[sizeof(Cyg_Interrupt)];
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
84 static char intr1_obj[sizeof(Cyg_Interrupt)];
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
85
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
86 static cyg_uint32 isr0(cyg_vector vector, CYG_ADDRWORD data)
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
87 {
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
88 CYG_UNUSED_PARAM(CYG_ADDRWORD, data);
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
89
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
90 Cyg_Interrupt::acknowledge_interrupt(vector);
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
91 return 0;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
92 }
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
93
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
94 static void dsr0(cyg_vector vector, cyg_ucount32 count, CYG_ADDRWORD data)
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
95 {
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
96 CYG_UNUSED_PARAM(cyg_vector, vector);
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
97 CYG_UNUSED_PARAM(cyg_ucount32, count);
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
98 CYG_UNUSED_PARAM(CYG_ADDRWORD, data);
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
99 }
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
100
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
101 static cyg_uint32 isr1(cyg_vector vector, CYG_ADDRWORD data)
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
102 {
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
103 CYG_UNUSED_PARAM(cyg_vector, vector);
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
104 CYG_UNUSED_PARAM(CYG_ADDRWORD, data);
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
105 return 0;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
106 }
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
107
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
108 static void dsr1(cyg_vector vector, cyg_ucount32 count, CYG_ADDRWORD data)
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
109 {
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
110 CYG_UNUSED_PARAM(cyg_vector, vector);
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
111 CYG_UNUSED_PARAM(cyg_ucount32, count);
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
112 CYG_UNUSED_PARAM(CYG_ADDRWORD, data);
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
113 }
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
114
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
115 static bool flash( void )
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
116 {
2432
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
117 Cyg_Interrupt intr0 = Cyg_Interrupt(CYGNUM_HAL_ISR_MIN, PRIO_A,
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
118 (CYG_ADDRWORD)333, isr0, dsr0 );
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
119
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
120 return true;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
121 }
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
122
34
29bc183297e1 Merge from eCos master repository on 1999-09-02-16:26:10-BST
jlarmour
parents: 10
diff changeset
123 /* IMPORTANT: The calling convention for VSRs is target dependent. It is
29bc183297e1 Merge from eCos master repository on 1999-09-02-16:26:10-BST
jlarmour
parents: 10
diff changeset
124 * unlikely that a plain C or C++ routine would function correctly on any
29bc183297e1 Merge from eCos master repository on 1999-09-02-16:26:10-BST
jlarmour
parents: 10
diff changeset
125 * particular platform, even if it could correctly access the system
29bc183297e1 Merge from eCos master repository on 1999-09-02-16:26:10-BST
jlarmour
parents: 10
diff changeset
126 * resources necessary to handle the event that caused it to be called.
29bc183297e1 Merge from eCos master repository on 1999-09-02-16:26:10-BST
jlarmour
parents: 10
diff changeset
127 * VSRs usually must be written in assembly language.
29bc183297e1 Merge from eCos master repository on 1999-09-02-16:26:10-BST
jlarmour
parents: 10
diff changeset
128 *
29bc183297e1 Merge from eCos master repository on 1999-09-02-16:26:10-BST
jlarmour
parents: 10
diff changeset
129 * This is just a test program. The routine vsr0() below is defined simply
29bc183297e1 Merge from eCos master repository on 1999-09-02-16:26:10-BST
jlarmour
parents: 10
diff changeset
130 * to define an address that will be in executable memory. If an event
29bc183297e1 Merge from eCos master repository on 1999-09-02-16:26:10-BST
jlarmour
parents: 10
diff changeset
131 * causes this VSR to be called, all bets are off. If it is accidentally
29bc183297e1 Merge from eCos master repository on 1999-09-02-16:26:10-BST
jlarmour
parents: 10
diff changeset
132 * installed in the vector for the realtime clock, the system will likely
29bc183297e1 Merge from eCos master repository on 1999-09-02-16:26:10-BST
jlarmour
parents: 10
diff changeset
133 * freeze.
29bc183297e1 Merge from eCos master repository on 1999-09-02-16:26:10-BST
jlarmour
parents: 10
diff changeset
134 */
29bc183297e1 Merge from eCos master repository on 1999-09-02-16:26:10-BST
jlarmour
parents: 10
diff changeset
135
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
136 static cyg_VSR vsr0;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
137
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
138 static void vsr0()
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
139 {
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
140 }
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
141
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
142 void intr0_main( void )
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
143 {
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
144 CYG_TEST_INIT();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
145
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
146 CHECK(flash());
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
147 CHECK(flash());
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
148
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
149 // Make sure the chosen levels are not already in use.
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
150 int in_use;
161
ac086aa3217e Merge from eCos master repository on 2001-06-08-21:11:51-BST
jlarmour
parents: 130
diff changeset
151 cyg_vector lvl1 = CYGNUM_HAL_ISR_MIN + (1 % CYGNUM_HAL_ISR_COUNT);
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
152 HAL_INTERRUPT_IN_USE( lvl1, in_use );
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
153 Cyg_Interrupt* intr0 = NULL;
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
154 if (!in_use)
2432
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
155 intr0 = new((void *)&intr0_obj[0]) Cyg_Interrupt( lvl1, PRIO_B, (CYG_ADDRWORD)777, isr0, dsr0 );
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
156
161
ac086aa3217e Merge from eCos master repository on 2001-06-08-21:11:51-BST
jlarmour
parents: 130
diff changeset
157 cyg_vector lvl2 = CYGNUM_HAL_ISR_MIN + ( 15 % CYGNUM_HAL_ISR_COUNT);
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
158 HAL_INTERRUPT_IN_USE( lvl2, in_use );
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
159 Cyg_Interrupt* intr1 = NULL;
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
160 if (!in_use && lvl1 != lvl2)
2432
a18d24f79bca * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer,
asl
parents: 2266
diff changeset
161 intr1 = new((void *)&intr1_obj[0]) Cyg_Interrupt( lvl2, PRIO_C, 888, isr1, dsr1 );
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
162
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
163 // Check these functions at least exist
182
f62680ef1804 Merge from eCos master repository on 2001-09-07-06:43:02-BST
jlarmour
parents: 161
diff changeset
164 Cyg_Interrupt::disable_interrupts();
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
165 Cyg_Interrupt::enable_interrupts();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
166
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
167 if (intr0)
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
168 intr0->attach();
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
169 if (intr1)
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
170 intr1->attach();
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
171 if (intr0)
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
172 intr0->detach();
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
173 if (intr1)
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
174 intr1->detach();
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
175
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
176 // If this attaching interrupt replaces the previous interrupt
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
177 // instead of adding to it we could be in a big mess if the
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
178 // vector is being used by something important.
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
179
86
6512add4f5d6 Merge from eCos master repository on 2000-05-05-07:47:05-BST
jlarmour
parents: 66
diff changeset
180 cyg_vector v = (CYGNUM_HAL_VSR_MIN + 11) % CYGNUM_HAL_VSR_COUNT;
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
181 cyg_VSR *old_vsr, *new_vsr;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
182 Cyg_Interrupt::set_vsr( v, vsr0, &old_vsr );
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
183 Cyg_Interrupt::get_vsr( v, &new_vsr );
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
184 CHECK( vsr0 == new_vsr );
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
185
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
186 new_vsr = NULL;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
187 Cyg_Interrupt::set_vsr( v, old_vsr, &new_vsr );
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
188 CHECK( new_vsr == vsr0 );
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
189
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
190 Cyg_Interrupt::set_vsr( v, new_vsr );
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
191 new_vsr = NULL;
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
192 Cyg_Interrupt::get_vsr( v, &new_vsr );
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
193 CHECK( vsr0 == new_vsr );
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
194
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
195 Cyg_Interrupt::set_vsr( v, old_vsr );
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
196 CHECK( vsr0 == new_vsr );
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
197 new_vsr = NULL;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
198 Cyg_Interrupt::get_vsr( v, &new_vsr );
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
199 CHECK( old_vsr == new_vsr );
2979
00ddfb443539 * tests/intr0.cxx (intr0_main): Fix a compiler warning by changing
sergeig
parents: 2729
diff changeset
200
00ddfb443539 * tests/intr0.cxx (intr0_main): Fix a compiler warning by changing
sergeig
parents: 2729
diff changeset
201 CHECK( NULL != new_vsr);
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
202
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
203 cyg_vector v1;
10
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
204 #ifdef CYGPKG_HAL_MIPS_TX39
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
205 // This can be removed when PR 17831 is fixed
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
206 if ( cyg_test_is_simulator )
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
207 v1 = 12 % CYGNUM_HAL_ISR_COUNT;
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
208 else /* NOTE TRAILING ELSE... */
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
209 #endif
161
ac086aa3217e Merge from eCos master repository on 2001-06-08-21:11:51-BST
jlarmour
parents: 130
diff changeset
210 v1 = CYGNUM_HAL_ISR_MIN + (6 % CYGNUM_HAL_ISR_COUNT);
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
211
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
212 Cyg_Interrupt::mask_interrupt(v1);
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
213 Cyg_Interrupt::unmask_interrupt(v1);
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
214
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
215 Cyg_Interrupt::configure_interrupt(v1, true, true);
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
216
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
217 CYG_TEST_PASS_FINISH("Intr 0 OK");
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
218 }
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
219
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
220 externC void
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
221 cyg_start( void )
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
222 {
130
eb9fd8c04db3 Merge from eCos master repository on 2000-10-23-17:01:37-BST
jlarmour
parents: 86
diff changeset
223 #ifdef CYGSEM_HAL_STOP_CONSTRUCTORS_ON_FLAG
eb9fd8c04db3 Merge from eCos master repository on 2000-10-23-17:01:37-BST
jlarmour
parents: 86
diff changeset
224 cyg_hal_invoke_constructors();
eb9fd8c04db3 Merge from eCos master repository on 2000-10-23-17:01:37-BST
jlarmour
parents: 86
diff changeset
225 #endif
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
226 intr0_main();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
227 }
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
228 // EOF intr0.cxx