File: intvects.c

package info (click to toggle)
simulavr 0.1.2.2-6.1
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 2,756 kB
  • ctags: 3,179
  • sloc: ansic: 19,987; sh: 3,623; python: 3,528; makefile: 406; asm: 308; yacc: 145; lex: 48
file content (478 lines) | stat: -rw-r--r-- 21,234 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
/*
 * $Id: intvects.c,v 1.17 2004/02/26 07:22:15 troth Exp $
 *
 ****************************************************************************
 *
 * simulavr - A simulator for the Atmel AVR family of microcontrollers.
 * Copyright (C) 2001, 2002, 2003, 2004  Theodore A. Roth
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 ****************************************************************************
 */

#include <config.h>

#include <stdio.h>
#include <stdlib.h>

#include "intvects.h"

/****************************************************************************\
 *
 * Interrupt Vector Tables:
 *
 *   Since each device could have a different set of available interrupts, the
 *   following tables map all interrupts to the addr to jump to when the
 *   interrupt happens. If the device doesn't support an interrupt, the table
 *   will contain a NULL entry. Only one table will be installed into the core
 *   for a given device.
 *
 \****************************************************************************/

/* *INDENT-OFF* */

/*
 * Vector Table for devices:
 *   at90s1200
 */
static IntVectTable vtab_at90s1200 = {
    .RESET          = { "IRQ_RESET",
                        0x00, 0x00, NO_BIT, NO_BIT },
    .INT0           = { "IRQ_INT0",
                        0x01, 0x00, { 0x5b, 1<<6 }, NO_BIT },
    .TIMER0_OVF     = { "IRQ_TIMER0_OVF",
                        0x02, 0x00, { 0x59, 1<<1 }, { 0x58, 1<<1 } },
    .ANA_COMP       = { "IRQ_ANA_COMP",
                        0x03, 0x00, { 0x28, 1<<3 }, { 0x28, 1<<4 } }
};

/*
 * Vector Table for devices:
 *   at90s2313
 */
static IntVectTable vtab_at90s2313 = {
    .RESET          = { "IRQ_RESET",
                        0x00, 0x00, NO_BIT, NO_BIT },
    .INT0           = { "IRQ_INT0",
                        0x01, 0x00, { 0x5b, 1<<6 }, { 0x5a, 1<<6 } },
    .INT1           = { "IRQ_INT1",
                        0x02, 0x00, { 0x5b, 1<<7 }, { 0x5a, 1<<7 } },
    .TIMER1_CAPT    = { "IRQ_TIMER1_CAPT",
                        0x03, 0x00, { 0x59, 1<<3 }, { 0x58, 1<<3 } },
    .TIMER1_COMPA   = { "IRQ_TIMER1_COMPA",
                        0x04, 0x00, { 0x59, 1<<6 }, { 0x58, 1<<6 } },
    .TIMER1_OVF     = { "IRQ_TIMER1_OVF",
                        0x05, 0x00, { 0x59, 1<<7 }, { 0x58, 1<<7 } },
    .TIMER0_OVF     = { "IRQ_TIMER0_OVF",
                        0x06, 0x00, { 0x59, 1<<1 }, { 0x58, 1<<1 } },
    .UART_RX        = { "IRQ_UART_RX",
                        0x07, 0x00, { 0x2a, 1<<7 }, { 0x2b, 1<<7 } },
    .UART_UDRE      = { "IRQ_UART_UDRE",
                        0x08, 0x00, { 0x2a, 1<<5 }, { 0x2b, 1<<5 } },
    .UART_TX        = { "IRQ_UART_TX",
                        0x09, 0x00, { 0x2a, 1<<6 }, { 0x2b, 1<<6 } },
    .ANA_COMP       = { "IRQ_ANA_COMP",
                        0x0a, 0x00, { 0x28, 1<<3 }, { 0x28, 1<<4 } }
};

/*
 * Vector Table for devices:
 *   at90s4414, at90s8515
 */
static IntVectTable vtab_at90s4414 = {
    .RESET          = { "IRQ_RESET",
                        0x00, 0x00, NO_BIT, NO_BIT },
    .INT0           = { "IRQ_INT0",
                        0x01, 0x00, { 0x5b, 1<<6 }, { 0x5a, 1<<6 } },
    .INT1           = { "IRQ_INT1",
                        0x02, 0x00, { 0x5b, 1<<7 }, { 0x5a, 1<<7 } },
    .TIMER1_CAPT    = { "IRQ_TIMER1_CAPT",
                        0x03, 0x00, { 0x59, 1<<3 }, { 0x58, 1<<3 } },
    .TIMER1_COMPA   = { "IRQ_TIMER1_COMPA",
                        0x04, 0x00, { 0x59, 1<<6 }, { 0x58, 1<<6 } },
    .TIMER1_COMPB   = { "IRQ_TIMER1_COMPB",
                        0x05, 0x00, { 0x59, 1<<5 }, { 0x58, 1<<5 } },
    .TIMER1_OVF     = { "IRQ_TIMER1_OVF",
                        0x06, 0x00, { 0x59, 1<<7 }, { 0x58, 1<<7 } },
    .TIMER0_OVF     = { "IRQ_TIMER0_OVF",
                        0x07, 0x00, { 0x59, 1<<1 }, { 0x58, 1<<1 } },
    .SPI_STC        = { "IRQ_SPI_STC",
                        0x08, 0x00, { 0x2d, 1<<7 }, NO_BIT },
    .UART_RX        = { "IRQ_UART_RX",
                        0x09, 0x00, { 0x2a, 1<<7 }, { 0x2b, 1<<7 } },
    .UART_UDRE      = { "IRQ_UART_UDRE",
                        0x0a, 0x00, { 0x2a, 1<<5 }, { 0x2b, 1<<5 } },
    .UART_TX        = { "IRQ_UART_TX",
                        0x0b, 0x00, { 0x2a, 1<<6 }, { 0x2b, 1<<6 } },
    .ANA_COMP       = { "IRQ_ANA_COMP",
                        0x0c, 0x00, { 0x28, 1<<3 }, { 0x28, 1<<4 } }
};

/*
 * Vector Table for devices:
 *   atmega8
 */

static IntVectTable vtab_atmega8 = {
    .RESET          = { "IRQ_RESET",
                        0x00, 0x00, NO_BIT, NO_BIT },
    .INT0           = { "IRQ_INT0",
                        0x01, 0x00, { 0x5b, 1<<6 }, { 0x5a, 1<<6 } },
    .INT1           = { "IRQ_INT1",
                        0x02, 0x00, { 0x5b, 1<<7 }, { 0x5a, 1<<7 } },
    .TIMER2_COMP    = { "IRQ_TIMER2_COMP",
                        0x03, 0x00, { 0x59, 1<<7 }, { 0x58, 1<<7 } },
    .TIMER2_OVF     = { "IRQ_TIMER2_OVF",
                        0x04, 0x00, { 0x59, 1<<6 }, { 0x58, 1<<6 } },
    .TIMER1_CAPT    = { "IRQ_TIMER1_CAPT",
                        0x05, 0x00, { 0x59, 1<<5 }, { 0x58, 1<<5 } },
    .TIMER1_COMPA   = { "IRQ_TIMER1_COMPA",
                        0x06, 0x00, { 0x59, 1<<4 }, { 0x58, 1<<4 } },
    .TIMER1_COMPB   = { "IRQ_TIMER1_COMPB",
                        0x07, 0x00, { 0x59, 1<<3 }, { 0x58, 1<<3 } },
    .TIMER1_OVF     = { "IRQ_TIMER1_OVF",
                        0x08, 0x00, { 0x59, 1<<2 }, { 0x58, 1<<2 } },
    .TIMER0_OVF     = { "IRQ_TIMER0_OVF",
                        0x09, 0x00,	{ 0x59, 1<<0 }, { 0x58, 1<<0 } },
    .SPI_STC        = { "IRQ_SPI_STC",
                        0x0a, 0x00, { 0x2d, 1<<7 }, NO_BIT },
    .UART_RX        = { "IRQ_UART_RX",
                        0x0b, 0x00,	{ 0x2a, 1<<7 }, { 0x2b, 1<<7 } },
    .UART_UDRE      = { "IRQ_UART_UDRE",
                        0x0c, 0x00, { 0x2a, 1<<5 }, { 0x2b, 1<<5 } },
    .UART_TX        = { "IRQ_UART_TX",
                        0x0d, 0x00, { 0x2a, 1<<6 }, { 0x2b, 1<<6 } },
    .ADC            = { "IRQ_ADC",
                        0x0e, 0x00,	{ 0x26, 1<<3 }, { 0x26, 1<<4 } },
    .EE_READY       = { "IRQ_EE_READY",
                        0x0f, 0x00,	{ 0x3c, 1<<3 }, NO_BIT },
    .ANA_COMP       = { "IRQ_ANA_COMP",
                        0x10, 0x00,	{ 0x28, 1<<3 }, { 0x28, 1<<4 } },
    .TWI            = { "IRQ_TWI",
                        0x11, 0x00, { 0x56, 1<<0 }, { 0x56, 1<<7 } },
    .SPM_READY      = { "IRQ_SPM_READY",
                        0x12, 0x00, { 0x57, 1<<7 }, NO_BIT }
};



/*
 * Vector Table for devices:
 *   atmega16
 */

static IntVectTable vtab_atmega16 = {
    .RESET          = { "IRQ_RESET",
                        0x00, 0x00, NO_BIT, NO_BIT },
    .INT0           = { "IRQ_INT0",
                        0x02, 0x00, { 0x5b, 1<<6 }, { 0x5a, 1<<6 } },
    .INT1           = { "IRQ_INT1",
                        0x04, 0x00, { 0x5b, 1<<7 }, { 0x5a, 1<<7 } },
    .TIMER2_COMP    = { "IRQ_TIMER2_COMP",
                        0x06, 0x00, { 0x59, 1<<7 }, { 0x58, 1<<7 } },
    .TIMER2_OVF     = { "IRQ_TIMER2_OVF",
                        0x08, 0x00, { 0x59, 1<<6 }, { 0x58, 1<<6 } },
    .TIMER1_CAPT    = { "IRQ_TIMER1_CAPT",
                        0x0a, 0x00, { 0x59, 1<<5 }, { 0x58, 1<<5 } },
    .TIMER1_COMPA   = { "IRQ_TIMER1_COMPA",
                        0x0c, 0x00, { 0x59, 1<<4 }, { 0x58, 1<<4 } },
    .TIMER1_COMPB   = { "IRQ_TIMER1_COMPB",
                        0x0e, 0x00, { 0x59, 1<<3 }, { 0x58, 1<<3 } },
    .TIMER1_OVF     = { "IRQ_TIMER1_OVF",
                        0x10, 0x00, { 0x59, 1<<2 }, { 0x58, 1<<2 } },
    .TIMER0_OVF     = { "IRQ_TIMER0_OVF",
                        0x12, 0x00, { 0x59, 1<<0 }, { 0x58, 1<<0 } },
    .SPI_STC        = { "IRQ_SPI_STC",
                        0x14, 0x00, { 0x2d, 1<<7 }, NO_BIT },
    .UART_RX        = { "IRQ_UART_RX",
                        0x16, 0x00, { 0x2a, 1<<7 }, { 0x2b, 1<<7 } },
    .UART_UDRE      = { "IRQ_UART_UDRE",
                        0x18, 0x00, { 0x2a, 1<<5 }, { 0x2b, 1<<5 } },
    .UART_TX        = { "IRQ_UART_TX",
                        0x1a, 0x00, { 0x2a, 1<<6 }, { 0x2b, 1<<6 } },
    .ADC            = { "IRQ_ADC",
                        0x1c, 0x00, { 0x26, 1<<3 }, { 0x26, 1<<4 } },
    .EE_READY       = { "IRQ_EE_READY",
                        0x1e, 0x00, { 0x3c, 1<<3 }, NO_BIT },
    .ANA_COMP       = { "IRQ_ANA_COMP",
                        0x20, 0x00, { 0x28, 1<<3 }, { 0x28, 1<<4 } },
    .TWI            = { "IRQ_TWI",
                        0x22, 0x00, { 0x57, 1<<0 }, { 0x56, 1<<7 } },
    .INT2           = { "IRQ_INT2",
                        0x24, 0x00, { 0x5b, 1<<5 }, { 0x5a, 1<<5 } },
    .TIMER0_COMP    = { "IRQ_TIMER0_COMP",
                        0x26, 0x00, { 0x59, 1<<1 }, { 0x58, 1<<1 } },
    .SPM_READY      = { "IRQ_SPM_READY",
                        0x28, 0x00, { 0x57, 1<<7 }, NO_BIT }
};


/*
 * Vector Table for devices:
 *   atmega103
 */

static IntVectTable vtab_atmega103 = {
    .RESET          = { "IRQ_RESET",
                        0x00, 0x00, NO_BIT, NO_BIT },
    .INT0           = { "IRQ_INT0",
                        0x02, 0x00, { 0x59, 1<<0 }, NO_BIT },
    .INT1           = { "IRQ_INT1",
                        0x04, 0x00, { 0x59, 1<<1 }, NO_BIT },
    .INT2           = { "IRQ_INT2",
                        0x06, 0x00, { 0x59, 1<<2 }, NO_BIT },
    .INT3           = { "IRQ_INT3",
                        0x08, 0x00, { 0x59, 1<<3 }, NO_BIT },
    .INT4           = { "IRQ_INT4",
                        0x0a, 0x00, { 0x59, 1<<4 }, { 0x58, 1<<4 } },
    .INT5           = { "IRQ_INT5",
                        0x0c, 0x00, { 0x59, 1<<5 }, { 0x58, 1<<5 } },
    .INT6           = { "IRQ_INT6",
                        0x0e, 0x00, { 0x59, 1<<6 }, { 0x58, 1<<6 } },
    .INT7           = { "IRQ_INT7",
                        0x10, 0x00, { 0x59, 1<<7 }, { 0x58, 1<<7 } },
    .TIMER2_COMP    = { "IRQ_TIMER2_COMP",
                        0x12, 0x00, { 0x57, 1<<7 }, { 0x56, 1<<7 } },
    .TIMER2_OVF     = { "IRQ_TIMER2_OVF",
                        0x14, 0x00, { 0x57, 1<<6 }, { 0x56, 1<<6 } },
    .TIMER1_CAPT    = { "IRQ_TIMER1_CAPT",
                        0x16, 0x00, { 0x57, 1<<5 }, { 0x56, 1<<5 } },
    .TIMER1_COMPA   = { "IRQ_TIMER1_COMPA",
                        0x18, 0x00, { 0x57, 1<<4 }, { 0x56, 1<<4 } },
    .TIMER1_COMPB   = { "IRQ_TIMER1_COMPB",
                        0x1a, 0x00, { 0x57, 1<<3 }, { 0x56, 1<<3 } },
    .TIMER1_OVF     = { "IRQ_TIMER1_OVF",
                        0x1c, 0x00, { 0x57, 1<<2 }, { 0x56, 1<<2 } },
    .TIMER0_COMP    = { "IRQ_TIMER0_COMP",
                        0x1e, 0x00, { 0x57, 1<<1 }, { 0x56, 1<<1 } },
    .TIMER0_OVF     = { "IRQ_TIMER0_OVF",
                        0x20, 0x00, { 0x57, 1<<0 }, { 0x56, 1<<0 } },
    .SPI_STC        = { "IRQ_SPI_STC",
                        0x22, 0x00, { 0x2d, 1<<7 }, NO_BIT },
    .UART_RX        = { "IRQ_UART_RX",
                        0x24, 0x00, { 0x2a, 1<<7 }, { 0x2b, 1<<7 } },
    .UART_UDRE      = { "IRQ_UART_UDRE",
                        0x26, 0x00, { 0x2a, 1<<5 }, { 0x2b, 1<<5 } },
    .UART_TX        = { "IRQ_UART_TX",
                        0x28, 0x00, { 0x2a, 1<<6 }, { 0x2b, 1<<6 } },
    .ADC            = { "IRQ_ADC",
                        0x2a, 0x00, { 0x26, 1<<3 }, { 0x26, 1<<4 } },
    .ANA_COMP       = { "IRQ_ANA_COMP",
                        0x2e, 0x00, { 0x28, 1<<3 }, { 0x28, 1<<4 } },
    .EE_READY       = { "IRQ_EE_READY",
                        0x2c, 0x00, { 0x3c, 1<<3 }, NO_BIT }
};

/*
 * Vector Table for devices:
 *   atmega128
 */

/* Note that the mega128 has BOOTRST and IVSEL fuses which can be used to
   change the interrupt vectors. If used, the new vectors are just the
   following plus some Boot Reset Address. This could be implemented just as
   we vector to handler. */

/* Note that the vectors address for mega128 are two insn's. This is needed
   since they can use jmp (32-bit) insn at the vector address. */

static IntVectTable vtab_atmega128 = {
    .RESET          = { "IRQ_RESET",
                        0x00, 0x00, NO_BIT, NO_BIT },
    .INT0           = { "IRQ_INT0",
                        0x02, 0x00, { 0x59, 1<<7 }, { 0x58, 1<<7 } },
    .INT1           = { "IRQ_INT1",
                        0x04, 0x00, { 0x59, 1<<6 }, { 0x58, 1<<6 } },
    .INT2           = { "IRQ_INT2",
                        0x06, 0x00, { 0x59, 1<<5 }, { 0x58, 1<<5 } },
    .INT3           = { "IRQ_INT3",
                        0x08, 0x00, { 0x59, 1<<4 }, { 0x58, 1<<4 } },
    .INT4           = { "IRQ_INT4",
                        0x0a, 0x00, { 0x59, 1<<3 }, { 0x58, 1<<3 } },
    .INT5           = { "IRQ_INT5",
                        0x0c, 0x00, { 0x59, 1<<2 }, { 0x58, 1<<2 } },
    .INT6           = { "IRQ_INT6",
                        0x0e, 0x00, { 0x59, 1<<1 }, { 0x58, 1<<1 } },
    .INT7           = { "IRQ_INT7",
                        0x10, 0x00, { 0x59, 1<<0 }, { 0x58, 1<<0 } },
    .TIMER2_COMP    = { "IRQ_TIMER2_COMP",
                        0x12, 0x00, { 0x57, 1<<7 }, { 0x56, 1<<7 } },
    .TIMER2_OVF     = { "IRQ_TIMER2_OVF",
                        0x14, 0x00, { 0x57, 1<<6 }, { 0x56, 1<<6 } },
    .TIMER1_CAPT    = { "IRQ_TIMER1_CAPT",
                        0x16, 0x00, { 0x57, 1<<5 }, { 0x56, 1<<5 } },
    .TIMER1_COMPA   = { "IRQ_TIMER1_COMPA",
                        0x18, 0x00, { 0x57, 1<<4 }, { 0x56, 1<<4 } },
    .TIMER1_COMPB   = { "IRQ_TIMER1_COMPB",
                        0x1a, 0x00, { 0x57, 1<<3 }, { 0x56, 1<<3 } },
    .TIMER1_OVF     = { "IRQ_TIMER1_OVF",
                        0x1c, 0x00, { 0x57, 1<<2 }, { 0x56, 1<<2 } },
    .TIMER0_COMP    = { "IRQ_TIMER0_COMP",
                        0x1e, 0x00, { 0x57, 1<<1 }, { 0x56, 1<<1 } },
    .TIMER0_OVF     = { "IRQ_TIMER0_OVF",
                        0x20, 0x00, { 0x57, 1<<0 }, { 0x56, 1<<0 } },
    .SPI_STC        = { "IRQ_SPI_STC",
                        0x22, 0x00, { 0x2d, 1<<7 }, NO_BIT },
    .USART0_RX      = { "IRQ_USART0_RX",
                        0x24, 0x00, { 0x2a, 1<<7 }, { 0x2b, 1<<7 } },
    .USART0_UDRE    = { "IRQ_USART0_UDRE",
                        0x26, 0x00, { 0x2a, 1<<5 }, { 0x2b, 1<<5 } },
    .USART0_TX      = { "IRQ_USART0_TX",
                        0x28, 0x00, { 0x2a, 1<<6 }, { 0x2b, 1<<6 } },
    .ADC            = { "IRQ_ADC",
                        0x2a, 0x00, { 0x26, 1<<3 }, { 0x26, 1<<4 } },
    .EE_READY       = { "IRQ_EE_READY",
                        0x2c, 0x00, { 0x3c, 1<<3 }, NO_BIT },
    .ANA_COMP       = { "IRQ_ANA_COMP",
                        0x2e, 0x00, { 0x28, 1<<3 }, { 0x28, 1<<4 } },
    .TIMER1_COMPC   = { "IRQ_TIMER1_COMPC",
                        0x30, 0x00, { 0x7d, 1<<0 }, { 0x7c, 1<<0 } },
    .TIMER3_CAPT    = { "IRQ_TIMER3_CAPT",
                        0x32, 0x00, { 0x7d, 1<<5 }, { 0x7c, 1<<5 } },
    .TIMER3_COMPA   = { "IRQ_TIMER3_COMPA",
                        0x34, 0x00, { 0x7d, 1<<4 }, { 0x7c, 1<<4 } },
    .TIMER3_COMPB   = { "IRQ_TIMER3_COMPB",
                        0x36, 0x00, { 0x7d, 1<<3 }, { 0x7c, 1<<3 } },
    .TIMER3_COMPC   = { "IRQ_TIMER3_COMPC",
                        0x38, 0x00, { 0x7d, 1<<1 }, { 0x7c, 1<<1 } },
    .TIMER3_OVF     = { "IRQ_TIMER3_OVF",
                        0x3a, 0x00, { 0x7d, 1<<2 }, { 0x7c, 1<<2 } },
    .USART1_RX      = { "IRQ_USART1_RX",
                        0x3c, 0x00, { 0x9a, 1<<7 }, { 0x9b, 1<<7 } },
    .USART1_UDRE    = { "IRQ_USART1_UDRE",
                        0x3e, 0x00, { 0x9a, 1<<5 }, { 0x9b, 1<<5 } },
    .USART1_TX      = { "IRQ_USART1_TX",
                        0x40, 0x00, { 0x9a, 1<<6 }, { 0x9b, 1<<6 } },
    .TWI            = { "IRQ_TWI",
                        0x42, 0x00, { 0x74, 1<<0 }, { 0x74, 1<<7 } },
    .SPM_READY      = { "IRQ_SPM_READY",
                        0x44, 0x00, { 0x68, 1<<7 }, NO_BIT }
};

