summaryrefslogtreecommitdiffstats
path: root/src/VBox/Devices/PC/BIOS/pirq.inc
blob: 49f0bdbacd4022a7ab3438e979a9d9671a463a83 (plain)
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
479
480
481
482
483
484
485
486
487
; $Id: pirq.inc $
;; @file
; ???
;

;
; Copyright (C) 2006-2023 Oracle and/or its affiliates.
;
; This file is part of VirtualBox base platform packages, as
; available from https://www.virtualbox.org.
;
; 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, in version 3 of the
; License.
;
; 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, see <https://www.gnu.org/licenses>.
;
; SPDX-License-Identifier: GPL-3.0-only
; --------------------------------------------------------------------
;
; This code is based on:
;
;  ROM BIOS for use with Bochs/Plex86/QEMU emulation environment
;
;  Copyright (C) 2002  MandrakeSoft S.A.
;
;    MandrakeSoft S.A.
;    43, rue d'Aboukir
;    75002 Paris - France
;    http://www.linux-mandrake.com/
;    http://www.mandrakesoft.com/
;
;  This library is free software; you can redistribute it and/or
;  modify it under the terms of the GNU Lesser General Public
;  License as published by the Free Software Foundation; either
;  version 2 of the License, or (at your option) any later version.
;
;  This library 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
;  Lesser General Public License for more details.
;
;  You should have received a copy of the GNU Lesser General Public
;  License along with this library; if not, write to the Free Software
;  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
;
;

; Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
; other than GPL or LGPL is available it will apply instead, Oracle elects to use only
; the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
; a choice of LGPL license versions is made available with the language indicating
; that LGPLv2 or any later version may be used, or where a choice of which version
; of the LGPL is applied is otherwise unspecified.


if BX_PCIBIOS
public _pci_routing_table
public _pci_routing_table_size

align 16
pci_routing_table_structure:
  db '$PIR'  ;; "$PIR" signature
  db 0, 1 ;; version
ifdef VBOX
  dw 32 + (30 * 16) ;; table size
else ; !VBOX
  dw 32 + (6 * 16) ;; table size
endif ; !VBOX
  db 0 ;; PCI interrupt router bus
  db 8 ;; PCI interrupt router DevFunc
  dw 0000h ;; PCI exclusive IRQs
  dw 8086h ;; compatible PCI interrupt router vendor ID
  dw 7000h ;; compatible PCI interrupt router device ID
  dw 0,0 ;; Miniport data
  db 0,0,0,0,0,0,0,0,0,0,0 ;; reserved
ifdef VBOX
  db 0 ;; checksum (set by biossums)
else ; !VBOX
  db 7 ;; checksum
endif ; !VBOX
_pci_routing_table:
pci_routing_table:
  ;; first slot entry PCI-to-ISA (embedded)
  db 0 ;; pci bus number
  db 008h ;; pci device number (bit 7-3)
  db 60h ;; link value INTA#: pointer into PCI2ISA config space
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 61h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 62h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 63h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 0 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; second slot entry: 1st PCI slot
  db 0 ;; pci bus number
  db 010h ;; pci device number (bit 7-3)
  db 61h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 62h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 63h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 60h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 1 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; third slot entry: 2nd PCI slot
  db 0 ;; pci bus number
  db 018h ;; pci device number (bit 7-3)
  db 62h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 63h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 60h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 61h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 2 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 4th slot entry: 3rd PCI slot
  db 0 ;; pci bus number
  db 020h ;; pci device number (bit 7-3)
  db 63h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 60h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 61h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 62h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 3 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 5th slot entry: 4th PCI slot
  db 0 ;; pci bus number
  db 028h ;; pci device number (bit 7-3)
  db 60h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 61h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 62h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 63h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 4 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 6th slot entry: 5th PCI slot
  db 0 ;; pci bus number
  db 030h ;; pci device number (bit 7-3)
  db 61h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 62h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 63h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 60h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 5 ;; physical slot (0 = embedded)
  db 0 ;; reserved
