aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips/tlbdebug.h
diff options
context:
space:
mode:
authorNamhoon Kim <namhoonk@cs.unc.edu>2016-09-09 16:18:12 -0400
committerNamhoon Kim <namhoonk@cs.unc.edu>2016-09-09 16:18:12 -0400
commit805c547ee3cdc2ef6a5f7556fdf449ced2e48680 (patch)
treeabeae409739a576291942281f9acf56725d73a1a /include/asm-mips/tlbdebug.h
parent418e60bb6948a4cf6eb7c737bea21c2314619c73 (diff)
TODO: Fix condition checks in replicate_page_move_mapping()wip-shared-lib
Diffstat (limited to 'include/asm-mips/tlbdebug.h')
0 files changed, 0 insertions, 0 deletions
mit/drivers/acpi/pci_link.c?id=1ba90e3a87c46500623afdc3898573e4a5ebb21b'>1ba90e3a87c4
4be44fcd3bf6


1c9ca3a7d41b
1da177e4c3f4

87bec66b9691



1da177e4c3f4
4be44fcd3bf6
50eca3eb89d7
1c9ca3a7d41b
4be44fcd3bf6




1da177e4c3f4


5f0dccaa81e2
1c9ca3a7d41b


1da177e4c3f4

5f0dccaa81e2
e5685b9d35c2
1da177e4c3f4
1da177e4c3f4






1c9ca3a7d41b

1da177e4c3f4
50dd096973f1
c9d6244329c8
1da177e4c3f4
eca008c8134d
50eca3eb89d7
4a5e3638b119
d550d98d3317
50eca3eb89d7
4be44fcd3bf6

50eca3eb89d7
4a5e3638b119

d550d98d3317
1da177e4c3f4
4be44fcd3bf6
50eca3eb89d7
4be44fcd3bf6

4a5e3638b119


4be44fcd3bf6




50eca3eb89d7


4be44fcd3bf6
1da177e4c3f4
50eca3eb89d7
4be44fcd3bf6
50eca3eb89d7
4be44fcd3bf6
50eca3eb89d7
cece92969762
4a5e3638b119
d550d98d3317
4be44fcd3bf6

50eca3eb89d7
4be44fcd3bf6

4a5e3638b119


4be44fcd3bf6



1da177e4c3f4
50eca3eb89d7


4be44fcd3bf6
1da177e4c3f4
1da177e4c3f4
4a5e3638b119

d550d98d3317
1da177e4c3f4

d550d98d3317
1da177e4c3f4

4be44fcd3bf6
1da177e4c3f4
4be44fcd3bf6
1da177e4c3f4
67a7136573b2
4be44fcd3bf6
1da177e4c3f4
a6fc67202e02
d550d98d3317
1da177e4c3f4

4be44fcd3bf6


1da177e4c3f4
d550d98d3317
1da177e4c3f4

1c9ca3a7d41b

1da177e4c3f4
c9d6244329c8
1da177e4c3f4
eca008c8134d
4a5e3638b119


50eca3eb89d7
4be44fcd3bf6

50eca3eb89d7
4be44fcd3bf6




4a5e3638b119
d550d98d3317
4be44fcd3bf6


1da177e4c3f4
50eca3eb89d7
4be44fcd3bf6
50eca3eb89d7
4be44fcd3bf6
50eca3eb89d7
4be44fcd3bf6



cece92969762
4a5e3638b119
d550d98d3317
4be44fcd3bf6


1da177e4c3f4
d4ec6c7cc9a1
1da177e4c3f4
4a5e3638b119

d550d98d3317
1da177e4c3f4
4a5e3638b119
d550d98d3317
1da177e4c3f4








4be44fcd3bf6
1da177e4c3f4
4be44fcd3bf6
c9d6244329c8
4be44fcd3bf6
1da177e4c3f4
1da177e4c3f4






6468463abd70
1da177e4c3f4




d550d98d3317
1da177e4c3f4






