📄 acecpu32backend.h
字号:
#ifndef TGT_LINK_BDM_ACE // Should be defined in tgtlib.h#define TGT_LINK_BDM_ACE (0x201) /* ACE BDM support */#endif////////////////////////////////////////////////////////////////////////////////// Declare back end class Ace_T to operate ACE's SuperBDM emulator.class Ace_T;class Ace_T : public Backend_T { public: // Constructors and Destructors. Ace_T (char * tgtName, u_int timeout, u_int retryNum, char * devName, u_int param, TGT_OPS * pTgtOps, EXT_FUNCS * pExtFunc); virtual ~Ace_T (); //////////////////////////////////////////////////////////////////////////// // Declare back end member functions which need to be overridden in // the vendor-specific back end. // Declaration of mandatory member functions. UINT32 tgtPing_m (void); UINT32 tgtConnect_m (WDB_TGT_INFO * pTgtInfo); UINT32 tgtDisconnect_m (void); UINT32 memRead_m (WDB_MEM_REGION * pMemRegion, WDB_MEM_XFER * pMemXfer); UINT32 memWrite_m (WDB_MEM_XFER * pMemXfer); UINT32 regsGet_m (WDB_REG_READ_DESC * pRegRead, WDB_MEM_XFER * pMemXfer); UINT32 regsSet_m (WDB_REG_WRITE_DESC * pRegWrite); UINT32 contextSuspend_m (WDB_CTX * pContext); UINT32 contextResume_m (WDB_CTX * pContext); UINT32 eventpointAdd_m (WDB_EVTPT_ADD_DESC * pEventPoint, UINT32 * pEvtptNum); UINT32 eventpointDelete_m (WDB_EVTPT_DEL_DESC * pEventpoint); UINT32 eventGet_m (WDB_EVT_DATA * pEvtData); UINT32 contextCont_m (WDB_CTX * pContext); UINT32 contextStep_m (WDB_CTX_STEP_DESC * pContextStep); BOOL evtPending_m (void); void evtPendingClear_m (void); UINT32 serviceCall_m (u_long procNum, FUNCPTR inProc, char * in, FUNCPTR outProc, char * out); BOOL freeResultArgs_m (void); // optional member functions#if 0 // the following methods should be supported when // ACE's API supports them. UINT32 memScan_m (WDB_MEM_SCAN_DESC * pMemScan, TGT_ADDR_T * pAdrs); UINT32 memFill_m (WDB_MEM_REGION * pMemRegion); UINT32 memMove_m (WDB_MEM_REGION * pMemRegion);#endif UINT32 cacheTxtUpdate_m (WDB_MEM_REGION * pMemRegion); // Backend_T::memChecksum_m() is overridden only because // the ACE API has low-bandwidth when reading target memory. UINT32 memChecksum_m (WDB_MEM_REGION * pMemRegion, UINT32 * pChecksumValue); //////////////////////////////////////////////////////////////////////////// // Helper Methods // mandatory helper methods virtual int fdGet_m (); // State management virtual UINT32 halt_m (); virtual UINT32 unhalt_m (); // vendor-specific helper methods // Special ACE helper methods improve performance // by only accessing one register instead of the entire // register set. virtual UINT32 regGetOne_m (uint16 aceRegNum, void * regValue); virtual UINT32 regSetOne_m (uint16 aceRegNum, void * regValue); static Ace_T * pTheAceBkEnd_s (); // handles asynchronous events in the ACE API static void eventCallBack (ACE_ConnectionHandle, ACE_Event *, void *); // Exception state management UINT32 excStateEnter_m (BDM_EXC_INFO * pExcInfo); UINT32 excStateExit_m (BOOL doStep = TRUE); UINT32 excRegsGet_m (WDB_REG_READ_DESC * pRegRead, WDB_MEM_XFER * pMemXfer); BOOL isExcState_m (); //////////////////////////////////////////////////////////////////////////// // special types for dealing with target struct REG_SET_68K; // WRS's REG_SET definition for 68k // special constants for dealing with target // MaxMtu specifies the maximum number of bytes which the // ACE back end will attempt to read or write with one call // to ACE's API. // // XXX - 4096 is actual the maximum allowed by Ethernet, however // attempts to access more than 256 bytes per transaction cause the // API to fail. enum {MaxMtu = 256}; //////////////////////////////////////////////////////////////////////////// protected: UINT32 wdbErrFigure_m (const char * pStr, int status, UINT32 wdbDefaultCode); virtual void bpEventGen_m (); // Generate dummy BP event. // Converts a WRS register specification into ACE's // enum value for the associated register. virtual UINT32 whichAceRegGet_m (UINT32 regSetOffset, ACE_Register * pWhichAceReg, uint32 * pAceRegSize); UINT32 stateBDM_m (ACE_OperatingMode & oldState); // Enter BDM mode UINT32 stateRestore_m (ACE_OperatingMode oldState); // Return to old mode void eventQueuePut_m (Event_T * pEvent); void eventQueueGet_m (WDB_EVT_DATA * pWdbEvent); //////////////////////////////////////////////////////////////////////////// // Ace_T member data static Ace_T * pTheAceBkEnd_; // ptr to back end object. ACE_ConnectionHandle emulator_; // specifies a connection via ACE's API ACE_OperatingMode oldTgtState_; // State of Target before halt_m (). // Event handling data int eventFd_; // file descriptor to wake target server on events. BOOL isEvent_; // True if there is an event on target. RWSlistCollectablesQueue eventQueue_; // FIFO Queue of emulator events // Exception state management data REG_SET_68K * pExcRegSet_; // IU Register Set of task causing exception. UINT excCount_; // counts levels of naceed exceptions. };// End of class Ace_T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// WRS's type definitions for the 68k's register set.//// This information must agree with the definition in// ${WIND_BASE}/target/h/regs.h which just// #includes the architecture-specific definition in// ${WIND_BASE}/target/h/arch/<cpuFamily>/regs<cpuFamily>.h.//// For example, this information comes from:// ${WIND_BASE}/target/h/arch/mc68k/regsMc68k.h.typedef unsigned short INSTR;struct Ace_T::REG_SET_68K { ULONG dataReg[8]; /* data registers */ ULONG addrReg[8]; /* address registers */ USHORT pad; /* pad SR to a long */ USHORT sr; /* status register (must be second to last) */ INSTR *pc; /* program counter (must be last) */ }; #ifdef WIN32typedef struct wrs_reg_set_68k { ULONG dataReg[8]; /* data registers */ ULONG addrReg[8]; /* address registers */ USHORT pad; /* pad SR to a long */ USHORT sr; /* status register (must be second to last) */ INSTR *pc; /* program counter (must be last) */ } WRS_REG_SET_68K;#endif////////////////////////////////////////////////////////////////////////////////// Inline methodsinline Ace_T * Ace_T::pTheAceBkEnd_s () { return (pTheAceBkEnd_); }inline BOOL Ace_T::isExcState_m () { return ((excCount_ > 0) ? TRUE : FALSE); }#endif /* #ifndef __INCacecpu32Backendh */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -