Overview   API Reference  

host_resource_owner.hpp

00001 #if !defined(__PHYSICAL_RESOURCE_OWNER_HPP__)
00002 #define __PHYSICAL_RESOURCE_OWNER_HPP__
00003 
00004 //
00005 // local includes
00006 //
00007 #include "core/machine/iospace/iospace_handler.hpp"
00008 #include "core/machine/memory/mmio_handler.hpp"
00009 #include "core/machine/irqs/irq_source.hpp"
00010 
00016 struct host_resource_owner : public iospace_handler, public mmio_handler, public irq_source
00017 {
00018     //
00019     // iospace_handler: override read_ioport & write_ioport
00020     //
00021     virtual inline uint32_t read_ioport(l4_port_t port, access_size access_size)
00022     {
00023         log::error("physical_resource_owner::%s called. physical I/O port trapped?\n"
00024                    "  read %s at "l4_port_fmt"\n",
00025                    __func__, access_size.string(), port);
00026         enter_kdebug(" physical I/O port trapped? ");
00027         return iospace_handler::INVALID;
00028     }
00029 
00030     virtual inline int write_ioport(l4_port_t port, uint32_t data, access_size access_size)
00031     {
00032         log::error("physical_resource_owner::%s called. physical I/O port trapped?\n"
00033                    "  write %s %s at "l4_port_fmt"\n",
00034                    __func__,
00035                    access_size.string(), format_hex<uint32_t>(data, access_size*2).c_str(), port);
00036         enter_kdebug(" physical I/O port trapped? ");
00037         return -L4_ENOTSUPP;
00038     }
00039 
00040     //
00041     // mmio_handler: override read_mmio/write_mmio & (un)map_mmio_region
00042     //
00043     virtual inline l4_umword_t read_mmio(l4_gpa_t address, access_size access_size)
00044     {
00045         log::error("physical_resource_owner::%s called. physical I/O memory trapped?\n"
00046                    "  read %s at "l4_gpa_fmt"\n",
00047                    __func__, access_size.string(), address);
00048         enter_kdebug(" physical I/O memory trapped? ");
00049         return mmio_handler::INVALID;
00050     }
00051 
00052     virtual inline int write_mmio(l4_gpa_t address, l4_umword_t data, access_size access_size)
00053     {
00054         log::error("physical_resource_owner::%s called. physical I/O memory trapped?\n"
00055                    "  write %s %s at "l4_gpa_fmt"\n",
00056                    __func__,
00057                    access_size.string(), format_hex<l4_umword_t>(data, access_size*2).c_str(), address);
00058         enter_kdebug(" physical I/O memory trapped? ");
00059         return -L4_ENOTSUPP;
00060     }
00061 
00062     virtual inline l4_hva_t map_mmio_region(int flags, l4_gpa_t base, l4_gpa_t size=1)
00063     {
00064         log::error("physical_resource_owner::%s called. physical I/O memory mapped?\n"
00065                    "  "l4_gpa_fmt"-"l4_gpa_fmt" ["l4_gpa_fmt"]\n",
00066                    __func__, base, base + size - 1, size);
00067         enter_kdebug(" physical I/O memory mapped? ");
00068         return 0;
00069     }
00070 
00071     virtual inline int unmap_mmio_region(l4_gpa_t base, l4_gpa_t size=1)
00072     {
00073         log::error("physical_resource_owner::%s called. physical I/O memory unmapped?\n"
00074                    "  "l4_gpa_fmt"-"l4_gpa_fmt" ["l4_gpa_fmt"]\n",
00075                    __func__, base, base + size - 1, size);
00076         enter_kdebug(" physical I/O memory unmapped? ");
00077         return -L4_ENOTSUPP;
00078     }
00079 
00080     //
00081     // irq_source: override irq_moved
00082     //
00083     virtual void irq_moved(l4_irq_t from, l4_irq_t to)
00084     {
00085         log::error("physical_resource_owner::%s called. this should never happen.\n"
00086                    "  moved IRQ "l4_irq_fmt" to "l4_irq_fmt"\n",
00087                    __func__, from , to);
00088         enter_kdebug(" moved physical IRQ ");
00089     }
00090 };
00091 
00092 #endif
00093 
00094 // ***** end of source ***** //
00095 

L4vmm Reference Manual, written by Mario Schwalbe  © 2006-2008