📄 adp.h
字号:
#define ADP_ANGELVSN_UNKYPE_SHIFT (24)
/* Currently only 8 bits are used in the word: */
/* ADP protocol supported by target [Reference (2)] */
#define ADP_ANGELVSN_ADP_MASK (0x000000FF)
#define ADP_ANGELVSN_ADP_SHIFT (0)
/* ARM Architecture info: [Reference (3)] */
/* ARM Architecture Verson of target CPU */
#define ADP_ARM_ARCH_VSN_MASK (0x000000FF)
#define ADP_ARM_ARCH_VSN_SHIFT (0)
/* Does the processor support the Thumb Instruction Set */
#define ADP_ARM_ARCH_THUMB (0x80000000)
/* Does the processor support Long Multiplies */
#define ADP_ARM_ARCH_LONGMUL (0x40000000)
/* All other flags are current undefined, and should be zero. */
/* The following flags describe the feature set of the processor: */
/* Set if cpu supports little-endian model [Reference (4)] */
#define ADP_CPU_LE (1 << 0)
/* Set if cpu supports big-endian model */
#define ADP_CPU_BE (1 << 1)
/* Set if processor has a cache */
#define ADP_CPU_CACHE (1 << 2)
/* Set if processor has a MMU */
#define ADP_CPU_MMU (1 << 3)
/* All other flags are current undefined, and should be zero. */
/* The following flags reflect current Target hardware status: */
/* [Reference (5)] */
/* 0 = no MMU or MMU off; 1 = MMU on */
#define ADP_CPU_MMUOn (1 << 29)
/* 0 = no cache or cache off; 1 = cache on */
#define ADP_CPU_CacheOn (1 << 30)
/* 0 = little-endian; 1 = big-endian */
#define ADP_CPU_BigEndian (1U << 31)
/* All other flags are current undefined, and should be zero. */
#ifdef LINK_RECOVERY
#define ADP_TargetResetIndication ADPREASON(CI_TBOOT, 1)
/*
* If parameter negotiation is enabled at the target, it configures itself
* to various likely parameter settings and sends this message at each
* configuration. The message describes the default settings, and after
* sending at each configuration the target sets itself to the defaults
* it has just broadcast, to await either an ack on TBOOT or a request
* or reset indication on HBOOT.
*
* If the host receives this message successfully, it should reset to the
* indicated parameters and send a reply.
*
* Message arguments:
* word status (always 0, makes body same as
* ADP_ParamNegotiate response)
* word n-parameters
* n-parameters * {
* word ADP_Parameter
* word parameter-value
* }
*
* Reply:
* - empty acknowledgement
*/
#endif /* def LINK_RECOVERY */
typedef enum ADP_Boot_Ack {
AB_NORMAL_ACK, /* will comply, immediate booted message */
AB_LATE_ACK, /* will comply, late startup */
AB_ERROR /* cannot comply */
} ADP_Boot_Ack;
/* If the host sets neither of these in the word sent on a Reset / Reboot
* then it doesn;t care about the endianess of the target
*/
#define ADP_BootHostFeature_LittleEnd 0x80000000
#define ADP_BootHostFeature_BigEnd 0x40000000
#define ADP_Reboot ADPREASON(CI_HBOOT,2)
/* This message is sent when the host wants the target system to be
* completely reset, back to the boot monitor Angel. This is the
* method of the host forcing a cold-reboot.
* Note that an acknowledgement message will be sent immediately and
* that this must be sent before the target can reset.
*
* The parameter to this function is a bitset of host supported
* features. (in fact the same as ADP_Reset below. This can be used by
* the target system to avoid using debug channel bandwidth raising
* messages that will be ignored by the host.
*
* Parameters:
* word host supported features (see above)
*
* Reply:
* word status, one of enum ADP_Boot_Ack above.
*
* Currently there are no such features defined, so the word indicating
* host supported features should be set to 0.
*/
#define ADP_Reset ADPREASON(CI_HBOOT,3)
/* This message is a request from the host, which should eventually
* result in the "ADP_Booted" message being sent by the target.
* Note that an acknowledgement message will be sent immediately and
* that this must be sent before the target can reset.
* This reset message is *ALWAYS* treated as a warm boot, with the target
* preserving as much state as possible.
*
* The parameter to this function is a bitset of host supported
* features. This can be used by the target system to avoid using
* debug channel bandwitdth raising messages that will be ignored by
* the host.
*
* Parameters:
* word host supported features (see above)
*
* Reply:
* word status, one of enum ADP_Boot_Ack above.
*
* Currently there are no such features defined, so the word indicating
* host supported features should be set to 0.
*/
#ifdef LINK_RECOVERY
#define ADP_HostResetIndication ADPREASON(CI_HBOOT, 4)
/*
* This is as for ADP_TargetResetIndication, but is sent by the host when
* it first starts up in case the target is listening at a non-default
* setting. Having sent at various configurations, the host then listens
* at the defaults it has just broadcast, to await either an ack on HBOOT
* or a reset indication on TBOOT.
*
* For arguments and reply, see ADP_TargetResetIndication.
*/
#endif /* def LINK_RECOVERY */
#define ADP_ParamNegotiate ADPREASON(CI_HBOOT, 5)
/*
* The host sends this messages to negotiate new parameters with the target.
* For each parameter the host specifies a range of possibilities, starting
* with the most favoured. All possible combinations of parameters
* must be valid.
*
* If the target can operate at a combination of the offered parameters,
* it will reply with the parameters it is willing to use. AFTER sending
* the reply, the target switches to this combination. On receiving the
* reply, the host will switch to the new combination and send a LinkCheck
* message (see below).
*
* If the target cannot operate at any combination of the offered parameters,
* it will reply with an error status.
*
* Message arguments:
* word n-parameter-blocks
* n-parameter-blocks * {
* word ADP_Parameter
* word n-options
* n-options * { word parameter-value }
* }
*
* Reply:
* word status
* if (status == RDIError_NoError) {
* word n-parameters
* n-parameters * {
* word ADP_Parameter
* word chosen-value
* }
* }
*/
#define ADP_LinkCheck ADPREASON(CI_HBOOT, 6)
/*
* This should be the first message that the host sends after a successful
* parameter negotiation. It is really just a 'ping'.
*
* Message arguments:
* - empty message
*
* Reply:
* - empty acknowledgement
*/
/********************************************************************
*
* CI_HADP messages
*
*/
#define ADP_HADPUnrecognised ADPREASON(CI_HADP,0)
/* This message is unusual in that it is normally sent in reply to
* another message which is not understood. This is an exception
* to the normal protocol which says that a reply must have the
* same base reason code as the original. There is a single reply
* parameter which is the reason code which was not understood.
*
* As well as being a reply this message can also be sent and will
* return as if this message were unrecognised!
*
* Parameters:
* none
*
* Reply:
* word reason code which was not recognised
*/
#define ADP_Info ADPREASON(CI_HADP,1)
/* This is the new ADP information message. It is used to interrogate
* the target debug agent. It provides information on the processor,
* as well as the state of the debug world. This allows the host to
* configure itself to the capabilities of the target.
*
* We try not to use feature bitsets, since we could quickly run out
* of known bits. Thus when the feature set is extended, this can be
* done in a couple of supported ways:
*
* If an undivided reason code is to be added (no reason subcodes)
* then add a new ADP_Info code which responds with a flag indicating
* whether that feature is supported by the target. If this has not
* even been implemented then the reply will be ADP_HADPUnrecognised
*
* If a reason code which is subdivided into reason subcodes is
* added then reason subcode 0 should be set aside to indicate
* whether the functionality of that reason code is supported
* by the target. If it is not even implemented then the reply will
* be ADP_Unrecognised.
*
* The first parameter to ADP_Info is a reason subcode, and subsequent
* parameters are defined by that subcode
*
* Parameters:
* word reason subcode
* other arguments as reason subcode determines.
*
* Reply:
* word reason subcode
* other argument as reason subcode determines
*/
/* ADP_Info reason subcodes: */
#define ADP_Info_NOP ADPSUBREASON(CI_HADP,0)
/* ADP_Info_NOP
* ------------
* Summary: This message is used to check for ADP_Info being supported.
*
* Arguments:
* Send: ()
* Return: (word status)
*
* 'status' returns RDIError_NoError for success, non-zero indicates an error.
* If an error is returned then there is no handler for the ADP_Info
* message. The normal action will be to return an OK status.
*/
#define ADP_Info_Target ADPSUBREASON(CI_HADP,1)
/* ADP_Info_Target
* ---------------
* Summary:
* This reason code is used to interrogate target system details.
*
* Arguments:
* Send: ()
* Return: (word status, word bitset, word model)
*
* 'status' is RDIError_NoError to indicate OK, or non-zero to indicate
* some sort of error.
* 'bitset' is described in more detail below, and is mostly compatible
* with the old RDI/RDP system to avoid gratuitous changes to the debugger
* toolbox.
* 'model' is the target hardware ID word, as returned by the ADP_Booted
* message.
*
* NOTE: The minimum and maximum protocol levels are no longer supported.
* It is the Angel view that debugging complexity should be shifted to the
* host if at all possible. This means that the host debugger should
* always try to configure itself to the features available in the target
* debug agent. This can be done by checking individual messages, rather
* than by a blanket version number dictating the feature set.
*/
/* 'bitset':- */
/* Target speed in instructions per second = 10**(bits0..3). */
#define ADP_Info_Target_LogSpeedMask (0xF)
/* Target is running on [0 = emulator / 1 = hardware] */
#define ADP_Info_Target_HW (1 << 4)
/* Bits 5..10 are currently undefined and should be zero. */
/* Other bis are kept the same as the RDP in order to */
/* eliminate the need to change the position of some bits */
/* If set then the debug agent can be reloaded. */
#define ADP_Info_Target_CanReloadAgent (1 << 11)
/* Can request AngelBufferSize information. */
#define ADP_Info_Target_CanInquireBufferSize (1 << 12)
/* Bit 13 is no longer required as it inquired whether
* a special RDP Interrupt code was supported
*/
/* Debug agent can perform profiling. */
#define ADP_Info_Target_Profiling (1 << 14)
/* Debug agent can support Thumb code. */
#define ADP_Info_Target_Thumb (1 << 15)
/* Bit 16 was the communications channel check.
* This is always available on Angel systems.
*/
#define ADP_Info_Points ADPSUBREASON(CI_HADP,2)
/* ADP_Info_Points
* ---------------
* Summary: Returns a 32bit wide bitset of break- and watch-point
* features supported by the target debug agent.
*
* Arguments:
* Send: ()
* Return: (word status, word breakinfo)
*
* 'status' returns RDIError_NoError on success or non-zero to indicate
* some sort of error.
* 'breakinfo' is a 32bit wide bitset described in detail below. Note
* that only bits 1..12 are used.
*/
/* 'breakinfo':- */
/* Can trap on address equality. */
#define ADP_Info_Points_Comparison (1 << 0)
/* Can trap on address range. */
#define ADP_Info_Points_Range (1 << 1)
/* Can trap on 8bit memory reads. */
#define ADP_Info_Points_ReadByteWatch (1 << 2)
/* Can trap on 16bit memory reads. */
#define ADP_Info_Points_ReadHalfWatch (1 << 3)
/* Can trap on 32bit memory reads. */
#define ADP_Info_Points_ReadWordWatch (1 << 4)
/* Can trap on 8bit write accesses. */
#define ADP_Info_Points_WriteByteWatch (1 << 5)
/* Can trap on 16bit write accesses. */
#define ADP_Info_Points_WriteHalfWatch (1 << 6)
/* Can trap on 32bit write accesses. */
#define ADP_Info_Points_WriteWordWatch (1 << 7)
/* Like range, but based on address bitmask<. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -