1/* 2 * Copyright 2009, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Clemens Zeidler, haiku@clemens-zeidler.de 7 */ 8 9#ifndef SMALLRESOURCEDATA_H 10#define SMALLRESOURCEDATA_H 11 12#include <ACPI.h> 13#include <Errors.h> 14 15 16enum resource_type 17{ 18 kIOPort = 0x47, 19 kEndTag = 0x78 20}; 21 22 23struct io_port 24{ 25 void Print(); 26 //! The logical device decodes 16-bit addresses. 27 bool deviceAddresses16Bit; 28 29 uint16 minimumBase; 30 uint16 maximumBase; 31 uint8 minimumBaseAlignment; 32 uint8 contigiuousIOPorts; 33}; 34 35 36/*! ToDo: implement also the other resource data, see acpi section 6.2.4 */ 37class SmallResourceData 38{ 39public: 40 SmallResourceData(acpi_device_module_info* acpi, 41 acpi_device acpiCookie, const char* method); 42 ~SmallResourceData(); 43 44 status_t InitCheck(); 45 46 int8 GetType(); 47 /*! Get resource data and jump to the next resource. */ 48 status_t ReadIOPort(io_port* ioPort); 49 50private: 51 acpi_object_type* fBuffer; 52 size_t fBufferSize; 53 size_t fRemainingBufferSize; 54 55 int8* fResourcePointer; 56 57 status_t fStatus; 58}; 59 60 61#endif 62