BPicture: Fix archive constructor.
[haiku.git] / src / add-ons / kernel / drivers / graphics / radeon_hd / driver.h
blob226f2ff7be9f7174b447735f5ce2ea5b4bf47925
1 /*
2 * Copyright 2006-2009, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Axel Dörfler, axeld@pinc-software.de
7 */
8 #ifndef DRIVER_H
9 #define DRIVER_H
12 #include <KernelExport.h>
13 #include <PCI.h>
16 #include <kernel/lock.h>
19 #include "radeon_hd.h"
20 #include "radeon_hd_private.h"
23 // PCI Communications
25 #define read8(address) (*((volatile uint8*)(address)))
26 #define read16(address) (*((volatile uint16*)(address)))
27 #define read32(address) (*((volatile uint32*)(address)))
28 #define write8(address, data) (*((volatile uint8*)(address)) = (data))
29 #define write16(address, data) (*((volatile uint16*)(address)) = (data))
30 #define write32(address, data) (*((volatile uint32*)(address)) = (data))
33 extern char* gDeviceNames[];
34 extern radeon_info* gDeviceInfo[];
35 extern pci_module_info* gPCI;
36 extern mutex gLock;
39 static inline uint32
40 get_pci_config(pci_info* info, uint8 offset, uint8 size)
42 return gPCI->read_pci_config(info->bus, info->device, info->function,
43 offset, size);
47 static inline void
48 set_pci_config(pci_info* info, uint8 offset, uint8 size, uint32 value)
50 gPCI->write_pci_config(info->bus, info->device, info->function, offset,
51 size, value);
55 #endif /* DRIVER_H */