/* supports 355, 353, 351
   NOTE: The vector addresses are not sequential. */
static IntVectTable vtab_at43usb355 = {
    .RESET          = { "IRQ_RESET",
                        0x00, 0x00, NO_BIT, NO_BIT },
    .INT0           = { "IRQ_INT0",
                        0x02, 0x00, { 0x5b, 1<<6 }, { 0x5a, 1<<6 } },
    .INT1           = { "IRQ_INT1",
                        0x04, 0x00, { 0x5b, 1<<7 }, { 0x5a, 1<<7 } },
    .TIMER1_CAPT    = { "IRQ_TIMER1_CAPT",
                        0x06, 0x00, { 0x59, 1<<3 }, { 0x58, 1<<3 } },
    .TIMER1_COMPA   = { "IRQ_TIMER1_COMPA",
                        0x08, 0x00, { 0x59, 1<<6 }, { 0x58, 1<<6 } },
    .TIMER1_COMPB   = { "IRQ_TIMER1_COMPB",
                        0x0a, 0x00, { 0x59, 1<<5 }, { 0x58, 1<<5 } },
    .TIMER1_OVF     = { "IRQ_TIMER1_OVF",
                        0x0c, 0x00, { 0x59, 1<<7 }, { 0x58, 1<<7 } },
    .TIMER0_OVF     = { "IRQ_TIMER0_OVF",
                        0x0e, 0x00, { 0x59, 1<<1 }, { 0x58, 1<<1 } },
    .SPI_STC        = { "IRQ_SPI_STC",
                        0x10, 0x00, { 0x2d, 1<<7 }, NO_BIT },
    .ADC            = { "IRQ_ADC",
                        0x16, 0x00, { 0x27, 1<<3 }, { 0x27, 1<<4 } },
    .USB_HW         = { "IRQ_USB_HW",
                        0x18, 0x00, NO_BIT, NO_BIT } /* TODO */
};

