1 /* 2 * Copyright 2006-2008, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Axel Dörfler, axeld@pinc-software.de 7 */ 8 #ifndef INTEL_EXTREME_PRIVATE_H 9 #define INTEL_EXTREME_PRIVATE_H 10 11 12 #include <AGP.h> 13 #include <KernelExport.h> 14 #include <PCI.h> 15 16 #include "intel_extreme.h" 17 #include "lock.h" 18 19 20 struct intel_info { 21 int32 open_count; 22 status_t init_status; 23 int32 id; 24 pci_info* pci; 25 addr_t aperture_base; 26 aperture_id aperture; 27 28 addr_t registers; 29 30 area_id registers_area; 31 struct intel_shared_info* shared_info; 32 area_id shared_area; 33 34 struct overlay_registers* overlay_registers; 35 36 bool fake_interrupts; 37 uint8 irq; 38 bool use_msi; 39 40 const char* device_identifier; 41 DeviceType device_type; 42 43 enum pch_info pch_info; 44 }; 45 46 47 static inline uint32 48 find_reg(const intel_info& info, uint32 target) 49 { 50 if (REGISTER_BLOCK(target) != REGS_FLAT) { 51 panic("find_reg is only supposed to be used for unrouped registers\n"); 52 return target; 53 } 54 55 if (info.pch_info == INTEL_PCH_NONE) 56 return target; 57 58 #define RETURN_REG(x) case INTEL_##x: return PCH_##x; 59 60 switch (target) { 61 RETURN_REG(INTERRUPT_ENABLED) 62 RETURN_REG(INTERRUPT_IDENTITY) 63 RETURN_REG(INTERRUPT_MASK) 64 RETURN_REG(INTERRUPT_STATUS) 65 } 66 67 #undef RETURN_REG 68 69 panic("find_reg didn't have any matching register\n"); 70 return target; 71 } 72 73 74 extern bool parse_vbt_from_bios(struct intel_shared_info* info); 75 extern status_t intel_free_memory(intel_info& info, addr_t offset); 76 extern status_t intel_allocate_memory(intel_info& info, size_t size, 77 size_t alignment, uint32 flags, addr_t* _offset, 78 phys_addr_t* _physicalBase = NULL); 79 extern status_t intel_extreme_init(intel_info& info); 80 extern void intel_extreme_uninit(intel_info& info); 81 82 #endif /* INTEL_EXTREME_PRIVATE_H */ 83