1 /* 2 * Copyright 2004-2008, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 3 * Copyright 2002-04, Thomas Kurschel. All rights reserved. 4 * 5 * Distributed under the terms of the MIT License. 6 */ 7 #ifndef IO_RESOURCES_H 8 #define IO_RESOURCES_H 9 10 11 #include <device_manager.h> 12 13 #include <util/DoublyLinkedList.h> 14 15 16 struct io_resource_private : io_resource, 17 DoublyLinkedListLinkImpl<io_resource_private> { 18 io_resource_private(); 19 ~io_resource_private(); 20 21 status_t Acquire(const io_resource& resource); 22 void Release(); 23 24 private: 25 void _Init(); 26 static bool _IsValid(const io_resource& resource); 27 28 public: 29 DoublyLinkedListLink<io_resource_private> fTypeLink; 30 }; 31 32 typedef DoublyLinkedList<io_resource_private> ResourceList; 33 34 35 #ifdef __cplusplus 36 extern "C" { 37 #endif 38 39 void dm_init_io_resources(void); 40 41 #ifdef __cplusplus 42 } 43 #endif 44 45 #endif /* IO_RESOURCES_H */ 46