/* supports 320 */
static IntVectTable vtab_at43usb320 = {
    .RESET          = { "IRQ_RESET",
                        0x00, 0x00, NO_BIT, NO_BIT },
    .INT0           = { "IRQ_INT0",
                        0x02, 0x00, { 0x5b, 1<<6 }, { 0x5a, 1<<6 } },
    .INT1           = { "IRQ_INT1",
                        0x04, 0x00, { 0x5b, 1<<7 }, { 0x5a, 1<<7 } },
    .TIMER1_CAPT    = { "IRQ_TIMER1_CAPT",
                        0x06, 0x00, { 0x59, 1<<3 }, { 0x58, 1<<3 } },
    .TIMER1_COMPA   = { "IRQ_TIMER1_COMPA",
                        0x08, 0x00, { 0x59, 1<<6 }, { 0x58, 1<<6 } },
    .TIMER1_COMPB   = { "IRQ_TIMER1_COMPB",
                        0x0a, 0x00, { 0x59, 1<<5 }, { 0x58, 1<<5 } },
    .TIMER1_OVF     = { "IRQ_TIMER1_OVF",
                        0x0c, 0x00, { 0x59, 1<<7 }, { 0x58, 1<<7 } },
    .TIMER0_OVF     = { "IRQ_TIMER0_OVF",
                        0x0e, 0x00, { 0x59, 1<<1 }, { 0x58, 1<<1 } },
    .SPI_STC        = { "IRQ_SPI_STC",
                        0x10, 0x00, { 0x2d, 1<<7 }, NO_BIT },
    .UART_RX        = { "IRQ_UART_RX",
                        0x12, 0x00, { 0x2a, 1<<7 }, { 0x2b, 1<<7 } },
    .UART_UDRE      = { "IRQ_UART_UDRE",
                        0x14, 0x00, { 0x2a, 1<<5 }, { 0x2b, 1<<5 } },
    .UART_TX        = { "IRQ_UART_TX",
                        0x16, 0x00, { 0x2a, 1<<6 }, { 0x2b, 1<<6 } },
    .USB_HW         = { "IRQ_USB",
                        0x18, 0x00, NO_BIT, NO_BIT } /* TODO */
};

/* supports 325
   NOTE: The vector addresses are not sequential. */
static IntVectTable vtab_at43usb325 = {
    .RESET          = { "IRQ_RESET",
                        0x00, 0x00, NO_BIT, NO_BIT },
    .INT0           = { "IRQ_INT0",
                        0x02, 0x00, { 0x5b, 1<<6 }, { 0x5a, 1<<6 } },
    .INT1           = { "IRQ_INT1",
                        0x04, 0x00, { 0x5b, 1<<7 }, { 0x5a, 1<<7 } },
    .TIMER1_CAPT    = { "IRQ_TIMER1_CAPT",
                        0x06, 0x00, { 0x59, 1<<3 }, { 0x58, 1<<3 } },
    .TIMER1_COMPA   = { "IRQ_TIMER1_COMPA",
                        0x08, 0x00, { 0x59, 1<<6 }, { 0x58, 1<<6 } },
    .TIMER1_COMPB   = { "IRQ_TIMER1_COMPB",
                        0x0a, 0x00, { 0x59, 1<<5 }, { 0x58, 1<<5 } },
    .TIMER1_OVF     = { "IRQ_TIMER1_OVF",
                        0x0c, 0x00, { 0x59, 1<<7 }, { 0x58, 1<<7 } },
    .TIMER0_OVF     = { "IRQ_TIMER0_OVF",
                        0x0e, 0x00, { 0x59, 1<<1 }, { 0x58, 1<<1 } },
    .USB_HW         = { "IRQ_USB_HW",
                        0x18, 0x00, NO_BIT, NO_BIT } /* TODO */
};

/* supports 326
   NOTE: The vector addresses are not sequential. */
static IntVectTable vtab_at43usb326 = {
    .RESET          = { "IRQ_RESET",
                        0x00, 0x00, NO_BIT, NO_BIT },
    .INT0           = { "IRQ_INT0",
                        0x02, 0x00, { 0x5b, 1<<6 }, { 0x5a, 1<<6 } },
    .TIMER0_OVF     = { "IRQ_TIMER0_OVF",
                        0x0e, 0x00, { 0x59, 1<<1 }, { 0x58, 1<<1 } },
    .USB_HW         = { "IRQ_USB_HW",
                        0x18, 0x00, NO_BIT, NO_BIT } /* TODO */
};

/* *INDENT-ON* */

/*
 * Vector Table Lookup List.
 *
 * Maps a _vector_table_name to a device vector table.
 */
IntVectTable *global_vtable_list[] = {
    &vtab_at90s1200,
    &vtab_at90s2313,
    &vtab_at90s4414,
    &vtab_atmega8,
    &vtab_atmega16,
    &vtab_atmega103,
    &vtab_atmega128,
    &vtab_at43usb355,
    &vtab_at43usb320,
    &vtab_at43usb325,
    &vtab_at43usb326,
    NULL
};