2 * Copyright 2006-2009, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Axel Dörfler, axeld@pinc-software.de
12 #include <KernelExport.h>
15 #include <kernel/lock.h>
17 #include "intel_extreme_private.h"
20 extern char* gDeviceNames
[];
21 extern intel_info
* gDeviceInfo
[];
22 extern pci_module_info
* gPCI
;
23 extern pci_x86_module_info
* gPCIx86Module
;
24 extern agp_gart_module_info
* gGART
;
29 get_pci_config(pci_info
* info
, uint8 offset
, uint8 size
)
31 return gPCI
->read_pci_config(info
->bus
, info
->device
, info
->function
,
37 set_pci_config(pci_info
* info
, uint8 offset
, uint8 size
, uint32 value
)
39 gPCI
->write_pci_config(info
->bus
, info
->device
, info
->function
, offset
,
45 read16(intel_info
&info
, uint32 encodedRegister
)
47 return *(volatile uint16
*)(info
.registers
48 + info
.shared_info
->register_blocks
[REGISTER_BLOCK(encodedRegister
)]
49 + REGISTER_REGISTER(encodedRegister
));
54 read32(intel_info
&info
, uint32 encodedRegister
)
56 return *(volatile uint32
*)(info
.registers
57 + info
.shared_info
->register_blocks
[REGISTER_BLOCK(encodedRegister
)]
58 + REGISTER_REGISTER(encodedRegister
));
63 write16(intel_info
&info
, uint32 encodedRegister
, uint16 value
)
65 *(volatile uint16
*)(info
.registers
66 + info
.shared_info
->register_blocks
[REGISTER_BLOCK(encodedRegister
)]
67 + REGISTER_REGISTER(encodedRegister
)) = value
;
72 write32(intel_info
&info
, uint32 encodedRegister
, uint32 value
)
74 *(volatile uint32
*)(info
.registers
75 + info
.shared_info
->register_blocks
[REGISTER_BLOCK(encodedRegister
)]
76 + REGISTER_REGISTER(encodedRegister
)) = value
;