67a7136573b2
4be44fcd3bf6
1da177e4c3f4
a6fc67202e02
1da177e4c3f4




6468463abd70
1da177e4c3f4






4be44fcd3bf6
d550d98d3317
1da177e4c3f4

4be44fcd3bf6
1da177e4c3f4
c9d6244329c8

1da177e4c3f4
4be44fcd3bf6



1da177e4c3f4
6eca4b4ca168
d550d98d3317
1da177e4c3f4
36bcbec7ce21
4be44fcd3bf6
d550d98d3317
1da177e4c3f4
4be44fcd3bf6
1da177e4c3f4

4be44fcd3bf6
50eca3eb89d7

1da177e4c3f4
50eca3eb89d7




4be44fcd3bf6
1da177e4c3f4
50eca3eb89d7

1da177e4c3f4

4be44fcd3bf6
50eca3eb89d7

1da177e4c3f4
4be44fcd3bf6

50eca3eb89d7





4be44fcd3bf6
1da177e4c3f4
50eca3eb89d7

1da177e4c3f4



6468463abd70
1da177e4c3f4



50eca3eb89d7
1da177e4c3f4

67a7136573b2
1da177e4c3f4


a6fc67202e02
1da177e4c3f4






6468463abd70
1da177e4c3f4


cece92969762

a6fc67202e02
cece92969762
1da177e4c3f4
















cece92969762

a6fc67202e02
cece92969762
1da177e4c3f4



4be44fcd3bf6

1da177e4c3f4
d550d98d3317
1da177e4c3f4

1da177e4c3f4
















































4be44fcd3bf6

1da177e4c3f4






1c9ca3a7d41b



4be44fcd3bf6
1da177e4c3f4

4be44fcd3bf6
1da177e4c3f4
c9d6244329c8

1da177e4c3f4
1da177e4c3f4


5f0dccaa81e2
1da177e4c3f4





4be44fcd3bf6


1da177e4c3f4


4be44fcd3bf6


1da177e4c3f4


4be44fcd3bf6

1da177e4c3f4


cee324b145a1
d550d98d3317
1da177e4c3f4

32836259ff25
1da177e4c3f4
4be44fcd3bf6
1da177e4c3f4
4be44fcd3bf6

1da177e4c3f4
87bec66b9691



d550d98d3317
87bec66b9691
1da177e4c3f4












cece92969762

1da177e4c3f4





1c9ca3a7d41b
1da177e4c3f4
1c9ca3a7d41b
1da177e4c3f4
1da177e4c3f4






4be44fcd3bf6

1da177e4c3f4





6468463abd70

a6fc67202e02
6468463abd70
d550d98d3317
1da177e4c3f4

4d9391557b68
4be44fcd3bf6

1da177e4c3f4


d550d98d3317
1da177e4c3f4


87bec66b9691
1da177e4c3f4


1c9ca3a7d41b

1da177e4c3f4
c9d6244329c8


1da177e4c3f4
1da177e4c3f4

6468463abd70
d550d98d3317
1da177e4c3f4

50dd096973f1
1da177e4c3f4
6468463abd70
d550d98d3317
1da177e4c3f4



6468463abd70
d550d98d3317
1da177e4c3f4

36e430951af0
87bec66b9691
36e430951af0
d550d98d3317
87bec66b9691
4be44fcd3bf6
1da177e4c3f4
36e430951af0
6468463abd70
d550d98d3317
1da177e4c3f4
4be44fcd3bf6
36e430951af0
1da177e4c3f4
50eca3eb89d7



4be44fcd3bf6

87bec66b9691
4be44fcd3bf6

d550d98d3317
1da177e4c3f4

87bec66b9691



4be44fcd3bf6
87bec66b9691
c9d6244329c8

4be44fcd3bf6
87bec66b9691
87bec66b9691

6468463abd70
d550d98d3317
87bec66b9691
1da177e4c3f4
50dd096973f1
87bec66b9691
6468463abd70
d550d98d3317
87bec66b9691

36e430951af0
87bec66b9691
36e430951af0
6468463abd70
d550d98d3317
87bec66b9691
ecc21ebe603a









4be44fcd3bf6
ecc21ebe603a
87bec66b9691
4be44fcd3bf6

87bec66b9691
1c9ca3a7d41b
383d7a11c998
1c9ca3a7d41b
36e430951af0
d550d98d3317
87bec66b9691
4be44fcd3bf6
1da177e4c3f4



4be44fcd3bf6
1da177e4c3f4
c9d6244329c8


4be44fcd3bf6
1da177e4c3f4
36bcbec7ce21
1da177e4c3f4
d550d98d3317
1da177e4c3f4

1da177e4c3f4

db89b4f0dbab
1da177e4c3f4
36e430951af0
1da177e4c3f4






0dc070bb0242
4be44fcd3bf6
1da177e4c3f4



4be44fcd3bf6
1da177e4c3f4







4be44fcd3bf6
1da177e4c3f4



5f0dccaa81e2
1da177e4c3f4
4be44fcd3bf6
1da177e4c3f4
383d7a11c998
36e430951af0
1da177e4c3f4



d550d98d3317
1da177e4c3f4

4be44fcd3bf6
697a2d63a384
697a2d63a384
d550d98d3317
1c9ca3a7d41b

697a2d63a384

c3146df2b735
1da177e4c3f4
c9d6244329c8
1da177e4c3f4
5f0dccaa81e2
697a2d63a384
1da177e4c3f4
1da177e4c3f4

4be44fcd3bf6
1da177e4c3f4
c9d6244329c8
1da177e4c3f4
50dd096973f1
1da177e4c3f4
36e430951af0
5f0dccaa81e2
36e430951af0
1da177e4c3f4

d550d98d3317
1da177e4c3f4












4be44fcd3bf6
1da177e4c3f4





4be44fcd3bf6
fa46d3526461
1da177e4c3f4



















c9c3e457de24
1da177e4c3f4
fa46d3526461





1da177e4c3f4










4be44fcd3bf6
1da177e4c3f4










4be44fcd3bf6
1da177e4c3f4






4be44fcd3bf6
1da177e4c3f4

8a383ef0be01
1da177e4c3f4



1da177e4c3f4
4be44fcd3bf6
1da177e4c3f4
c3146df2b735
4be44fcd3bf6
1da177e4c3f4

c3146df2b735
1da177e4c3f4
c3146df2b735

1da177e4c3f4
c3146df2b735
4be44fcd3bf6
1da177e4c3f4
c3146df2b735
1da177e4c3f4
4be44fcd3bf6
1da177e4c3f4
1da177e4c3f4
d550d98d3317
1da177e4c3f4
32836259ff25