ifdef VBOX
  ;; 7th slot entry: 6th PCI slot
  db 0 ;; pci bus number
  db 038h ;; pci device number (bit 7-3)
  db 62h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 63h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 60h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 61h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 6 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 8th slot entry: 7th PCI slot
  db 0 ;; pci bus number
  db 040h ;; pci device number (bit 7-3)
  db 63h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 60h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 61h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 62h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 7 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 9th slot entry: 8th PCI slot
  db 0 ;; pci bus number
  db 048h ;; pci device number (bit 7-3)
  db 60h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 61h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 62h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 63h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 8 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 10th slot entry: 9th PCI slot
  db 0 ;; pci bus number
  db 050h ;; pci device number (bit 7-3)
  db 61h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 62h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 63h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 60h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 9 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 11th slot entry: 10th PCI slot
  db 0 ;; pci bus number
  db 058h ;; pci device number (bit 7-3)
  db 62h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 63h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 60h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 61h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 10 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 12th slot entry: 11th PCI slot
  db 0 ;; pci bus number
  db 60h ;; pci device number (bit 7-3)
  db 63h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 60h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 61h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 62h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 11 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 13th slot entry: 12th PCI slot
  db 0 ;; pci bus number
  db 068h ;; pci device number (bit 7-3)
  db 60h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 61h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 62h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 63h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 12 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 14th slot entry: 13th PCI slot
  db 0 ;; pci bus number
  db 070h ;; pci device number (bit 7-3)
  db 61h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 62h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 63h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 60h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 13 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 15th slot entry: 14th PCI slot
  db 0 ;; pci bus number
  db 078h ;; pci device number (bit 7-3)
  db 62h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 63h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 60h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 61h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 14 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 16th slot entry: 15th PCI slot
  db 0 ;; pci bus number
  db 080h ;; pci device number (bit 7-3)
  db 63h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 60h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 61h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 62h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 15 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 17th slot entry: 16th PCI slot
  db 0 ;; pci bus number
  db 088h ;; pci device number (bit 7-3)
  db 60h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 61h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 62h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 63h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 16 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 18th slot entry: 17th PCI slot
  db 0 ;; pci bus number
  db 090h ;; pci device number (bit 7-3)
  db 61h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 62h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 63h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 60h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 17 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 19th slot entry: 18th PCI slot
  db 0 ;; pci bus number
  db 098h ;; pci device number (bit 7-3)
  db 62h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 63h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 60h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 61h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 18 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 20th slot entry: 19th PCI slot
  db 0 ;; pci bus number
  db 0A0h ;; pci device number (bit 7-3)
  db 63h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 60h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 61h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 62h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 19 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 21st slot entry: 20th PCI slot
  db 0 ;; pci bus number
  db 0A8h ;; pci device number (bit 7-3)
  db 60h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 61h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 62h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 63h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 20 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 22nd slot entry: 21st PCI slot
  db 0 ;; pci bus number
  db 0B0h ;; pci device number (bit 7-3)
  db 61h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 62h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 63h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 60h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 21 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 23rd slot entry: 22nd PCI slot
  db 0 ;; pci bus number
  db 0B8h ;; pci device number (bit 7-3)
  db 62h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 63h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 60h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 61h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 22 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 24th slot entry: 23rd PCI slot
  db 0 ;; pci bus number
  db 0C0h ;; pci device number (bit 7-3)
  db 63h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 60h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 61h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 62h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 23 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 25th slot entry: 24th PCI slot
  db 0 ;; pci bus number
  db 0C8h ;; pci device number (bit 7-3)
  db 60h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 61h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 62h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 63h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 24 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 26th slot entry: 25th PCI slot
  db 0 ;; pci bus number
  db 0D0h ;; pci device number (bit 7-3)
  db 61h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 62h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 63h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 60h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 25 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 27th slot entry: 26th PCI slot
  db 0 ;; pci bus number
  db 0D8h ;; pci device number (bit 7-3)
  db 62h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 63h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 60h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 61h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 26 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 28th slot entry: 27th PCI slot
  db 0 ;; pci bus number
  db 0E0h ;; pci device number (bit 7-3)
  db 63h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 60h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 61h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 62h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 27 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 29th slot entry: 28th PCI slot
  db 0 ;; pci bus number
  db 0E8h ;; pci device number (bit 7-3)
  db 60h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 61h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 62h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 63h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 28 ;; physical slot (0 = embedded)
  db 0 ;; reserved
  ;; 30th slot entry: 29th PCI slot
  db 0 ;; pci bus number
  db 0F0h ;; pci device number (bit 7-3)
  db 61h ;; link value INTA#
  dw 0DEF8h ;; IRQ bitmap INTA#
  db 62h ;; link value INTB#
  dw 0DEF8h ;; IRQ bitmap INTB#
  db 63h ;; link value INTC#
  dw 0DEF8h ;; IRQ bitmap INTC#
  db 60h ;; link value INTD#
  dw 0DEF8h ;; IRQ bitmap INTD#
  db 29 ;; physical slot (0 = embedded)
  db 0 ;; reserved
endif ; VBOX
pci_routing_table_end:
;; Size of the table
_pci_routing_table_size dw	pci_routing_table_end - pci_routing_table

endif   ; BX_PCIBIOS