Overview   API Reference  

arm_machine.hpp

00001 #if !defined(__ARM_MACHINE_HPP__)
00002 #define __ARM_MACHINE_HPP__
00003 
00004 //
00005 // local includes
00006 //
00007 #include "core/machine/machine_base.hpp"
00008 
00013 struct arm_machine : public machine_base
00014 {
00015   protected:
00020     pci_bridge_base host_bridge;        // or inherit a special class for ARM
00021 
00022   public:
00023     arm_machine(void);
00024 
00025     //
00026     // instruction emulation functions
00027     //
00028     int emulate_instruction(arm_context &ctx);
00029 
00030   protected:
00031     //
00032     // machine_base: override name & get_host_bridge
00033     //
00034     virtual inline const char *name(void) const
00035     {
00036         return "ARM machine";
00037     }
00038 
00039     virtual inline pci_bridge &get_host_bridge(void)
00040     {
00041         return host_bridge;
00042     }
00043 };
00044 
00045 //
00046 // implemented here to get inlined in l4vmm_handle_exception
00047 //
00048 inline int arm_machine::emulate_instruction(arm_context &ctx)
00049 {
00050     if (config.is(L4VMM_INVALID_INSTRUCTION_WARNING))
00051         log::error("cannot handle instruction at "l4_gva_fmt":\n"
00052                    "   r0: "l4_umword_fmt"   r1: "l4_umword_fmt"\n"
00053                    "   r2: "l4_umword_fmt"   r3: "l4_umword_fmt"\n"
00054                    "   r4: "l4_umword_fmt"   r5: "l4_umword_fmt"\n"
00055                    "   r6: "l4_umword_fmt"   r7: "l4_umword_fmt"\n"
00056                    "   r8: "l4_umword_fmt"   r9: "l4_umword_fmt"\n"
00057                    "  r10: "l4_umword_fmt"  r11: "l4_umword_fmt"\n"
00058                    "  r12: "l4_umword_fmt"   sp: "l4_umword_fmt"\n"
00059                    "  pfa: "l4_umword_fmt"  ulr: "l4_umword_fmt"\n"
00060                    "  err: "l4_umword_fmt" cpsr: "l4_umword_fmt"\n",
00061                    ctx.pc(),
00062                    ctx.r0(), ctx.r1(), ctx.r2(), ctx.r3(),
00063                    ctx.r4(), ctx.r5(), ctx.r6(), ctx.r7(),
00064                    ctx.r8(), ctx.r9(), ctx.r10(), ctx.r11(),
00065                    ctx.r12(), ctx.sp(),
00066                    ctx.pfa(), ctx.ulr(), ctx.err(), ctx.cpsr());
00067 
00068     return -L4_ENOTSUPP;
00069 }
00070 
00071 #endif
00072 
00073 // ***** end of source ***** //
00074 

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