1da177e4c3f4
d550d98d3317
1da177e4c3f4
d550d98d3317
1da177e4c3f4


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
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906






























                                                                             
                              



                         


                           
                        
                       



                              

                       
                                                          
                             
                                                         


                                                            

                                          

                                                                      
 
                                                        




                                           
                                                  
                           
                                     
                               


                                               
          

  



                                                                         
                          
                                                 
                                              
                                              




                                                


                      
                                             


                                                

  
                                 
                                    
 






                                                                                

                                                                               
 
                                             
              
 
                                 
                                                
                                        
                             
                                    

                                                                          
                                                        

                                                                                
                                             
                         
                                   
                                                    

                                                                        


                                                                       




                                                                         


                                                                         
                              
                 
                                             
                 
                                                              
                                                         
                                                        
                                                          
                                                                               
                                             

                                   
                                                    

                                                                        


                                                                       



                                                                         
                         


                                                                                  
                              
                 
                

                                                                                
                             

         
                                 

 
                                                                 
 
                           
 
                                                                            
                                                                         
                                   
                                                                     
                               

         


                                                     
 
                 

 

                                                                              
 
                           
 
                                 


                                                
                                    

                                                                          
                                                        




                                                                             
                                                                                
                                             


                                                
                 
                                             
                 
                                                              
                                                         
                                                        



                                                                
                                                          
                                                                               
                                             


                                                
                 
                      
                

                                                                                
                             
         
 
                                 








                                    
                                                                
 
                       
                           
                    
 






                                                                    
                                                                          




                                                                            
                                 






                                                                   
                                                                            
                                                                        
                                   
                                                                     




                                  
                                                            






                                                                                
          
                      

 
                                                                 
 

                           
                



                                                
 
                 
                               
 
                                                                                            
                      
                               
 
                                              

                                  
                                          

                                                            
                                                                    




                                                                         
                                           
                    

                                                                      

                                                           
 

                                                                     
                                                                    

                                                                   





                                                                
                                           
                    

                                                                      



                                                                    
                                                                                              



                                 
                                                        

                                         
                                                                           


                                     
                                                                     






                                                   
                                                                  


                                            

                                                                            
                                                             
                                                             
















                                                                     

                                                                             
                                                             
                                                                                    



                                                                           

          
                        
                      

 
















































                                                                                 

                                                         






                                                                         



                                                                  
                    

  
                                      
 

                                   
 


                                                        
                                                          





                                                                               


                                                       


                                                                             


                                                                        


                                              

                                                             


                                       
                                                                                
                 

 
                                                                   
 
                                                             
 

                
 



                                                                             
                         
         












                                                              

                                                                      





                                                                              
                             
                                       
            
                                                                       






                                                                           

                                                                    





                                                            

                                                                        
                                                           
                                                           
                               

                                                                             
                                                                         

                                                                        


                                  
                 


  
                             


                           

                                                                              
 


                                   
 

                                                      
                                                                
                          

         
                                        
                    
                                                                 
                          



                                                                       
                                                                    
                          

         
                                    
                                           
                                              
                          
         
 
                                
                                              
                                                                  
                          
         
                       
                                      
 



                                                   

                                                      
                                       

                                                          
                                  

 



                                                                          
                                              
 

                                   
                           
 

                                                      
                                                                
                          
         
 
                                        
                    
                                                                 
                          

         
                                    
                                     
                                              
                                                                   
                          
         









                                                                        
                       
      
                                       

                                                          
 
                              
                                                                               
 
                                      
                                  
 
 



                                                                                
                                                        
 


                                   
                      
 
                                                                 
                  
                               

                              

                                                                    
                                   
 
                                    






                                                  
                                                                          
                                        



                                                                
                      







                                                             
                                          



                                      
                                                    
 
          
                                                         
                                                                 
                                      



                            
                      

 
                                                           
 
                                                                      
                                                                   

                 

 
                                  
 
                                   
 
                                                          
                                           
         

 
                                                                     
 
                                   
 
                                        
 
                                    
                              
                                      

                    
                 












                                                              
                                                





                                                     
 
                                                        



















                                                                           
                                               
 





                                                                        










                                                                         
 










                                                                       
 






                                                   
 

                                                      
                                                 



                             
 
                                                  
 
                                                   
                                   

  
                                          
 

                                                             
 
                 
 
 
                                    
 
                                          
 
                       
                         
 







                                                                             
                                                                
                               
 
                 


                                    
/*
 *  pci_link.c - ACPI PCI Interrupt Link Device Driver ($Revision: 34 $)
 *
 *  Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
 *  Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
 *  Copyright (C) 2002       Dominik Brodowski <devel@brodo.de>
 *
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 *
 *  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.
 *
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 *
 * TBD: 
 *      1. Support more than one IRQ resource entry per link device (index).
 *	2. Implement start/stop mechanism and use ACPI Bus Driver facilities
 *	   for IRQ management (e.g. start()->_SRS).
 */

#include <linux/syscore_ops.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/spinlock.h>
#include <linux/pm.h>
#include <linux/pci.h>
#include <linux/mutex.h>
#include <linux/slab.h>

#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>

#define PREFIX "ACPI: "

