/* * module_devicetable.hpp * * Copyright (C) 2005, 2006 Bastian Blank * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef MODULE_DEVICETABLE_HPP #define MODULE_DEVICETABLE_HPP #include "elf.hpp" #include #include #include namespace linuxkernel { class module_real; namespace module_devicetable { class device_ccw { }; class device_i2c { }; class device_ieee1394 { }; class device_input { }; class device_of { }; class device_pci { }; class device_pcmcia { }; class device_pnp { }; class device_pnp_card { }; class device_serio { }; class device_usb { }; class device_vio { }; class version_2_6_16 { }; namespace internal { template struct def {}; template<> struct def { static const std::string symbol; }; template<> struct def { static const std::string symbol; }; template<> struct def { static const std::string symbol; }; template<> struct def { static const std::string symbol; }; template<> struct def { static const std::string symbol; }; template<> struct def { static const std::string symbol; }; template<> struct def { static const std::string symbol; }; template<> struct def { static const std::string symbol; }; template<> struct def { static const std::string symbol; }; template<> struct def { static const std::string symbol; }; template<> struct def { static const std::string symbol; }; template<> struct def { static const std::string symbol; }; } class table_entry { public: virtual ~table_entry () {}; virtual void write (std::ostream &) const throw (std::runtime_error) = 0; }; template class table_entry_version : public table_entry { }; template class table_entry_data : public table_entry_version { }; class table_base { public: virtual ~table_base () throw () {}; void write (std::ostream &out) const throw (std::runtime_error); protected: table_base () throw () {}; std::list entries; }; template void table_create (std::list &, const module_real *m, const Elf::file *f) throw (std::runtime_error); template class table : public table_base { public: static table_base *create (const module_real *m, const Elf::file *f) throw (std::runtime_error); protected: table () {}; }; template class table_data : public table { public: table_data (const void *, size_t) throw (std::runtime_error); }; } } #ifndef DISABLE_TEMPLATES #include "module_devicetable.tpp" #endif #endif