📄 rpccore.c
字号:
*/LOCAL UINT32 rpcCoreMemProtect ( WDB_MEM_REGION * pWdbMemRegion /* memory region to protect */ ) { /* * check the easy case: no memory to protect. In this case exit * the backend fonction and return OK. */ if (pWdbMemRegion->numBytes == 0) return (OK); /* * call the WDB_MEM_PROTECT service via the backend client in order * to fill the memory region pointed to by pWdbMemRegion. */ return (rpcCoreClntCall (WDB_MEM_PROTECT, xdr_WDB_MEM_REGION, (char *) pWdbMemRegion, xdr_void, NULL)); }#if 0 /* XXX P_M for now *//********************************************************************************* rpcCoreMemWriteMany - write many target memory blocks** This function writes many target memory blocks with only one request. This* WDB service allows to reduce the request number. The target memory blocks* are described by the MANY_DATA structure pointed to by <pManyData>. The* WDB_MEM_WRITE_MANY service is called via the backend client. The WDB target* agent replies by a status. This status is equal to ERROR if the target* memory can't be written or the RPC request fails. Otherwise OK is returned.** The target memory is directly written by the xdr_MANY_DATA function. This XDR* function called by the WDB target agent decodes the MANY_DATA structure* and writes the data in the target memory. This mechanism avoid to save the* data in a tempory buffer and after to perform the copy in the memory.** RETURNS: ERROR is the target memory can't be written ot the RPC request * fails. In this case the errno global variable handles the error * number. Otherwise OK is returned.*/LOCAL UINT32 rpcCoreMemWriteMany ( MANY_DATA * pManyData /* data block description */ ) { /* * call the WDB_MEM_WRITE_MANY service via the backend client in order * to write many memory blocks pointed to by pManyData. */ return (rpcCoreCallStatus (WDB_MEM_WRITE_MANY, xdr_WRITE_MANY, (char *) pManyData)); return (WTX_ERR_AGENT_UNSUPPORTED_REQUEST); }/********************************************************************************* rpcCoreMemWriteManyInts - write many integers on the target memory** This function writes many integers on the target memory with only one* request. This WDB service allows to reduce the request number sent to the * WDB target agent. The different target memory addresses to write are* described by the MANY_INTS structure pointed to by <pManyInts>. The* WDB_MEM_WRITE_MANY_INTS service is called via the backend client. The WDB* target replies by a status. This status is equal to ERROR if the target* memory can't be written or the RPC request fails. Otherwise OK is returned.** The target memory is directly written by the xdr_WRITE_MANY_INTS function.* This XDR function called by the WDB target agent decodes the MANY_INTS* structure and writes the different integers in the target memory. This* mechanism avoid to save the integers in a tempory buffer and after to perform* the copy in the memory.* * RETURNS: ERROR is the target memory can't be written ot the RPC request* fails. In this case the errno global variable handles the error* number. Otherwise OK is returned.*/LOCAL UINT32 rpcCoreMemWriteManyInts ( MANY_INTS * pManyInts ) { /* * call the WDB_MEM_WRITE_MANY_INTS service via the backend client in order * to write many integers in the target memory pointed to by pManyInts. */#if 0 /* XXX P_M for now */ return (rpcCoreCallStatus (WDB_MEM_WRITE_MANY_INTS, xdr_WRITE_MANY_INTS, (char *) pManyInts));#endif /* XXX P_M */ return (WTX_ERR_AGENT_UNSUPPORTED_REQUEST); }#endif /* XXX P_M *//********************************************************************************* rpcCoreMemMove - move a memory block.** This function copies a target memory block to another target memory block.* Note that the source and destination blocks should not overlap.** RETURNS: ERROR if the memory region is invalid or the RPC request fails* In this case the errno global variable handles the error number.* Otherwise OK is returned.*/LOCAL UINT32 rpcCoreMemMove ( WDB_MEM_REGION * pWdbMemRegion /* memory region to copy */ ) { /* * check the easy case: no memory to copy. In this case exit the backend * fonction and return OK. */ if (pWdbMemRegion->numBytes == 0) return (OK); /* call the WDB_MEM_MOVE service */ return (rpcCoreClntCall (WDB_MEM_MOVE, xdr_WDB_MEM_REGION, (char *) pWdbMemRegion, xdr_void, NULL)); }/********************************************************************************* rpcCoreMemScan - Search for pattern in Target memory*** RETURNS: OK, or ERROR.*/LOCAL UINT32 rpcCoreMemScan ( WDB_MEM_SCAN_DESC * pWdbMemScan, /* scan descriptor */ TGT_ADDR_T * pAdrs /* addr found or -1 */ ) { *pAdrs = 0; /* call the WDB_MEM_SCAN service via the backend client */ return (rpcCoreClntCall (WDB_MEM_SCAN, (xdrproc_t) xdr_WDB_MEM_SCAN_DESC, (char *) pWdbMemScan, (xdrproc_t) xdr_TGT_ADDR_T, (char *) pAdrs)); }/********************************************************************************* rpcCoreContextCreate - create a context on the target** This function creates a context on the target baord. The context to create* description is handles by the CONTEXT_DESC structure pointed to by* <pContextDesc>. This context description is sent to the WDB_CONTEXT_CREATE* service via the backend client. The agent replies by a RESULT_STATUS* struture. The val field of this structure handles the created context ID.* If an error occurs or the RPC request fails the RESULT_STATUS errCode field* will handle the error number.* * RETURNS: Always a pointer to a RESULT_STATUS structure. */LOCAL UINT32 rpcCoreContextCreate ( WDB_CTX_CREATE_DESC * pWdbContextDesc, /* context desciption */ UINT32 * pCid /* context id */ ) { /* clear the memory used to save the context id */ *pCid = 0; /* * call the WDB_CONTEXT_CREATE service via the backend client in order * to create new context pointed to by pContextDesc. */ return (rpcCoreClntCall (WDB_CONTEXT_CREATE, xdr_WDB_CTX_CREATE_DESC, (char *) pWdbContextDesc, xdr_UINT32, (char *) pCid)); }/********************************************************************************* rpcCoreContextKill - destroy a context** This function kills a specific context on the target board. The context to * kill is handled by the CONTEXT structure pointed to by <pContext>. The* WDB_CONTEXT_KILL service is called via the backend client. The agent replies* by a STATUS. This status is equal to ERROR if the context can't be killed* or the RPC request fails. Otherwise OK is returned.* * RETURNS: ERROR if the context can't be killed or the RPC request fails. In* this case the errno global variable handles the error number.* Otherwise OK is returned.*/LOCAL UINT32 rpcCoreContextKill ( WDB_CTX * pWdbContext /* context to kill */ ) { /* * call the WDB_CONTEXT_KILL service via the backend client in order * to kill a context pointed to by pContext. */ return (rpcCoreClntCall (WDB_CONTEXT_KILL, xdr_WDB_CTX, (char *) pWdbContext, xdr_void, NULL)); }/********************************************************************************* rpcCoreContextSuspend - suspend a context** This function suspends a specific context on the target board. The context to* suspend is described by the CONTEXT structure pointed to by <pContext>. * The WDB_CONTEXT_SUSPEND service is called via the backend client. The WDB* agent replies by a STATUS. This status is equal to ERROR if the context * can't be suspended or the RPC request fails. Otherwise OK is returned.** RETURNS: ERROR if the context can't be suspended or the RPC request fails. In* this case the errno global variable handles the error number.* Otherwise OK is returned.*/LOCAL UINT32 rpcCoreContextSuspend ( WDB_CTX * pWdbContext /* context to suspend */ ) { /* * call the WDB_CONTEXT_SUSPEND service via the backend client in order * to suspend a context pointed to by pContext. */ return (rpcCoreClntCall (WDB_CONTEXT_SUSPEND, xdr_WDB_CTX, (char *) pWdbContext, xdr_void, NULL)); }/********************************************************************************* rpcCoreContextResume - resume a suspended context** This function resumes a suspended context on the target board. The context to* resume is handled by a CONTEXT structure pointed to by the <pContext>. The* WDB_CONTEXT_RESUME service is called via the backend client. The WDB target* agent replies by a STATUS. This status is equal to ERROR if the context* can't be resumed or the RPC request fails. Otherwise OK is returned.** RETURNS: ERROR if the context can't be resumed or the RPC request fails. In* this case the errno global variable handles the error number.* Otherwise OK is returned.*/LOCAL UINT32 rpcCoreContextResume ( WDB_CTX * pWdbContext /* context to resume */ ) { /* * call the WDB_CONTEXT_RESUME service via the backend client in order * to resume a context pointed to by pContext. */ return (rpcCoreClntCall (WDB_CONTEXT_RESUME, xdr_WDB_CTX, (char *) pWdbContext, xdr_void, NULL)); }/********************************************************************************* rpcCoreContextStatusGet - get a context status** This function returns the status of a context on the target board. The * context to test is handled by a CONTEXT structure pointed to by the * <pContext>. The WDB_CONTEXT_STATUS_GET service is called via the backend * client. The WDB target agent replies by a RESULT_STATUS structure.* The val field of this structure handles the context status.* If an error occurs or the RPC request fails the RESULT_STATUS errCode field* will handle the error number.** RETURNS: ERROR if we can't get the status of the context or the RPC * request fails. In this case the errno global variable handles* the error number. Otherwise OK is returned.*/LOCAL UINT32 rpcCoreContextStatusGet ( WDB_CTX * pWdbContext, /* context to get status of */ UINT32 * pCtxStatus /* context status */ ) { /* clear the memory used to save the context status */ *pCtxStatus = 0; /* * call the WDB_CONTEXT_STATUS_GET service via the backend client in order * to get the status of the context pointed to by pContext. */ return (rpcCoreClntCall (WDB_CONTEXT_STATUS_GET, xdr_WDB_CTX, (char *) pWdbContext, xdr_UINT32, (char *) pCtxStatus)); }/********************************************************************************* rpcCoreContextCont - continue a suspended context** This function continues a suspended context on the target board. The suspended* context to continue is described by a CONTEXT structure pointed to by* <pContext>. The WDB_CONTEXT_CONT service is called via the backend client.* The WDB target agent replies by a STATUS. This status is equal to ERROR* if the context can't be contined or the RPC request fails. Otherwise OK* is returned.** RETURNS: ERROR if the context can't be contined or the RPC request fails. In* this case the errno global variable handles the error number.* Otherwise OK is returned.*/LOCAL UINT32 rpcCoreContextCont ( WDB_CTX * pWdbContext /* context to continue */ ) { /* * call the WDB_CONTEXT_CONT service via the backend client in order * to continue a suspended context pointed to by pContext. */ return (rpcCoreClntCall (WDB_CONTEXT_CONT, xdr_WDB_CTX, (char *) pWdbContext, xdr_void, NULL)); }/********************************************************************************* rpcCoreContextStep - single step a context** This function single steps a specific context on the target board. The* context to step and the step length is describes by a CONTEXT_STEP structure* pointed to by <pContextStep>. The WDB_CONTEXT_STEP service is called via the* backend client. The WDB target agent replies by a STATUS. This status is* equal to ERROR if the context can't be stepped or the RPC request fails.* Otherwise OK is returned.* * RETURNS: ERROR if the context can't be stepped or the RPC request fails. In* this case the errno global variable handles the error number.* Otherwise OK is returned.*/LOCAL UINT32 rpcCoreContextStep
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -