 42d8a3cf96
			
		
	
	
		42d8a3cf96
		
	
	
	
	
		
			
			Replace all register_ioport_*() with a MemoryRegion. This permits to use the new Memory stuff like listeners. Moreover, the PCI device is added as an argument for apm_init(), so we can register IO inside the PCI IO address space. Signed-off-by: Julien Grall <julien.grall@citrix.com> Acked-by: Avi Kivity <avi@redhat.com> [AF: Rebased onto hwaddr and q35] Signed-off-by: Andreas Färber <afaerber@suse.de>
		
			
				
	
	
		
			26 lines
		
	
	
		
			482 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			482 B
		
	
	
	
		
			C
		
	
	
	
	
	
| #ifndef APM_H
 | |
| #define APM_H
 | |
| 
 | |
| #include <stdint.h>
 | |
| #include "qemu-common.h"
 | |
| #include "hw.h"
 | |
| #include "memory.h"
 | |
| 
 | |
| typedef void (*apm_ctrl_changed_t)(uint32_t val, void *arg);
 | |
| 
 | |
| typedef struct APMState {
 | |
|     uint8_t apmc;
 | |
|     uint8_t apms;
 | |
| 
 | |
|     apm_ctrl_changed_t callback;
 | |
|     void *arg;
 | |
|     MemoryRegion io;
 | |
| } APMState;
 | |
| 
 | |
| void apm_init(PCIDevice *dev, APMState *s, apm_ctrl_changed_t callback,
 | |
|               void *arg);
 | |
| 
 | |
| extern const VMStateDescription vmstate_apm;
 | |
| 
 | |
| #endif /* APM_H */
 |