mirror of
				https://gitlab.com/qemu-project/qemu-palcode.git
				synced 2024-02-13 08:32:59 +08:00 
			
		
		
		
	Make some PCI macros available to other files. NFC.
Move PCI_DEVFN(), PCI_BUS(), PCI_SLOT(), and PCI_FUNC() to pci.h. Signed-off-by: Jason Thorpe <thorpej@me.com> Message-Id: <20210603035317.6814-5-thorpej@me.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
		 Jason Thorpe
					Jason Thorpe
				
			
				
					committed by
					
						 Richard Henderson
						Richard Henderson
					
				
			
			
				
	
			
			
			 Richard Henderson
						Richard Henderson
					
				
			
						parent
						
							7accd8de6b
						
					
				
				
					commit
					0cbd87c2c4
				
			
							
								
								
									
										4
									
								
								pci.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								pci.c
									
									
									
									
									
								
							| @ -31,10 +31,6 @@ | ||||
| #include "pci_regs.h" | ||||
|  | ||||
|  | ||||
| #define PCI_DEVFN(slot, func)	((((slot) & 0x1f) << 3) | ((func) & 0x07)) | ||||
| #define PCI_BUS(devfn)		((devfn) >> 8) | ||||
| #define PCI_SLOT(devfn)		(((devfn) >> 3) & 0x1f) | ||||
| #define PCI_FUNC(devfn)		((devfn) & 0x07) | ||||
| #define PCI_SLOT_MAX		32 | ||||
| #define PCI_FUNC_MAX		8 | ||||
| #define PCI_REGION_ROM		6 | ||||
|  | ||||
							
								
								
									
										5
									
								
								pci.h
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								pci.h
									
									
									
									
									
								
							| @ -60,6 +60,11 @@ extern void pci_config_maskw(int bdf, int addr, uint16_t off, uint16_t on); | ||||
|  | ||||
| extern int pci_next(int bdf, int *pmax); | ||||
|  | ||||
| #define PCI_DEVFN(slot, func)	((((slot) & 0x1f) << 3) | ((func) & 0x07)) | ||||
| #define PCI_BUS(devfn)		((devfn) >> 8) | ||||
| #define PCI_SLOT(devfn)		(((devfn) >> 3) & 0x1f) | ||||
| #define PCI_FUNC(devfn)		((devfn) & 0x07) | ||||
|  | ||||
| #define foreachpci(BDF, MAX)				\ | ||||
| 	for (MAX = 0x0100, BDF = pci_next(0, &MAX);	\ | ||||
| 	     BDF >= 0;					\ | ||||
|  | ||||
		Reference in New Issue
	
	Block a user