#define _COMPONENT			ACPI_PCI_COMPONENT
ACPI_MODULE_NAME("pci_link");
#define ACPI_PCI_LINK_CLASS		"pci_irq_routing"
#define ACPI_PCI_LINK_DEVICE_NAME	"PCI Interrupt Link"
#define ACPI_PCI_LINK_FILE_INFO		"info"
#define ACPI_PCI_LINK_FILE_STATUS	"state"
#define ACPI_PCI_LINK_MAX_POSSIBLE	16

static int acpi_pci_link_add(struct acpi_device *device);
static int acpi_pci_link_remove(struct acpi_device *device, int type);

static const struct acpi_device_id link_device_ids[] = {
	{"PNP0C0F", 0},
	{"", 0},
};
MODULE_DEVICE_TABLE(acpi, link_device_ids);

static struct acpi_driver acpi_pci_link_driver = {
	.name = "pci_link",
	.class = ACPI_PCI_LINK_CLASS,
	.ids = link_device_ids,
	.ops = {
		.add = acpi_pci_link_add,
		.remove = acpi_pci_link_remove,
	},
};

/*
 * If a link is initialized, we never change its active and initialized
 * later even the link is disable. Instead, we just repick the active irq
 */
struct acpi_pci_link_irq {
	u8 active;		/* Current IRQ */
	u8 triggering;		/* All IRQs */
	u8 polarity;		/* All IRQs */
	u8 resource_type;
	u8 possible_count;
	u8 possible[ACPI_PCI_LINK_MAX_POSSIBLE];
	u8 initialized:1;
	u8 reserved:7;
};

struct acpi_pci_link {
	struct list_head		list;
	struct acpi_device		*device;
	struct acpi_pci_link_irq	irq;
	int				refcnt;
};

static LIST_HEAD(acpi_link_list);
static DEFINE_MUTEX(acpi_link_lock);

/* --------------------------------------------------------------------------
                            PCI Link Device Management
   -------------------------------------------------------------------------- */

/*
 * set context (link) possible list from resource list
 */
static acpi_status acpi_pci_link_check_possible(struct acpi_resource *resource,
						void *context)
{
	struct acpi_pci_link *link = context;
	u32 i;

	switch (resource->type) {
	case ACPI_RESOURCE_TYPE_START_DEPENDENT:
	case ACPI_RESOURCE_TYPE_END_TAG:
		return AE_OK;
	case ACPI_RESOURCE_TYPE_IRQ:
		{
			struct acpi_resource_irq *p = &resource->data.irq;
			if (!p || !p->interrupt_count) {
				ACPI_DEBUG_PRINT((ACPI_DB_INFO,
						  "Blank _PRS IRQ resource\n"));
				return AE_OK;
			}
			for (i = 0;
			     (i < p->interrupt_count
			      && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
				if (!p->interrupts[i]) {
					printk(KERN_WARNING PREFIX
					       "Invalid _PRS IRQ %d\n",
					       p->interrupts[i]);
					continue;
				}
				link->irq.possible[i] = p->interrupts[i];
				link->irq.possible_count++;
			}
			link->irq.triggering = p->triggering;
			link->irq.polarity = p->polarity;
			link->irq.resource_type = ACPI_RESOURCE_TYPE_IRQ;
			break;
		}
	case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
		{
			struct acpi_resource_extended_irq *p =
			    &resource->data.extended_irq;
			if (!p || !p->interrupt_count) {
				printk(KERN_WARNING PREFIX
					      "Blank _PRS EXT IRQ resource\n");
				return AE_OK;
			}
			for (i = 0;
			     (i < p->interrupt_count
			      && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
				if (!p->interrupts[i]) {
					printk(KERN_WARNING PREFIX
					       "Invalid _PRS IRQ %d\n",
					       p->interrupts[i]);
					continue;
				}
				link->irq.possible[i] = p->interrupts[i];
				link->irq.possible_count++;
			}
			link->irq.triggering = p->triggering;
			link->irq.polarity = p->polarity;
			link->irq.resource_type = ACPI_RESOURCE_TYPE_EXTENDED_IRQ;
			break;
		}
	default:
		printk(KERN_ERR PREFIX "_PRS resource type 0x%x isn't an IRQ\n",
		       resource->type);
		return AE_OK;
	}

	return AE_CTRL_TERMINATE;
}

static int acpi_pci_link_get_possible(struct acpi_pci_link *link)
{
	acpi_status status;

	status = acpi_walk_resources(link->device->handle, METHOD_NAME__PRS,
				     acpi_pci_link_check_possible, link);
	if (ACPI_FAILURE(status)) {
		ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRS"));
		return -ENODEV;
	}

	ACPI_DEBUG_PRINT((ACPI_DB_INFO,
			  "Found %d possible IRQs\n",
			  link->irq.possible_count));

	return 0;
}

static acpi_status acpi_pci_link_check_current(struct acpi_resource *resource,
					       void *context)
{
	int *irq = context;

	switch (resource->type) {
	case ACPI_RESOURCE_TYPE_START_DEPENDENT:
	case ACPI_RESOURCE_TYPE_END_TAG:
		return AE_OK;
	case ACPI_RESOURCE_TYPE_IRQ:
		{
			struct acpi_resource_irq *p = &resource->data.irq;
			if (!p || !p->interrupt_count) {
				/*
				 * IRQ descriptors may have no IRQ# bits set,
				 * particularly those those w/ _STA disabled
				 */
				ACPI_DEBUG_PRINT((ACPI_DB_INFO,
						  "Blank _CRS IRQ resource\n"));
				return AE_OK;
			}
			*irq = p->interrupts[0];
			break;
		}
	case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
		{
			struct acpi_resource_extended_irq *p =
			    &resource->data.extended_irq;
			if (!p || !p->interrupt_count) {
				/*
				 * extended IRQ descriptors must
				 * return at least 1 IRQ
				 */
				printk(KERN_WARNING PREFIX
					      "Blank _CRS EXT IRQ resource\n");
				return AE_OK;
			}
			*irq = p->interrupts[0];
			break;
		}
		break;
	default:
		printk(KERN_ERR PREFIX "_CRS resource type 0x%x isn't an IRQ\n",
		       resource->type);
		return AE_OK;
	}

	return AE_CTRL_TERMINATE;
}

/*
 * Run _CRS and set link->irq.active
 *
 * return value:
 * 0 - success
 * !0 - failure
 */
static int acpi_pci_link_get_current(struct acpi_pci_link *link)
{
	int result = 0;
	acpi_status status;
	int irq = 0;

	link->irq.active = 0;

	/* in practice, status disabled is meaningless, ignore it */
	if (acpi_strict) {
		/* Query _STA, set link->device->status */
		result = acpi_bus_get_status(link->device);
		if (result) {
			printk(KERN_ERR PREFIX "Unable to read status\n");
			goto end;
		}

		if (!link->device->status.enabled) {
			ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link disabled\n"));
			return 0;
		}
	}

	/* 
	 * Query and parse _CRS to get the current IRQ assignment. 
	 */

	status = acpi_walk_resources(link->device->handle, METHOD_NAME__CRS,
				     acpi_pci_link_check_current, &irq);
	if (ACPI_FAILURE(status)) {
		ACPI_EXCEPTION((AE_INFO, status, "Evaluating _CRS"));
		result = -ENODEV;
		goto end;
	}

	if (acpi_strict && !irq) {
		printk(KERN_ERR PREFIX "_CRS returned 0\n");
		result = -ENODEV;
	}

	link->irq.active = irq;

	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link at IRQ %d \n", link->irq.active));

      end:
	return result;
}

static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
{
	int result;
	acpi_status status;
	struct {
		struct acpi_resource res;
		struct acpi_resource end;
	} *resource;
	struct acpi_buffer buffer = { 0, NULL };