2 * Copyright (C) 1995 Advanced RISC Machines Limited. All rights reserved.
4 * This software may be freely used, copied, modified, and distributed
5 * provided that the above copyright notice is preserved in all copies of the
18 * The early RDP message definitions were held in an ARM Ltd "armdbg"
19 * source file. Since the relevant header files were not exported
20 * publicly as part of an ARM Ltd core tools release, it was a problem
21 * for developers manipulating the target side of the protocol.
23 * For Angel, this new (ANSI 'C' clean) header file defines the ADP
24 * protocol. The header should be useable by both host and target
25 * systems, thus avoiding problems that can arise from duplicate
26 * definitions. Care has been taken in the construction of this header
27 * file to avoid any host/target differences.
31 * Format of the "data" section of debug and boot agent messages. This is
32 * the standard ADP (Angel Debug Protocol) message format:
34 * unsigned32 reason - Main debug reason code.
35 * unsigned32 debugID - Information describing host debug world;
36 * - private to host and used in any target initiated
38 * unsigned32 OSinfo1 \ Target OS information to identify process/thread
39 * unsigned32 OSinfo2 / memory/world, etc. These two fields are target
41 * byte args[n] - Data for message "reason" code.
43 * NOTE: The message format is the same for single threaded debugging,
44 * except that the "OSinfo" fields should be -1 (0xFFFFFFFF). Even
45 * single-threaded debugging *MAY* have different host specified
46 * debugID values, so the Angel debug system will preserve the "debugID"
47 * information for replies, and the relevant asynchronous target-to-host
48 * messages. The "debugID" is defined by the host-end of the
49 * protocol, and is used by the host to ensure that messages are
50 * routed to the correct handler program/veneer.
52 * The reason there are two target specified "OSinfo" words is because
53 * thread identifiers may not be unique when processes/tasks have
54 * private virtual address spaces. It allows more flexibility when
55 * supporting multi-threaded or O/S aware debugging.
57 * NOTE: The reason that there is no "size" information, is that the
58 * message IDs themselves encode the format of any arguments. Also it
59 * would be a duplication of information used by the physical
60 * transport layer (which is distinct from this logical message
61 * layer). Any routing of messages through programs, hosts,
62 * etc. should be performed at the physical layer, or the boundaries
63 * between physical layers. i.e. packet received on socket in host,
64 * and transferred to serial packet for passing on down the line.
66 * NOTE: Pointers aren't passed in messages because they are dangerous in
67 * a multi-threaded environment.
71 * The message reason codes contain some information that ties them to
72 * the channel and direction that the message will be used with. This
73 * will ensure that even if the message "#define name" is not
74 * completely descriptive, the message reason code is.
76 * b31 = direction. 0=Host-to-Target; 1=Target-to-Host;
77 * b30-28 = debug agent multi-threaded control (see below)
78 * b27-24 = reserved. should be zero.
79 * b23-16 = channelid. The fixed Angel channel number
81 * b15-0 = message reason code.
83 * It is unfortunate that to aid the error-checking capabilities of
84 * the Angel communications we have changed the message numbers from
85 * the original ARM Ltd RDP. However this also has benefits, in that
86 * the Angel work is meant to be a clean break.
88 * However, it isn't so bad since even though the numbers are
89 * different, the majority of the reason codes have exactly the same
90 * functionality as the original RDP messages.
94 * It would be ideal to use "rpcgen" (or some equivalent) to
95 * automatically maintain compatibility between the target and host
96 * ends of the protocol. However, ARM Ltd expressed that the message
97 * handling should be hand-coded, to avoid dependance on external
100 * All other channels have undefined data formats and are purely
101 * application defined. The C library "_sys_" support will provide a
102 * veneer to perform message block operations as required.
104 * It is IMPLIED that all of the ADP messages will fit within the
105 * buffer DATASIZE. This has a minimum value, calculated from
108 * All messages are passed and received to the channel system in little
109 * endian order (ie. use little endian order when writing a word as
110 * a sequence of bytes within a message).
112 * A reply / acknowledgement to an ADP message is always sent and has the
113 * same reason code as the original except that the TtoH / HtoT bit is
114 * reversed. This makes it simple to check that the reply really
115 * is a reply to the message which was just sent! [Boot Channel messages
116 * also require that this protocol is used].
122 #include "chandefs.h"
126 * Buffer minimum sizes
129 /* the minimum target internal size */
130 #define ADP_BUFFER_MIN_SIZE (256)
132 /* a word is always reserved for internal use in the target */
133 #define ADP_BUFFER_MAX_INTERNAL (sizeof(word))
135 /* the minimum available data portion */
136 #define ADP_BUFFER_MIN_DATASIZE \
137 (ADP_BUFFER_MIN_SIZE - ADP_BUFFER_MAX_INTERNAL - CHAN_HEADER_SIZE)
140 * the space taken up by the standard ADP header
141 * (reason, debugID, OSinfo1, OSinfo2)
143 #define ADP_DEFAULT_HEADER_SIZE (4*sizeof(word))
146 /* 8bit ADP version identification */
147 #define ADPVSN (0x03)
148 /* This value can be used to identify the protocol version supported
149 * by target or host systems. This version number should only be
150 * changed if the protocol undergoes a non-backward compatible
151 * change. It should *NOT* be used to reflect extensions to the
152 * protocol. Such extensions can be added to the existing protocol
153 * version by allocating new reason codes, and by extending the
154 * ADP_Info message to identify new features.
157 /* The following value is used in the OSinfo fields for
158 * single-threaded messages, or where the host wants to alter the
159 * global CPU state. NOTE: The "debugID" field should always be
160 * defined by the host, and returned in target initiated messages. The
161 * only exception to this rule is the ADP_Booted message at the
164 #define ADP_HandleUnknown (-1)
166 /******************************************************************
168 * ADP reason code subfields
172 /* The following bits are used to describe the basic direction of
173 * messages. This allows some extra checking of message validity to be
174 * performed, as well as providing a description of the message that
175 * may not be available in the "cpp" macro:
177 #define HtoT ((unsigned)0 << 31) /* Host-to-Target message */
178 #define TtoH ((unsigned)1 << 31) /* Target-to-Host message */
180 /* The following bits are used to control how the target system
181 * executes whilst processing messages. This allows for O/S specific
182 * host-based debug programs to interrogate system structures whilst
183 * ensuring that the access is atomic within the constraints imposed
186 * NOTE: That only the channel is inserted into the reason code
187 * automatically. Thus both direction and multi thread control bits
188 * must be added by the host / target.
190 /* Disable FIQ whilst processing message */
191 #define DisableFIQ (1 << 30)
192 /* Disable IRQ whilst processing message */
193 #define DisableIRQ (1 << 29)
194 /* Disable O/S pre-emption whilst processing message */
195 #define DisablePreemption (1 << 28)
197 /* The channel identification number is held in the reason code as a
200 #define ADPCHANNEL(b) (((b) & 0xFF) << 16)
202 /* The following macro constructs the reason code number, from the
203 * various fields - note that the direction is NOT inlcuded since
204 * this depends on whether the Host or Target system is including
207 #define ADPREASON(c,r) (ADPCHANNEL(c) | ((r) & 0xFFFF))
209 /* This macros is used when constructing manifests for sub-reason
210 * codes. At the moment it is identical to the main reason macro. If
211 * desired we could add a new bit that explicitly identifies the value
212 * as a sub-reason code, where the corresponding bit in the main
213 * message ID would be zero.
215 #define ADPSUBREASON(c,r) (ADPCHANNEL(c) | ((r) & 0xFFFF))
217 /* All other undefined bits are reserved, and should be zero. */
221 /*****************************************************************
223 * channel_BOOT messages
227 /* The BOOT agent only supports a few messages. They are used purely
228 * to control the "start-of-day" connection to a host program. All
229 * Angel systems with host communications *MUST* provide the BOOT
230 * agent, even if they don't have support for either the single- or
231 * multi-threaded debug agents.
233 * The way the BOOT channel will be used on startup will be as follows:
235 * a) Target board is powered up before host debugger is invoked
237 * After switching on the target and initialisation is completed the
238 * target will send an ADP_Booted or ADP_Reset message. The debugger
239 * has not been started yet so this message will not be received. In
240 * a serial world this makes it important that any buffers on the host
241 * side are flushed during initialisation of the debugger, and in an
242 * Ethernet world it makes it important that the target can cope with the
243 * message not being received.
245 * Eventually the Debugger will be started up and will send an
246 * ADP_Reboot or ADP_Reset request. The target will respond to this with
247 * an ADP_Reboot or ADP_Reset acknowldege and will then reboot, finally
248 * sending an ADP_Rebooted when it has done all it needs to do (very little
249 * in the case of ADP_Reset, but completely rebooting in the case of
250 * ADP_Reboot). Note that it is important that an ADP_Rebooted message is
251 * sent so that the Debugger does not attempt to send any data after it has
252 * made a request to ADP_Reboot and before it receives an ADP_Rebooted, as
253 * data can be lost be the target during this time.
255 * The target and host are now ready to start a debug session.
257 * b) Target board is powered up after host debugger is invoked
259 * The debugger will send an ADP_Reboot or ADP_Reset request, but will
260 * receive no reply until the target is powered up.
262 * When the target is powered up then it will send an ADP_Rebooted
263 * message to the debugger. The debugger should accept this message
264 * even though it has received no ADP_Reboot or ADP_Reset acknowldege message
267 * The target and host are now ready to start a debug session.
270 * If at any point during the bootup sequence and ADP messages are
271 * sent down the S_DBG channel then they should be responded to with a
272 * RDI_NotInitialised error. [This should never happen however].
274 * An ADP_Boot or ADP Rebooted message should be accepted at
275 * any point, since it is possible for a catastrophe to occur (such as
276 * disconnecteing the host and target during a debug message) which
277 * requires that one or other end be reset.
282 * A list of parameter types - for now just baud rate
284 typedef enum ADP_Parameter
{
285 AP_PARAMS_START
= 0xC000,
286 AP_BAUD_RATE
= AP_PARAMS_START
,
287 /* extra parameters go in here */
289 AP_CAFE_MENU
, /* extra just for testing */
294 #define AP_NUM_PARAMS (AP_PARAMS_END - AP_PARAMS_START)
297 * Parameter types should have associated semantics which can be represented
298 * within one word per parameter, or an associated enum for choices.
300 * AP_BAUD_RATE: the word contains the exact baud rate, eg. 9600, 38400.
303 /* this is not strictly necessary, but it's an example */
304 typedef enum ADP_BaudRate
{
312 #define AB_NUM_BAUD_RATES 5 /* this is more useful, for sizing arrays */
314 /* This must be set to the max number of options per parameter type */
315 #define AP_MAX_OPTIONS (AB_NUM_BAUD_RATES)
318 #define ADP_Booted ADPREASON(CI_TBOOT,0)
319 /* This message is sent by the target after the Angel system has been
320 * initialised. This message also contains information describing the
321 * Angel world. The information can then be used to check that the
322 * target debug agent and source debugger are compatible.
325 * word Angel message default buffer size.
326 * word Angel message large buffer size (may be same as default)
327 * word Angel version ; inc. type (e.g. boot ROM) See (1)
328 * word ADP version. See (2)
329 * word ARM Architecture info See (3)
330 * word ARM CPU information ; including target endianness. See (4)
331 * word Target hardware status. See (5)
332 * word Number of bytes in banner message
333 * bytes Startup banner message (single-threaded readable
334 * descriptive text - NOT NULL terminated).
339 * 'status' returns RDIError_NoError for success, and otherwise
340 * indicates an error.
343 /* Angel version word [Reference(1)] : */
344 /* Angel version number is a 16bit BCD value */
345 #define ADP_ANGELVSN_MASK (0x0000FFFF)
346 #define ADP_ANGELVSN_SHIFT (0)
348 /* Type of Angel system */
349 #define ADP_ANGELVSN_TYPE_MASK (0x00FF0000)
350 #define ADP_ANGELVSN_TYPE_SHIFT (16)
353 ADP_AngelType_bootROM
, /* Simple ROM system providing download capability */
354 ADP_AngelType_appROM
, /* ROM based application */
355 ADP_AngelType_appDLOAD
,/* Downloaded Angel based application */
356 ADP_AngelType_Last
/* Unknown type. This typedef can be extended */
357 /* but if the host and target vsns differ */
358 /* Then one will spot that it dies not understand */
359 } ADP_Angel_Types
; /* this field and can whinge appropriately */
361 /* First unknown ADP_AngelType */
362 #define ADP_ANGELVSN_UNKTYPE_MASK (0xFF000000)
363 #define ADP_ANGELVSN_UNKYPE_SHIFT (24)
365 /* Currently only 8 bits are used in the word: */
366 /* ADP protocol supported by target [Reference (2)] */
367 #define ADP_ANGELVSN_ADP_MASK (0x000000FF)
368 #define ADP_ANGELVSN_ADP_SHIFT (0)
370 /* ARM Architecture info: [Reference (3)] */
371 /* ARM Architecture Verson of target CPU */
372 #define ADP_ARM_ARCH_VSN_MASK (0x000000FF)
373 #define ADP_ARM_ARCH_VSN_SHIFT (0)
374 /* Does the processor support the Thumb Instruction Set */
375 #define ADP_ARM_ARCH_THUMB (0x80000000)
376 /* Does the processor support Long Multiplies */
377 #define ADP_ARM_ARCH_LONGMUL (0x40000000)
378 /* All other flags are current undefined, and should be zero. */
380 /* The following flags describe the feature set of the processor: */
381 /* Set if cpu supports little-endian model [Reference (4)] */
382 #define ADP_CPU_LE (1 << 0)
383 /* Set if cpu supports big-endian model */
384 #define ADP_CPU_BE (1 << 1)
385 /* Set if processor has a cache */
386 #define ADP_CPU_CACHE (1 << 2)
387 /* Set if processor has a MMU */
388 #define ADP_CPU_MMU (1 << 3)
389 /* All other flags are current undefined, and should be zero. */
391 /* The following flags reflect current Target hardware status: */
392 /* [Reference (5)] */
393 /* 0 = no MMU or MMU off; 1 = MMU on */
394 #define ADP_CPU_MMUOn (1 << 29)
395 /* 0 = no cache or cache off; 1 = cache on */
396 #define ADP_CPU_CacheOn (1 << 30)
397 /* 0 = little-endian; 1 = big-endian */
398 #define ADP_CPU_BigEndian (1U << 31)
399 /* All other flags are current undefined, and should be zero. */
404 #define ADP_TargetResetIndication ADPREASON(CI_TBOOT, 1)
406 * If parameter negotiation is enabled at the target, it configures itself
407 * to various likely parameter settings and sends this message at each
408 * configuration. The message describes the default settings, and after
409 * sending at each configuration the target sets itself to the defaults
410 * it has just broadcast, to await either an ack on TBOOT or a request
411 * or reset indication on HBOOT.
413 * If the host receives this message successfully, it should reset to the
414 * indicated parameters and send a reply.
417 * word status (always 0, makes body same as
418 * ADP_ParamNegotiate response)
422 * word parameter-value
426 * - empty acknowledgement
429 #endif /* def LINK_RECOVERY */
431 typedef enum ADP_Boot_Ack
{
432 AB_NORMAL_ACK
, /* will comply, immediate booted message */
433 AB_LATE_ACK
, /* will comply, late startup */
434 AB_ERROR
/* cannot comply */
437 /* If the host sets neither of these in the word sent on a Reset / Reboot
438 * then it doesn;t care about the endianess of the target
440 #define ADP_BootHostFeature_LittleEnd 0x80000000
441 #define ADP_BootHostFeature_BigEnd 0x40000000
443 #define ADP_Reboot ADPREASON(CI_HBOOT,2)
444 /* This message is sent when the host wants the target system to be
445 * completely reset, back to the boot monitor Angel. This is the
446 * method of the host forcing a cold-reboot.
447 * Note that an acknowledgement message will be sent immediately and
448 * that this must be sent before the target can reset.
450 * The parameter to this function is a bitset of host supported
451 * features. (in fact the same as ADP_Reset below. This can be used by
452 * the target system to avoid using debug channel bandwidth raising
453 * messages that will be ignored by the host.
456 * word host supported features (see above)
459 * word status, one of enum ADP_Boot_Ack above.
461 * Currently there are no such features defined, so the word indicating
462 * host supported features should be set to 0.
467 #define ADP_Reset ADPREASON(CI_HBOOT,3)
468 /* This message is a request from the host, which should eventually
469 * result in the "ADP_Booted" message being sent by the target.
470 * Note that an acknowledgement message will be sent immediately and
471 * that this must be sent before the target can reset.
472 * This reset message is *ALWAYS* treated as a warm boot, with the target
473 * preserving as much state as possible.
475 * The parameter to this function is a bitset of host supported
476 * features. This can be used by the target system to avoid using
477 * debug channel bandwitdth raising messages that will be ignored by
481 * word host supported features (see above)
484 * word status, one of enum ADP_Boot_Ack above.
486 * Currently there are no such features defined, so the word indicating
487 * host supported features should be set to 0.
493 #define ADP_HostResetIndication ADPREASON(CI_HBOOT, 4)
495 * This is as for ADP_TargetResetIndication, but is sent by the host when
496 * it first starts up in case the target is listening at a non-default
497 * setting. Having sent at various configurations, the host then listens
498 * at the defaults it has just broadcast, to await either an ack on HBOOT
499 * or a reset indication on TBOOT.
501 * For arguments and reply, see ADP_TargetResetIndication.
504 #endif /* def LINK_RECOVERY */
507 #define ADP_ParamNegotiate ADPREASON(CI_HBOOT, 5)
509 * The host sends this messages to negotiate new parameters with the target.
510 * For each parameter the host specifies a range of possibilities, starting
511 * with the most favoured. All possible combinations of parameters
514 * If the target can operate at a combination of the offered parameters,
515 * it will reply with the parameters it is willing to use. AFTER sending
516 * the reply, the target switches to this combination. On receiving the
517 * reply, the host will switch to the new combination and send a LinkCheck
518 * message (see below).
520 * If the target cannot operate at any combination of the offered parameters,
521 * it will reply with an error status.
524 * word n-parameter-blocks
525 * n-parameter-blocks * {
528 * n-options * { word parameter-value }
533 * if (status == RDIError_NoError) {
542 #define ADP_LinkCheck ADPREASON(CI_HBOOT, 6)
544 * This should be the first message that the host sends after a successful
545 * parameter negotiation. It is really just a 'ping'.
551 * - empty acknowledgement
555 /********************************************************************
561 #define ADP_HADPUnrecognised ADPREASON(CI_HADP,0)
562 /* This message is unusual in that it is normally sent in reply to
563 * another message which is not understood. This is an exception
564 * to the normal protocol which says that a reply must have the
565 * same base reason code as the original. There is a single reply
566 * parameter which is the reason code which was not understood.
568 * As well as being a reply this message can also be sent and will
569 * return as if this message were unrecognised!
575 * word reason code which was not recognised
579 #define ADP_Info ADPREASON(CI_HADP,1)
580 /* This is the new ADP information message. It is used to interrogate
581 * the target debug agent. It provides information on the processor,
582 * as well as the state of the debug world. This allows the host to
583 * configure itself to the capabilities of the target.
585 * We try not to use feature bitsets, since we could quickly run out
586 * of known bits. Thus when the feature set is extended, this can be
587 * done in a couple of supported ways:
589 * If an undivided reason code is to be added (no reason subcodes)
590 * then add a new ADP_Info code which responds with a flag indicating
591 * whether that feature is supported by the target. If this has not
592 * even been implemented then the reply will be ADP_HADPUnrecognised
594 * If a reason code which is subdivided into reason subcodes is
595 * added then reason subcode 0 should be set aside to indicate
596 * whether the functionality of that reason code is supported
597 * by the target. If it is not even implemented then the reply will
598 * be ADP_Unrecognised.
600 * The first parameter to ADP_Info is a reason subcode, and subsequent
601 * parameters are defined by that subcode
604 * word reason subcode
605 * other arguments as reason subcode determines.
608 * word reason subcode
609 * other argument as reason subcode determines
612 /* ADP_Info reason subcodes: */
616 #define ADP_Info_NOP ADPSUBREASON(CI_HADP,0)
619 * Summary: This message is used to check for ADP_Info being supported.
623 * Return: (word status)
625 * 'status' returns RDIError_NoError for success, non-zero indicates an error.
626 * If an error is returned then there is no handler for the ADP_Info
627 * message. The normal action will be to return an OK status.
631 #define ADP_Info_Target ADPSUBREASON(CI_HADP,1)
635 * This reason code is used to interrogate target system details.
639 * Return: (word status, word bitset, word model)
641 * 'status' is RDIError_NoError to indicate OK, or non-zero to indicate
642 * some sort of error.
643 * 'bitset' is described in more detail below, and is mostly compatible
644 * with the old RDI/RDP system to avoid gratuitous changes to the debugger
646 * 'model' is the target hardware ID word, as returned by the ADP_Booted
649 * NOTE: The minimum and maximum protocol levels are no longer supported.
650 * It is the Angel view that debugging complexity should be shifted to the
651 * host if at all possible. This means that the host debugger should
652 * always try to configure itself to the features available in the target
653 * debug agent. This can be done by checking individual messages, rather
654 * than by a blanket version number dictating the feature set.
658 /* Target speed in instructions per second = 10**(bits0..3). */
659 #define ADP_Info_Target_LogSpeedMask (0xF)
661 /* Target is running on [0 = emulator / 1 = hardware] */
662 #define ADP_Info_Target_HW (1 << 4)
664 /* Bits 5..10 are currently undefined and should be zero. */
665 /* Other bis are kept the same as the RDP in order to */
666 /* eliminate the need to change the position of some bits */
668 /* If set then the debug agent can be reloaded. */
669 #define ADP_Info_Target_CanReloadAgent (1 << 11)
671 /* Can request AngelBufferSize information. */
672 #define ADP_Info_Target_CanInquireBufferSize (1 << 12)
674 /* Bit 13 is no longer required as it inquired whether
675 * a special RDP Interrupt code was supported
678 /* Debug agent can perform profiling. */
679 #define ADP_Info_Target_Profiling (1 << 14)
681 /* Debug agent can support Thumb code. */
682 #define ADP_Info_Target_Thumb (1 << 15)
684 /* Bit 16 was the communications channel check.
685 * This is always available on Angel systems.
688 #define ADP_Info_Points ADPSUBREASON(CI_HADP,2)
691 * Summary: Returns a 32bit wide bitset of break- and watch-point
692 * features supported by the target debug agent.
696 * Return: (word status, word breakinfo)
698 * 'status' returns RDIError_NoError on success or non-zero to indicate
699 * some sort of error.
700 * 'breakinfo' is a 32bit wide bitset described in detail below. Note
701 * that only bits 1..12 are used.
705 /* Can trap on address equality. */
706 #define ADP_Info_Points_Comparison (1 << 0)
708 /* Can trap on address range. */
709 #define ADP_Info_Points_Range (1 << 1)
711 /* Can trap on 8bit memory reads. */
712 #define ADP_Info_Points_ReadByteWatch (1 << 2)
714 /* Can trap on 16bit memory reads. */
715 #define ADP_Info_Points_ReadHalfWatch (1 << 3)
717 /* Can trap on 32bit memory reads. */
718 #define ADP_Info_Points_ReadWordWatch (1 << 4)
720 /* Can trap on 8bit write accesses. */
721 #define ADP_Info_Points_WriteByteWatch (1 << 5)
723 /* Can trap on 16bit write accesses. */
724 #define ADP_Info_Points_WriteHalfWatch (1 << 6)
726 /* Can trap on 32bit write accesses. */
727 #define ADP_Info_Points_WriteWordWatch (1 << 7)
729 /* Like range, but based on address bitmask<. */
730 #define ADP_Info_Points_Mask (1 << 8)
732 /* Multi-threaded support only - thread specific breakpoints. */
733 #define ADP_Info_Points_ThreadBreak (1 << 9)
735 /* Multi-threaded support only - thread specific watchpoints. */
736 #define ADP_Info_Points_ThreadWatch (1 << 10)
738 /* Allows conditional breakpoints. */
739 #define ADP_Info_Points_Conditionals (1 << 11)
741 /* Break- and watch-points can be interrogated */
742 #define ADP_Info_Points_Status (1 << 12)
745 #define ADP_Info_Step ADPSUBREASON(CI_HADP,3)
748 * Summary: Returns a 32bit wide bitmask of the single-stepping
749 * capabilities of the target debug agent.
753 * Return: (word status, word stepinfo)
755 * 'status' returns RDIError_NoError on success, or non-zero to indicate
756 * some kind of error.
757 * 'stepinfo' is a 32bit wide bitmask described in detail below. Note that
758 * only 3 bits are used.
762 /* Single-stepping of more than one instruction is possible. */
763 #define ADP_Info_Step_Multiple (1 << 0)
765 /* Single-stepping until next direct PC change is possible. */
766 #define ADP_Info_Step_PCChange (1 << 1)
768 /* Single-stepping of a single instruction is possible. */
769 #define ADP_Info_Step_Single (1 << 2)
772 #define ADP_Info_MMU ADPSUBREASON(CI_HADP,4)
775 * Summary: Returns information about the memory management system (if
780 * Return: (word status, word meminfo)
782 * 'status' returns RDIError_NoError to indicate success or non-zero to
783 * indicate some kind of error.
784 * 'meminfo' should be a 32bit unique ID, or zero if there is no MMU
785 * support on the target.
789 #define ADP_Info_SemiHosting ADPSUBREASON(CI_HADP,5)
790 /* ADP_Info_SemiHosting
791 * --------------------
792 * Summary: This message is used to check whether semi-hosting info calls
793 * are available on the target.
797 * Return: (word status)
799 * 'status' returns RDIError_NoError if semi-hosting info calls are available,
800 * non-zero otherwise.
804 #define ADP_Info_CoPro ADPSUBREASON(CI_HADP,6)
807 * Summary: This message checks whether CoProcessor info calls are
812 * Return: (word status)
814 * 'status' returns RDIError_NoError to indicate these facilities
815 * are supported, non-zero otherwise.
819 #define ADP_Info_Cycles ADPSUBREASON(CI_HADP,7)
822 * Summary: Returns the number of instructions and cycles executed since
823 * the target was initialised.
827 * Return: (word status, word ninstr, word Scycles, word Ncycles,
828 * word Icycles, word Ccycles, word Fcycles)
830 * 'status' is RDIError_NoError to indicate success, or non-zero if there
831 * is no target support for gathering cycle count information.
832 * 'ninstr' is the number of instructions executed.
833 * 'Scycles' is the number of S-cycles executed.
834 * 'Ncycles' is the number of N-cycles executed.
835 * 'Icycles' is the number of I-cycles executed.
836 * 'Ccycles' is the number of C-cycles executed.
837 * 'Fcycles' is the number of F-cycles executed.
841 #define ADP_Info_DescribeCoPro ADPSUBREASON(CI_HADP,8)
842 /* ADP_Info_DescribeCoPro
843 * ----------------------
844 * Summary: Describe the registers of a coprocessor. Use only if
845 * ADP_Info_CoPro return RDIError_NoError.
848 * Send: Arguments of the form:
849 * (byte cpno, byte rmin, byte rmax, byte nbytes, byte access,
850 * byte cprt_r_b0, byte cprt_r_b1, byte cprt_w_b0, byte cprt_w_b1)
851 * And a terminating byte = 0xff. Must be within maximum buffer size.
852 * Return: (word status)
854 * 'cpno' is the number of the coprocessor to be described.
855 * 'rmin' is the bottom of a range of registers with the same description.
856 * 'rmax' is the top of a range of registers with the same description.
857 * 'nbytes' is the size of the register.
858 * 'access' describes access to the register and is described in more detail
861 * If bit 2 of access is set:-
862 * 'cprt_r0' provides bits 0 to 7, and
863 * 'cprt_r1' provides bits 16 to 23 of a CPRT instruction to read the
865 * 'cprt_w0' provides bits 0 to 7, and
866 * 'cprt_w1' provides bits 16 to 23 of a CPRT instruction to write the
869 * Otherwise, 'cprt_r0' provides bits 12 to 15, and 'cprt_r1' bit 22 of CPDT
870 * instructions to read and write the register ('cprt_w0' and 'cprt_w1' are
876 #define ADP_Info_DescribeCoPro_Readable (1 << 0)
879 #define ADP_Info_DescribeCoPro_Writeable (1 << 1)
881 /* Registers read or written via CPDT instructions (else CPRT) with this
883 #define ADP_Info_DescribeCoPro_CPDT (1 << 2)
885 #define ADP_Info_RequestCoProDesc ADPSUBREASON(CI_HADP,9)
886 /* ADP_Info_RequestCoProDesc
887 * -------------------------
888 * Summary: Requests a description of the registers of a coprocessor. Use
889 * only if ADP_Info_CoPro return RDIError_NoError.
893 * Return: Arguments of the form:-
894 * (word status, byte rmin, byte rmax, byte nbytes, byte access)
895 * Followed by a terminating byte = 0xFF. Must be within maximum
897 * 'cpno' is the number of the coprocessor to describe.
898 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
899 * 'rmin' is the bottom of a range of registers with the same description.
900 * 'rmax' is the top of a range of registers with the same description.
901 * 'nbytes' is the size in bytes of the register(s).
902 * 'access' is as above in ADP_Info_DescribeCoPro.
906 #define ADP_Info_AngelBufferSize ADPSUBREASON(CI_HADP,10)
907 /* ADP_Info_AngelBufferSize
908 * ------------------------
909 * Summary: Returns the Angel buffer sizes.
913 * Return: (word status, word defaultsize, word maxsize)
915 * 'status' returns RDIError_NoError to indicate success or non-zero to
916 * indicate some kind of error.
917 * 'defaultsize' is the default Angel ADP buffer size in bytes. This is
918 * at least 256 bytes.
919 * 'maxsize' is the largest Angel ADP buffer size in bytes. This will be
920 * greater than or equal to defaultsize. The target will accept ADP messages
921 * of up to this length for download, etc.
923 * Was DownLoadSize in RDP/RDI world. This is the amount that the target
924 * should transmit in a single operation. This should now be the Angel
925 * buffer size. This information is also given in the ADP_Booted message.
927 * NOTE: The value returned should be the DATASIZE and *NOT* BUFFERDEFSIZE.
928 * This is needed to ensure that the transport protocol information
929 * can be wrapped around the data.
932 #define ADP_Info_ChangeableSHSWI ADPSUBREASON(CI_HADP,11)
933 /* ADP_Info_ChangeableSHSWI
934 * ------------------------
935 * Summary: This message is used to check whether it is possible to change
936 * which SWI's are used for semihosting.
940 * Return: (word status)
942 * 'status' returns RDIError_NoError if semi-hosting info calls are available,
943 * non-zero otherwise.
946 #define ADP_Info_CanTargetExecute ADPSUBREASON(CI_HADP,12)
947 /* ADP_Info_CanTargetExecute
948 * -------------------------
949 * Summary: This message is used to see if the target is currently in
950 * an executable state. Typically this is called after the debugger
951 * initialises. If a non-error statis is returned then the user is
952 * allowed to 'go' immediately.
956 * Return: (word status)
958 * 'status' returns RDIError_NoError if target is ready to execute.
959 * other values indicate why it cannot execute.
962 #define ADP_Info_AgentEndianess ADPSUBREASON(CI_HADP,13)
963 /* ADP_Info_AgentEndianess
964 * -------------------------
965 * Summary: This message is used to determine the endianess of the
969 * Return: (word status)
971 * status should be RDIError_LittleEndian or RDIError_BigEndian
972 * any other value indicates the target does not support this
973 * request, so the debugger will have to make a best guess, which
974 * probably means only allow little endian loadagenting.
978 #define ADP_Control ADPREASON(CI_HADP,2)
979 /* This message allows for the state of the debug agent to be
980 * manipulated by the host.
983 /* The following are sub reason codes to ADP control, the first parameter
984 * is the sub reason code which defines the format of subsequent parameters.
986 * word sub reason code
989 #define ADP_Ctrl_NOP ADPSUBREASON(CI_HADP,0)
992 * Summary: This message is used to check that ADP_Ctrl messages are
997 * Return: (word status)
999 * 'status' is RDIError_NoError to indicate ADP_Ctrl messages are
1000 * supported, non-zero otherwise.
1003 #define ADP_Ctrl_VectorCatch ADPSUBREASON(CI_HADP,1)
1004 /* ADP_Ctrl_VectorCatch
1005 * --------------------
1006 * Summary: Specifies which hardware exceptions should be reported to the
1010 * Send: (word bitmap)
1011 * Return: (word status)
1013 * 'bitmap' is a bit-mask of exceptions to be reported, described in more
1014 * detail below. A set bit indicates that the exception should be
1015 * reported to the debugger, a clear bit indicates that the corresponding
1016 * exception vector should be taken.
1017 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1021 /* Reset(branch through zero). */
1022 #define ADP_Ctrl_VectorCatch_BranchThroughZero (1 << 0)
1024 /* Undefined Instruction. */
1025 #define ADP_Ctrl_VectorCatch_UndefinedInstr (1 << 1)
1027 /* Software Interrupt. */
1028 #define ADP_Ctrl_VectorCatch_SWI (1 << 2)
1030 /* Prefetch Abort. */
1031 #define ADP_Ctrl_VectorCatch_PrefetchAbort (1 << 3)
1034 #define ADP_Ctrl_VectorCatch_DataAbort (1 << 4)
1036 /* Address Exception. */
1037 #define ADP_Ctrl_VectorCatch_AddressException (1 << 5)
1039 /* Interrupt Request. */
1040 #define ADP_Ctrl_VectorCatch_IRQ (1 << 6)
1042 /* Fast Interrupt Request. */
1043 #define ADP_Ctrl_VectorCatch_FIQ (1 << 7)
1046 #define ADP_Ctrl_VectorCatch_Error (1 << 8)
1049 #define ADP_Ctrl_PointStatus_Watch ADPSUBREASON(CI_HADP,2)
1050 /* ADP_Ctrl_PointStatus_Watch
1051 * --------------------------
1052 * Summary: Returns the hardware resource number and the type of that
1053 * resource when given a watchpoint handle. Should only be called if
1054 * the value returned by ADP_Info_Points had ADP_Info_Points_Status set.
1057 * Send: (word handle)
1058 * Return: (word status, word hwresource, word type)
1060 * 'handle' is a handle to a watchpoint.
1061 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1062 * 'hwresource' is the hardware resource number. !!!!!
1063 * 'type' is the type of the resource.
1067 #define ADP_Ctrl_PointStatus_Break ADPSUBREASON(CI_HADP,3)
1068 /* ADP_Ctrl_PointStatus_Break
1069 * --------------------------
1070 * Summary: Returns the hardware resource number and the type of that
1071 * resource when given a breakpoint handle. Should only be called if
1072 * the value returned by ADP_Info_Points had ADP_Info_Points_Status set.
1075 * Send: (word handle)
1076 * Return: (word status, word hwresource, word type)
1078 * 'handle' is a handle to a breakpoint.
1079 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1080 * 'hwresource' is the hardware resource number.
1081 * 'type' is the type of the resource.
1084 #define ADP_Ctrl_SemiHosting_SetState ADPSUBREASON(CI_HADP,4)
1085 /* ADP_Ctrl_SemiHosting_SetState
1086 * -----------------------------
1087 * Summary: Sets whether or not semi-hosting is enabled.
1090 * Send: (word semihostingstate)
1091 * Return: (word status)
1093 * 'semihostingstate' sets semi-hosting to enabled if zero, otherwise
1094 * it disables semi-hosting.
1095 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1097 * NOTE: This should only be called if ADP_Info_SemiHosting didn't return
1102 #define ADP_Ctrl_SemiHosting_GetState ADPSUBREASON(CI_HADP,5)
1103 /* ADP_Ctrl_SemiHosting_GetState
1104 * -----------------------------
1105 * Summary: Reads whether or not semi-hosting is enabled.
1109 * Return: (word status, word semihostingstate)
1111 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1112 * 'semihostingstate' is zero if semi-hosting is enabled, non-zero otherwise.
1114 * NOTE: This should only be called if ADP_Info_SemiHosting didn't return
1119 #define ADP_Ctrl_SemiHosting_SetVector ADPSUBREASON(CI_HADP,6)
1120 /* ADP_Ctrl_SemiHosting_SetVector
1121 * ------------------------------
1122 * Summary: Sets the semi-hosting vector.
1125 * Send: (word semihostingvector)
1126 * Return: (word status)
1128 * 'semihostingvector' holds the value the vector is to be set to.
1129 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1131 * NOTE: This should only be called if ADP_Info_SemiHosting didn't return
1136 #define ADP_Ctrl_SemiHosting_GetVector ADPSUBREASON(CI_HADP,7)
1137 /* ADP_Ctrl_SemiHosting_GetVector
1138 * ------------------------------
1139 * Summary: Gets the value of the semi-hosting vector.
1143 * Return: (word status, word semihostingvector)
1145 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1146 * 'semihostingvector' holds the value of the vector.
1148 * NOTE: This should only be called if ADP_Info_SemiHosting didn't return
1153 #define ADP_Ctrl_Log ADPSUBREASON(CI_HADP,8)
1156 * Summary: Returns the logging state.
1160 * Return: (word status, word logsetting)
1162 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1163 * 'logsetting' is a bitmap specifying the level of logging desired,
1164 * described in more detail below. The bits can be ORed together
1167 /* 'logsetting':- */
1170 #define ADP_Ctrl_Log_NoLogging (0)
1171 /* RDI level logging. */
1172 #define ADP_Ctrl_Log_RDI (1 << 0)
1173 /* ADP byte level logging. */
1174 #define ADP_Ctrl_Log_ADP (1 << 1)
1177 #define ADP_Ctrl_SetLog ADPSUBREASON(CI_HADP,9)
1180 * Summary: Sets the logging state.
1183 * Send: (word logsetting)
1184 * Return: (word status)
1186 * 'logsetting' is the same as in ADP_Ctrl_Log above.
1187 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1190 #define ADP_Ctrl_SemiHosting_SetARMSWI ADPSUBREASON(CI_HADP,10)
1191 /* ADP_Ctrl_SemiHosting_SetARMSWI
1192 * ------------------------------
1193 * Summary: Sets the number of the ARM SWI used for semihosting
1196 * Send: (word ARM_SWI_number)
1197 * Return: (word status)
1199 * The debug agent will interpret ARM SWI's with the SWI number specified
1200 * as semihosting SWI's.
1201 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1203 * NOTE: This should only be called if ADP_Info_ChangeableSHSWI didn't return
1208 #define ADP_Ctrl_SemiHosting_GetARMSWI ADPSUBREASON(CI_HADP,11)
1209 /* ADP_Ctrl_SemiHosting_GetARMSWI
1210 * ------------------------------
1211 * Summary: Reads the number of the ARM SWI used for semihosting
1215 * Return: (word status, word ARM_SWI_number)
1217 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1218 * ARM_SWI_number is the SWI number which is used for semihosting.
1220 * NOTE: This should only be called if ADP_Info_SemiHosting didn't return
1224 #define ADP_Ctrl_SemiHosting_SetThumbSWI ADPSUBREASON(CI_HADP,12)
1225 /* ADP_Ctrl_SemiHosting_SetThumbSWI
1226 * --------------------------------
1227 * Summary: Sets the number of the Thumb SWI used for semihosting
1230 * Send: (word Thumb_SWI_number)
1231 * Return: (word status)
1233 * The debug agent will interpret Thumb SWI's with the SWI number specified
1234 * as semihosting SWI's.
1235 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1237 * NOTE: This should only be called if ADP_Info_ChangeableSHSWI didn't return
1242 #define ADP_Ctrl_SemiHosting_GetThumbSWI ADPSUBREASON(CI_HADP,13)
1243 /* ADP_Ctrl_SemiHosting_GetThumbSWI
1244 * --------------------------------
1245 * Summary: Reads the number of the Thumb SWI used for semihosting
1249 * Return: (word status, word ARM_Thumb_number)
1251 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1252 * Thumb_SWI_number is the SWI number which is used for semihosting.
1254 * NOTE: This should only be called if ADP_Info_SemiHosting didn't return
1259 #define ADP_Ctrl_Download_Supported ADPSUBREASON(CI_HADP,14)
1260 /* ADP_Ctrl_Download_Supported
1261 * ---------------------------
1262 * Summary: Can configuration be downloaded?
1266 * Return: (word status)
1268 * 'status' is RDIError_NoError if the configuration can be downloaded,
1269 * non-zero otherwise.
1271 * NOTE: Equivalent to RDIInfo_DownLoad.
1275 #define ADP_Ctrl_Download_Data ADPSUBREASON(CI_HADP,15)
1276 /* ADP_Ctrl_Download_Data
1277 * ----------------------
1278 * Summary: Loads configuration data.
1281 * Send: (word nbytes, words data)
1282 * Return: (word status)
1284 * 'nbytes' is the number of *bytes* being sent.
1285 * 'data' is the configuration data. NOTE: data must not cause the buffer
1286 * size to exceed the maximum allowed buffer size.
1287 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1289 * NOTE: Equivalent to RDP_LoadConfigData. Should only be used if
1290 * ADP_ICEM_AddConfig didn't return an error.
1294 #define ADP_Ctrl_Download_Agent ADPSUBREASON(CI_HADP,16)
1295 /* ADP_Ctrl_Download_Agent
1296 * -----------------------
1297 * Summary: Prepares Debug Agent to receive configuration data which it
1298 * should interpret as a new version of the Debug Agent code.
1301 * Send: (word loadaddress, word size)
1302 * Return: (word status)
1304 * 'loadaddress' is the address where the new Debug Agent code should be
1306 * 'size' is the number of bytes of Debug Agent code to be loaded.
1307 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1309 * NOTE: Equivalent to RDP_LoadAgent. The data will be downloaded using
1310 * ADP_Ctrl_Download_Data. The new agent is started with ADP_Ctrl_Start_Agent
1314 #define ADP_Ctrl_Start_Agent ADPSUBREASON(CI_HADP,17)
1315 /* ADP_Ctrl_Start_Agent
1316 * -----------------------
1317 * Summary: Instruct Debug Agent to begin execution of new agent,
1318 * which has been downloaded by ADP_Ctrl_Download_Agent.
1321 * Send: (word startaddress)
1322 * Return: (word status)
1324 * 'startaddress' is the address where the new Debug Agent code should be
1325 * entered, and must satisfy:
1326 * (loadaddress <= startaddress <= (loadaddress + size))
1327 * where 'loadaddress' and 'size' were specified in the
1328 * ADP_Ctrl_Download_Agent message.
1330 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1334 #define ADP_Ctrl_SetTopMem ADPSUBREASON(CI_HADP,18)
1335 /* ADP_Ctrl_SetTopMem
1336 * ------------------
1337 * Summary: Sets the top of memory for ICEman2 systems, so that the C Library
1338 * can allocate the stack in the correct place on startup.
1341 * Send: (word mem_top)
1342 * Return: (word status)
1344 * This request should only be supported by ICEman2. Standard Angel systems
1345 * should return an error (unrecognised is fine).
1349 #define ADP_Read ADPREASON(CI_HADP,3)
1350 #define ADP_ReadHeaderSize (ADP_DEFAULT_HEADER_SIZE + 2*sizeof(word))
1354 * Summary: Request for a transer of memory contents from the target to the
1358 * Send: (word address, word nbytes)
1359 * Return: (word status, word rnbytes [, bytes data])
1361 * 'address' is the address from which memory transer should start.
1362 * 'nbytes' is the number of bytes to transfer.
1363 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1364 * 'rnbytes' holds the number of requested bytes NOT read (i.e. zero
1365 * indicates success, non-zero indicates an error).
1366 * 'data' is the number of bytes requested minus 'rnbytes'.
1371 #define ADP_Write ADPREASON(CI_HADP,4)
1372 #define ADP_WriteHeaderSize (ADP_DEFAULT_HEADER_SIZE + 2*sizeof(word))
1376 * Summary: Request for a transfer of memory contents from the debugger to
1380 * Send: (word address, word nbytes, bytes data)
1381 * Return: (word status [, word rnbytes])
1383 * 'address' is the address from which memory transer should start.
1384 * 'nbytes' is the number of bytes to transfer.
1385 * 'data' holds the bytes to be transferred.
1386 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1387 * 'rnbytes' holds the number of requested bytes NOT written (i.e. zero
1388 * indicates success, non-zero indicates an error) if status indicated an
1394 #define ADP_CPUread ADPREASON(CI_HADP,5)
1397 * Summary: This is a request to read values in the CPU.
1400 * Send: (byte mode, word mask)
1401 * Return: (word status, words data)
1403 * 'mode' defines the processor mode from which the transfer should be made.
1404 * It is described in more detail below.
1405 * 'mask' indicates which registers should be transferred. Setting a bit to
1406 * one will cause the designated register to be transferred. The details
1407 * of mask are specified below.
1408 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1409 * 'data' holds the values of the registers on successful completion,
1410 * otherwise it just holds rubbish. The lowest numbered register is
1411 * transferred first. NOTE: data must not cause the buffer size to exceed
1412 * the maximum allowed buffer size.
1416 /* The mode number is the same as the mode number used by an ARM; a value of
1417 255 indicates the current mode. */
1418 #define ADP_CPUmode_Current (255)
1420 /* 26bit user mode. */
1421 #define ADP_CPUread_26bitUser (0x0)
1423 /* 26bit FIQ mode. */
1424 #define ADP_CPUread_26bitFIQ (0x1)
1426 /* 26bit IRQ mode. */
1427 #define ADP_CPUread_26bitIRQ (0x2)
1429 /* 26bit Supervisor mode. */
1430 #define ADP_CPUread_26bitSVC (0x3)
1432 /* 32bit user mode. */
1433 #define ADP_CPUread_32bitUser (0x10)
1435 /* 32bit FIQ mode. */
1436 #define ADP_CPUread_32bitFIQ (0x11)
1438 /* 32bit IRQ mode. */
1439 #define ADP_CPUread_32bitIRQ (0x12)
1441 /* 32bit Supervisor mode. */
1442 #define ADP_CPUread_32bitSVC (0x13)
1444 /* 32bit Abort mode. */
1445 #define ADP_CPUread_32bitAbort (0x17)
1447 /* 32bit Undefined mode. */
1448 #define ADP_CPUread_32bitUndef (0x1B)
1450 /* #32bit System mode - Added in Architecture 4 ARMs e.g.ARM7TDMI */
1451 #define ADP_CPUread_32bitSystem (0x1F)
1454 /* Request registers RO-R14. */
1455 #define ADP_CPUread_RegsMask (0x7FFF)
1457 /* Request Program Counter (including mode and flag bits in 26-bit modes. */
1458 #define ADP_CPUread_PCmode (1 << 15)
1460 /* Request Program Counter (without mode and flag bits in 26-bit modes. */
1461 #define ADP_CPUread_PCnomode (1 << 16)
1463 /* Requests the transfer of the CPSR */
1464 #define ADP_CPUread_CPSR (1 << 17)
1466 /* In processor modes with an SPSR(non-user modes), bit 19 requests its
1468 #define ADP_CPUread_SPSR (1 << 18)
1472 #define ADP_CPUwrite ADPREASON(CI_HADP,6)
1475 * Summary: This is a request to write values to the CPU.
1478 * Send: (byte mode, word mask, words data)
1479 * Return: (word status)
1481 * 'mode' defines the processor mode to which the transfer should be made.
1482 * The mode number is the same as the mode number used by ARM; a value of
1483 * 255 indicates the current mode. See ADP_CPUread above for more detail.
1484 * 'mask' indicates which registers should be transferred. Setting a bit to
1485 * one will cause the designated register to be transferred. The details
1486 * of mask are specified above in ADP_CPUread.
1487 * 'data' holds the values of the registers to be transferred. The first
1488 * value is written to the lowest numbered register. NOTE: data must not
1489 * cause the buffer size to exceed the maximum allowed buffer size.
1490 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1495 #define ADP_CPread ADPREASON(CI_HADP,7)
1498 * Summary: This message requests a co-processors internal state.
1501 * Send: (byte CPnum, word mask)
1502 * Return: (word status, words data)
1504 * 'CPnum' is the number of the co-processor to transfer values from.
1505 * 'mask' specifies which registers to transfer and is co-processor
1507 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1508 * 'data' holds the registers specified in 'mask' if successful, otherwise
1509 * just rubbish. The lowest numbered register is transferred first.
1510 * NOTE: data must not cause the buffer size to exceed the maximum allowed
1516 #define ADP_CPwrite ADPREASON(CI_HADP,8)
1519 * Summary: This message requests a write to a co-processors internal state.
1522 * Send: (byte CPnum, word mask, words data)
1523 * Return: (word status)
1525 * 'CPnum' is the number of the co-processor to transfer values to.
1526 * 'mask' specifies which registers to transfer and is co-processor
1528 * 'data' holds the values to transfer to the registers specified in 'mask'.
1529 * The first value is written to the lowest numbered register.
1530 * NOTE: data must not cause the buffer size to exceed the maximum allowed
1532 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1537 #define ADP_SetBreak ADPREASON(CI_HADP,9)
1540 * Summary: Sets a breakpoint.
1543 * Send: (word address, byte type [, word bound])
1544 * Return: (word status, word pointhandle, word raddress, word rbound)
1546 * 'address' is the address of the instruction to set the breakpoint on.
1547 * 'type' specifies the sort of breakpoint and is described in more detail
1549 * 'bound' is included if the least significant 4 bits of type are set to
1550 * 5 or above (see below for more detail).
1551 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1552 * 'pointhandle' returns a handle to the breakpoint, it will be valid if bit
1553 * 7 of 'type' is set. See below for more detail.
1554 * 'raddress' is valid depending on 'type', see below for more detail.
1555 * 'rbound' is valid depending on 'type', see below for more detail.
1559 /* The least significant 4 bits define the sort of breakpoint to set:- */
1560 /* Halt if the pc is equal to 'address'. */
1561 #define ADP_SetBreak_EqualsAddress (0)
1563 /* Halt if the pc is greater than 'address'. */
1564 #define ADP_SetBreak_GreaterAddress (1)
1566 /* Halt if the pc is greater than or equal to 'address'. */
1567 #define ADP_SetBreak_GEqualsAddress (2)
1569 /* Halt if the pc is less than 'address'. */
1570 #define ADP_SetBreak_LessAddress (3)
1572 /* Halt if the pc is less than or equal to 'address'. */
1573 #define ADP_SetBreak_LEqualsAddress (4)
1575 /* Halt if the pc is in the range from 'address' to 'bound' inclusive. */
1576 #define ADP_SetBreak_Range (5)
1578 /* Halt if the pc is not in the range from 'address' to 'bound' inclusive. */
1579 #define ADP_SetBreak_NotRange (6)
1581 /* Halt if (pc & 'bound') = 'address'. */
1582 #define ADP_SetBreak_AndBound (7)
1584 /* Bits 5,6 and 7 are used as follows :- */
1585 /* If set this indicates that the breakpoint is on a 16bit (Thumb)
1586 instruction rather than a 32bit (ARM) instruction. */
1587 #define ADP_SetBreak_Thumb (1 << 4)
1589 /* This requests that the breakpoint should be conditional (execution halts
1590 only if the breakpointed instruction is executed, not if it is
1591 conditionally skipped). If bit 5 is not set, execution halts whenever
1592 the breakpointed instruction is reached (whether executed or skipped). */
1593 #define ADP_SetBreak_Cond (1 << 5)
1595 /* This requests a dry run: the breakpoint is not set and the 'raddress', and
1596 if appropriate the 'rbound', that would be used, are returned (for
1597 comparison and range breakpoints the address and bound used need not be
1598 exactly as requested). A RDIError_NoError 'status' byte indicates that
1599 resources are currently available to set the breakpoint, non-zero
1600 indicates an error. RDIError_NoMorePoints indicates that the required
1601 breakpoint resources are not currently available. */
1602 #define ADP_SetBreak_DryRun (1 << 6)
1604 /* If the request is successful, but there are no more breakpoint registers
1605 (of the requested type), then the value RDIError_NoMorePoints is
1608 /* If a breakpoint is set on a location which already has a breakpoint, the
1609 first breakpoint will be removed before the new breakpoint is set. */
1613 #define ADP_ClearBreak ADPREASON(CI_HADP,10)
1616 * Summary: Clears a breakpoint.
1619 * Send: (word pointhandle)
1620 * Return: (word status)
1622 * 'pointhandle' is a handle returned by a previous ADP_SetBreak.
1623 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1627 #define ADP_SetWatch ADPREASON(CI_HADP,11)
1630 * Summary: Sets a watchpoint.
1633 * Send: (word address, byte type, byte datatype [,word bound])
1634 * Return: (word status, word pointhandle, word raddress, word rbound)
1636 * 'address' is the address at which to set the watchpoint.
1637 * 'type' is the type of watchpoint to set and is described in detail below.
1638 * 'datatype' defines the sort of data access to watch for and is described
1639 * in more detail below.
1640 * 'bound' is included depending on the value of type (see description of
1642 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1643 * 'pointhandle' is valid depending on the value of type (see description
1645 * 'raddress' is valid depending on the value of type (see description
1647 * 'rbound' is valid depending on the value of type (see description
1652 /* The least significant 4 bits of 'type' define the sort of watchpoint to
1654 /* Halt on a data access to the address equal to 'address'. */
1655 #define ADP_SetWatch_EqualsAddress (0)
1657 /* Halt on a data access to an address greater than 'address'. */
1658 #define ADP_SetWatch_GreaterAddress (1)
1660 /* Halt on a data access to an address greater than or equal to 'address'. */
1661 #define ADP_SetWatch_GEqualsAddress (2)
1663 /* Halt on a data access to an address less than 'address'. */
1664 #define ADP_SetWatch_LessAddress (3)
1666 /* Halt on a data access to an address less than or equal to 'address'. */
1667 #define ADP_SetWatch_LEqualsAddress (4)
1669 /* Halt on a data access to an address in the range from 'address' to
1670 'bound' inclusive. */
1671 #define ADP_SetWatch_Range (5)
1673 /* Halt on a data access to an address not in the range from 'address' to
1674 'bound' inclusive. */
1675 #define ADP_SetWatch_NotRange (6)
1677 /* Halt if (data-access-address & 'bound')='address'. */
1678 #define ADP_SetWatch_AndBound (7)
1680 /* Bits 6 and 7 of 'type' also have further significance:-
1681 NOTE: they must not be simulataneously set. */
1683 /* Bit 6 of 'type' set: Requests a dry run: the watchpoint is not set and
1684 the 'address' and, if appropriate, the 'bound', that would be used are
1685 returned (for range and comparison watchpoints, the 'address' and 'bound'
1686 used need not be exactly as requested). A RDIError_NoError status byte
1687 indicates that resources are currently available to set the watchpoint;
1688 RDIError_NoMorePoints indicates that the required watchpoint resources
1689 are not currently available. */
1691 /* Bit 7 of 'type' set: Requests that a handle should be returned for the
1692 watchpoint by which it will be identified subsequently. If bit 7 is
1693 set, a handle will be returned ('pointhandle'), whether or not the
1694 request succeeds or fails (but, obviously, it will only be meaningful
1695 if the request succeesd). */
1698 /* The 'datatype' argument defines the sort of data access to watch for,
1699 values can be summed or ORed together to halt on any set of sorts of
1702 /* Watch for byte reads. */
1703 #define ADP_SetWatch_ByteReads (1)
1705 /* Watch for half-word reads. */
1706 #define ADP_SetWatch_HalfWordReads (2)
1708 /* Watch for word reads. */
1709 #define ADP_SetWatch_WordReads (4)
1711 /* Watch for half-word reads. */
1712 #define ADP_SetWatch_ByteWrites (8)
1714 /* Watch for half-word reads. */
1715 #define ADP_SetWatch_HalfWordWrites (16)
1717 /* Watch for half-word reads. */
1718 #define ADP_SetWatch_WordWrites (32)
1720 /* On successful completion a RDIError_NoError 'status' byte is returned. On
1721 unsuccessful completion, a non-zero error code byte is returned. If the
1722 request is successful, but there are now no more watchpoint registers
1723 (of the requested type), then the value RDIError_NoMorePoints is
1726 /* If a watchpoint is set on a location which already has a watchpoint, the
1727 first watchpoint will be removed before the new watchpoint is set. */
1730 #define ADP_ClearWatch ADPREASON(CI_HADP,12)
1733 * Summary: Clears a watchpoint.
1736 * Send: (word pointhandle)
1737 * Return: (word status)
1739 * 'pointhandle' is a handle to a watchpoint returned by a previous
1741 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1746 #define ADP_Execute ADPREASON(CI_HADP,13)
1749 * Summary: This message requests that the target starts executing from
1750 * the stored CPU state.
1754 * Return: (word status)
1756 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1757 * The message will *ALWAYS* respond immediately with an ACK (unlike the
1758 * old RDI definition, which allowed asynchronous message replies).
1760 * Execution will stop when allowed system events occur. The host will
1761 * be notified via a ADP_Stopped message (described below).
1766 #define ADP_Step ADPREASON(CI_HADP,14)
1769 * Summary: Execute 'ninstr' instructions.
1772 * Send: (word ninstr)
1773 * Return: (word status)
1775 * 'ninstr' is the number of instructions to execute, starting at the
1776 * address currently loaded into the CPU program counter. If it is zero,
1777 * the target should execute instructions upto the next instruction that
1778 * explicitly alters the Program Counter. i.e. a branch or ALU operation
1779 * with the PC as the destination.
1780 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1782 * The ADP_Step function (unlike the earlier RDI system) will *ALWAYS*
1783 * return an ACK immediately. A subsequent ADP_Stopped message will be
1784 * delivered from the target to the host when the ADP_Step operation
1790 #define ADP_InterruptRequest ADPREASON(CI_HADP,15)
1791 /* ADP_InterruptRequest
1792 * --------------------
1793 * Summary: Interrupt execution.
1797 * Return: (word status)
1799 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1800 * On receiving this message the target should attempt to stop execution.
1805 #define ADP_HW_Emulation ADPREASON(CI_HADP,16)
1808 * The first parameter to ADP_HW_Emulation is a Reason Subcode, and
1809 * subsequent parameters are defined by that subcode
1811 * word reason subcode
1812 * other arguments as reason subcode determines
1816 /* ADP__HW_Emulation sub-reason codes: */
1818 #define ADP_HW_Emul_Supported ADPSUBREASON(CI_HADP,0)
1819 /* ADP_HW_Emul_Supported
1820 * ---------------------
1821 * Summary: Enquires whether calls to the next 4 messages are available
1822 * (MemoryAccess, MemoryMap, Set_CPUspeed, ReadClock).
1826 * Return: (word status)
1828 * 'status' is RDIError_NoError to indicate the messages are available,
1829 * non-zero otherwise.
1831 * NOTE: Equivalent to RDI_Info_Memory_Stats.
1835 #define ADP_HW_Emul_MemoryAccess ADPSUBREASON(CI_HADP,1)
1836 /* ADP_HW_Emul_MemoryAccess
1837 * ------------------------
1838 * Summary: Get memory access information for memory block with specified
1842 * Send: (word handle)
1843 * Return: (word status, word nreads, word nwrites, word sreads,
1844 * word swrites, word ns, word s)
1846 * 'handle' is a handle to a memory block.
1847 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1848 * 'nreads' is the number of non-sequential reads.
1849 * 'nwrites' is the number of non-sequential writes.
1850 * 'sreads' is the number of sequential reads.
1851 * 'swrites' is the number of sequential writes.
1852 * 'ns' is time in nano seconds.
1853 * 's' is time in seconds.
1855 * NOTE: Equivalent to RDIMemory_Access.
1859 #define ADP_HW_Emul_MemoryMap ADPSUBREASON(CI_HADP,2)
1860 /* ADP_HW_Emul_MemoryMap
1861 * ---------------------
1862 * Summary: Sets memory characteristics.
1866 Then 'n' sets of arguments of the form:-
1867 word handle, word start, word limit, byte width,
1868 byte access, word Nread_ns, word Nwrite_ns, word Sread_ns,
1870 * Return: (word status)
1872 * 'n' is the number of sets of arguments.
1873 * 'handle' is a handle to the region.
1874 * 'start' is the start of this region.
1875 * 'limit' is the limit of this region.
1876 * 'width' is the memory width, described in detail below.
1877 * 'access' is described in detail below.
1878 * 'Nread_ns' is the access time for N read cycles in nano seconds.
1879 * 'Nwrite_ns' is the access time for N write cycles in nano seconds.
1880 * 'Sread_ns' is the access time for S read cycles in nano seconds.
1881 * 'Swrite_ns' is the access time for S write cycles in nano seconds.
1882 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1883 * NOTE: Equivalent to RDIMemory_Map.
1887 /* 8 bit memory width. */
1888 #define ADP_HW_Emul_MemoryMap_Width8 (0)
1890 /* 16 bit memory width. */
1891 #define ADP_HW_Emul_MemoryMap_Width16 (1)
1893 /* 32 bit memory width. */
1894 #define ADP_HW_Emul_MemoryMap_Width32 (2)
1897 /* Bit 0 - read access. */
1898 #define ADP_HW_Emul_MemoryMap_Access_Read (1 << 0)
1900 /* Bit 1 - write access. */
1901 #define ADP_HW_Emul_MemoryMap_Access_Write (1 << 1)
1903 /* Bit 2 - latched 32 bit memory. */
1904 #define ADP_HW_Emul_MemoryMap_Access_Latched (1 << 2)
1907 #define ADP_HW_Emul_SetCPUSpeed ADPSUBREASON(CI_HADP,3)
1908 /* ADP_HW_Emul_SetCPUSpeed
1909 * -----------------------
1910 * Summary: Sets the speed of the CPU.
1913 * Send: (word speed)
1914 * Return: (word status)
1916 * 'speed' is the CPU speed in nano seconds.
1917 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1919 * NOTE: Equivalent to RDISet_CPUSpeed.
1923 #define ADP_HW_Emul_ReadClock ADPSUBREASON(CI_HADP,4)
1924 /* ADP_HW_Emul_ReadClock
1925 * ---------------------
1926 * Summary: Reads simulated time.
1930 * Return: (word status, word ns, word s)
1932 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1933 * 'ns' is time in nano seconds.
1934 * 's' is time in seconds.
1936 * NOTE: Equivalent to RDIRead_Clock.
1940 #define ADP_ICEbreakerHADP ADPREASON(CI_HADP,17)
1942 /* The first parameter to ADP_ICEbreaker is a Reason Subcode, and
1943 * subsequent parameters are defined by that subcode
1945 * word reason subcode
1946 * other arguments as reason subcode determines
1950 /* ADP_ICEbreaker sub-reason codes: */
1952 #define ADP_ICEB_Exists ADPSUBREASON(CI_HADP,0)
1955 * Summary: Is there an ICEbreaker in the system?
1959 * Return: (word status)
1961 * 'status' is RDIError_NoError to indicate there is an ICEbreaker,
1962 * non-zero otherwise.
1966 #define ADP_ICEB_GetLocks ADPSUBREASON(CI_HADP,1)
1967 /* ADP_ICEB_GetLocks
1969 * Summary: Returns which ICEbreaker registers are locked.
1973 * Return: (word status, word lockedstate)
1975 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1976 * 'lockedstate' is a bitmap if the ICEbreaker registers locked against use
1977 * by IceMan (because explicitly written by the user). Bit n represents
1978 * hardware breakpoint n, and if set the register is locked.
1980 * NOTE: Equivalent to RDIIcebreaker_GetLocks. Should only be used if
1981 * ADP_ICEB_Exists didn't return an error.
1985 #define ADP_ICEB_SetLocks ADPSUBREASON(CI_HADP,2)
1986 /* ADP_ICEB_SetLocks
1988 * Summary: Sets which ICEbreaker registers are locked.
1991 * Send: (word lockedstate)
1992 * Return: (word status)
1994 * 'lockedstate' is the same as in ADP_ICEB_GetLocks above.
1995 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
1997 * NOTE: Equivalent to RDIIcebreaker_SetLocks. Should only be used if
1998 * ADP_ICEB_Exists didn't return an error.
2002 #define ADP_ICEB_CC_Exists ADPSUBREASON(CI_HADP,3)
2003 /* ADP_ICEB_CC_Exists
2004 * ------------------
2005 * Summary: Is there an ICEbreaker Comms Channel?
2009 * Return: (word status)
2011 * 'status' is RDIError_NoError to indicate there is a Comms Channel,
2012 * non-zero otherwise.
2014 * NOTE: Should only be used if ADP_ICEB_Exists didn't return an error.
2018 #define ADP_ICEB_CC_Connect_ToHost ADPSUBREASON(CI_HADP,4)
2019 /* ADP_ICEB_CC_Connect_ToHost
2020 * --------------------------
2021 * Summary: Connect Comms Channel in ToHost direction.
2024 * Send: (byte connect)
2025 * Return: (word status)
2028 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
2030 * NOTE: Equivalent to RDICommsChannel_ToHost. Should only be used if
2031 * ADP_ICEB_CC_Exists didn't return an error.
2035 #define ADP_ICEB_CC_Connect_FromHost ADPSUBREASON(CI_HADP,5)
2036 /* ADP_ICEB_CC_Connect_FromHost
2037 * ----------------------------
2038 * Summary: Connect Comms Channel in FromHost direction.
2041 * Send: (byte connect)
2042 * Return: (word status)
2044 * 'connect' is the same as in ADP_ICEB_CC_Connect_ToHost above.
2045 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
2047 * NOTE: Equivalent to RDICommsChannel_FromHost. Should only be used if
2048 * ADP_ICEB_CC_Exists didn't return an error.
2052 #define ADP_ICEman ADPREASON(CI_HADP,18)
2054 /* The first parameter to ADP_ICEman is a Reason Subcode, and
2055 * subsequent parameters are defined by that subcode
2057 * word reason subcode
2058 * other arguments as reason subcode determines
2062 /* ADP_ICEman sub-reason codes: */
2065 #define ADP_ICEM_AddConfig ADPSUBREASON(CI_HADP,0)
2066 /* ADP_ICEM_AddConfig
2067 * ------------------
2068 * Summary: Prepares target to receive configuration data block.
2071 * Send: (word nbytes)
2072 * Return: (word status)
2074 * 'nbytes' is the number of bytes in the configuration block.
2075 * 'status' is RDIError_NoError to indicate success, non-zero if a
2076 * configuration block of this size can't be accepted.
2078 * NOTE: Equivalent to RDP_AddConfig.
2082 #define ADP_ICEM_SelectConfig ADPSUBREASON(CI_HADP,1)
2083 /* ADP_ICEM_SelectConfig
2084 * ---------------------
2085 * Summary: Selects one of the sets of configuration data blocks and
2086 * reinitialises to use the new configuration.
2089 * Send: (byte aspect, byte namelen, byte matchtype, word vsn_req,
2091 * Return: (word status, word vsn_sel)
2093 * 'aspect' is one of two values defined below.
2094 * 'namelen' is the number of bytes in 'name'.
2095 * 'matchtype' specifies how the selected version must match that specified,
2096 * and takes one of the values defined below.
2097 * 'vsn_req' is the requested version of the named configuration.
2098 * 'name' is the name of the configuration.
2099 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
2100 * 'vsn_sel' is the version number of the configuration selected on success.
2102 * NOTE: Equivalent to RDP_SelectConfig.
2106 #define ADP_ICEM_SelectConfig_ConfigCPU (0)
2107 #define ADP_ICEM_SelectConfig_ConfigSystem (1)
2110 #define ADP_ICEM_SelectConfig_MatchAny (0)
2111 #define ADP_ICEM_SelectConfig_MatchExactly (1)
2112 #define ADP_ICEM_SelectConfig_MatchNoEarlier (2)
2115 #define ADP_ICEM_ConfigCount ADPSUBREASON(CI_HADP,2)
2116 /* ADP_ICEM_ConfigCount
2117 * --------------------
2118 * Summary: Return number of configurations.
2122 * Return: (word status [, word count])
2124 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
2125 * 'count' returns the number of configurations if status is zero.
2127 * NOTE: Equivalent to RDIConfig_Count.
2131 #define ADP_ICEM_ConfigNth ADPSUBREASON(CI_HADP,3)
2132 /* ADP_ICEM_ConfigNth
2133 * ------------------
2134 * Summary: Gets the nth configuration details.
2137 * Send: (word confign)
2138 * Return: (word status, word version, byte namelen, bytes name)
2140 * 'confign' is the number of the configuration.
2141 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
2142 * 'version' is the configuration version number.
2143 * 'namelen' is the number of bytes in 'name'.
2144 * 'name' is the name of the configuration.
2146 * NOTE: Equivalent to RDIConfig_Nth.
2151 #define ADP_Profile ADPREASON(CI_HADP,19)
2153 /* The first parameter to ADP_Profile is a Reason Subcode, and
2154 * subsequent parameters are defined by that subcode
2156 * word reason subcode
2157 * other arguments as reason subcode determines
2161 /* ADP_Profile sub-reason codes: */
2164 #define ADP_Profile_Supported ADPSUBREASON(CI_HADP,0)
2165 /* ADP_Profile_Supported
2166 * ---------------------
2167 * Summary: Checks whether profiling is supported.
2171 * Return: (word status)
2173 * 'status' is RDIError_NoError if profiling is supported, non-zero otherwise.
2175 * NOTE: Can also be determined using Info_Target.
2179 #define ADP_Profile_Stop ADPSUBREASON(CI_HADP,1)
2182 * Summary: Stops profiling.
2186 * Return: (word status)
2188 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
2190 * NOTE: Equivalent to RDIProfile_Stop.
2194 #define ADP_Profile_Start ADPSUBREASON(CI_HADP,2)
2195 /* ADP_Profile_Start
2197 * Summary: Starts profiling (PC sampling).
2200 * Send: (word interval)
2201 * Return: (word status)
2203 * 'interval' is the period of PC sampling in micro seconds.
2204 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
2206 * NOTE: Equivalent to RDIProfile_Start.
2210 #define ADP_Profile_WriteMap ADPSUBREASON(CI_HADP,3)
2211 #define ADP_ProfileWriteHeaderSize (ADP_DEFAULT_HEADER_SIZE + 4*sizeof(word))
2213 /* ADP_Profile_WriteMap
2214 * --------------------
2215 * Summary: Downloads a map array, which describes the PC ranges for profiling.
2217 * Arguments: A number of messages each of form:-
2218 * Send: (word len, word size, word offset, words map_data)
2219 * Return: (word status)
2221 * 'len' is the number of elements in the entire map array being downloaded.
2222 * 'size' is the number of words being downloaded in this message, i.e. the
2223 * length of 'map_data'.
2224 * 'offset' is the offset into the entire map array which this message starts
2226 * 'map_data' consists of 'size' words of map data.
2227 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
2229 * NOTE: Equivalent to RDIProfile_WriteMap.
2233 #define ADP_Profile_ReadMap ADPSUBREASON(CI_HADP,4)
2234 #define ADP_ProfileReadHeaderSize (ADP_DEFAULT_HEADER_SIZE + 2*sizeof(word))
2236 /* ADP_Profile_ReadMap
2237 * -------------------
2238 * Summary: Uploads a set of profile counts which correspond to the current
2241 * Arguments: A number of messages, each of the form:
2242 * Send: (word offset, word size)
2243 * Return: (word status, words counts)
2245 * 'offset' is the offset in the entire array of counts that this message
2246 * starts from, in words.
2247 * 'size' is the number of words uploaded in this message (in counts).
2248 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
2249 * 'counts' is 'size' words of profile counts.
2251 * NOTE: Equivalent to RDIProfile_ReadMap.
2255 #define ADP_Profile_ClearCounts ADPSUBREASON(CI_HADP,5)
2256 /* ADP_Profile_ClearCounts
2257 * -----------------------
2258 * Summary: Requests that PC sample counts be set to zero.
2262 * Return: (word status)
2264 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
2266 * NOTE: Equivalent to RDIProfile_ClearCounts.
2269 #define ADP_InitialiseApplication ADPREASON(CI_HADP,20)
2270 /* ADP_InitialiseApplication
2271 * -------------------------
2272 * Summary: Requests that OS setup up the thread/task so that it can be
2277 * Return: (word status)
2279 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
2282 #define ADP_End ADPREASON(CI_HADP,21)
2285 * Summary: Sent by the host debugger to tell angel this debugging session
2289 * Return: (word status)
2290 * status' is RDIError_NoError to indicate success, non-zero otherwise.
2293 /******************************************************************
2299 #define ADP_TADPUnrecognised ADPREASON(CI_TADP,0)
2300 /* This message is unusual in that it is normally sent in reply to
2301 * another message which is not understood. This is an exception
2302 * to the normal protocol which says that a reply must have the
2303 * same base reason code as the original. There is a single reply
2304 * parameter which is the reason code which was not understood.
2306 * As well as being a reply this message can also be sent and will
2307 * return as if this message were unrecognised!
2313 * word reason code which was not recognised
2316 /*-------------------------------------------------------------------------*/
2318 #define ADP_Stopped ADPREASON(CI_TADP,1)
2321 * Summary: This message is sent to the host when the application stops,
2322 * either naturally or due to an exception.
2325 * word reason subcode
2326 * other arguments as reason subcode determines.
2327 * Unless stated otherwise (below) there will be none.
2330 * word status unless reason subcode says otherwise
2332 * This message is sent to the host when execution has stopped. This
2333 * can be when the end of the application has been reached, or as the
2334 * result of an exception. It can also be the return from an ADP_Step
2335 * process, when the requested number of instructions have been
2336 * executed., or a breakpoint or watchpoint has been hit etc.
2339 /* The first set of Stopped subreason codes are for the ARM hardware
2340 * vectors. These events will be raised if the
2341 * ADP_Control_Vector_Catch allows, or if the target application has
2342 * not provided its own handlers.
2344 #define ADP_Stopped_BranchThroughZero ADPSUBREASON(CI_TADP,0)
2345 #define ADP_Stopped_UndefinedInstr ADPSUBREASON(CI_TADP,1)
2346 #define ADP_Stopped_SoftwareInterrupt ADPSUBREASON(CI_TADP,2)
2347 #define ADP_Stopped_PrefetchAbort ADPSUBREASON(CI_TADP,3)
2348 #define ADP_Stopped_DataAbort ADPSUBREASON(CI_TADP,4)
2349 #define ADP_Stopped_AddressException ADPSUBREASON(CI_TADP,5)
2350 #define ADP_Stopped_IRQ ADPSUBREASON(CI_TADP,6)
2351 #define ADP_Stopped_FIQ ADPSUBREASON(CI_TADP,7)
2353 /* We leave the rest of what would be the bits in the VectorCatch
2354 * bitmask free for future expansion.
2357 /* The following are software reasons for execution stopping: */
2358 #define ADP_Stopped_BreakPoint ADPSUBREASON(CI_TADP,32)
2359 /* Breakpoint was reached
2360 * extra send parameter: word handle - indicates which breakpoint
2363 #define ADP_Stopped_WatchPoint ADPSUBREASON(CI_TADP,33)
2364 /* Watchpoint was triggered
2365 * extra send parameter: word handle - indicates which watchpoint
2368 #define ADP_Stopped_StepComplete ADPSUBREASON(CI_TADP,34)
2369 /* End of ADP_Step request */
2371 #define ADP_Stopped_RunTimeErrorUnknown ADPSUBREASON(CI_TADP,35)
2373 * non-specific fatal runtime support error
2376 #define ADP_Stopped_InternalError ADPSUBREASON(CI_TADP,36)
2377 /* extra send parameter: word error - indicates the nature of the error
2379 * An Angel internal error has happened. The error number should be
2380 * displayed for the user to report to his software supplier. Once
2381 * this error has been received the internal state of Angel can no longer
2385 #define ADP_Stopped_UserInterruption ADPSUBREASON(CI_TADP,37)
2386 /* Host requested interruption */
2388 #define ADP_Stopped_ApplicationExit ADPSUBREASON(CI_TADP,38)
2389 /* extra send parameter: word exitcode
2390 * This indicates that the application has exited via exit(), an exitcode
2391 * of zero indiactes successful termination.
2394 #define ADP_Stopped_StackOverflow ADPSUBREASON(CI_TADP, 39)
2396 * Software stack overflow has occurred
2399 #define ADP_Stopped_DivisionByZero ADPSUBREASON(CI_TADP, 40)
2401 * Division by zero has occurred
2404 #define ADP_Stopped_OSSpecific ADPSUBREASON(CI_TADP, 41)
2406 * The OS has requested that execution stops. The OS will know
2407 * why this has happened.
2412 /******************************************************************
2414 * CI_TTDCC messages (Target-initiated debug comms channel)
2418 #define ADP_TDCC_ToHost ADPREASON(CI_TTDCC,0)
2420 * ------------------
2421 * Summary: Send Data down Comms Channel in ToHost direction.
2424 * Send: (word nbytes, words data)
2425 * Return: (word status)
2427 * 'nbytes' is number of BYTES to be transferred from the target to the
2428 * host via the Debug Comms channel.
2429 * 'data' is (nbytes/sizeof(word)) WORDS of data to be transferred from
2430 * the target to the host via the Debug Comms channel.
2431 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
2433 * NOTE: Equivalent to RDP_CCToHost and RDP_CCToHostReply (just set the
2435 * NOTE II: Current implementations only support single word transfers
2440 #define ADP_TDCC_FromHost ADPREASON(CI_TTDCC,1)
2441 /* ADP_TDCC_FromHost
2442 * --------------------
2443 * Summary: Send Data down Comms Channel in FromHost direction.
2447 * Return: (word status, word nbytes, words data)
2449 * 'status' is RDIError_NoError to indicate success, non-zero otherwise.
2450 * 'nbytes' is number of BYTES to be transferred from the host to the
2451 * target via the Debug Comms channel, or zero if the host has no data
2453 * 'data' is (nbytes/sizeof(word)) WORDS of transferred data.
2455 * NOTE: Equivalent to RDP_CCFromHost and RDP_CCFromHostReply (just set the
2457 * NOTE II: Current implementations only support single word transfers
2462 /*******************************************************************
2468 #define RDIError_NoError 0
2470 #define RDIError_Reset 1
2471 #define RDIError_UndefinedInstruction 2
2472 #define RDIError_SoftwareInterrupt 3
2473 #define RDIError_PrefetchAbort 4
2474 #define RDIError_DataAbort 5
2475 #define RDIError_AddressException 6
2476 #define RDIError_IRQ 7
2477 #define RDIError_FIQ 8
2478 #define RDIError_Error 9
2479 #define RDIError_BranchThrough0 10
2481 #define RDIError_NotInitialised 128
2482 #define RDIError_UnableToInitialise 129
2483 #define RDIError_WrongByteSex 130
2484 #define RDIError_UnableToTerminate 131
2485 #define RDIError_BadInstruction 132
2486 #define RDIError_IllegalInstruction 133
2487 #define RDIError_BadCPUStateSetting 134
2488 #define RDIError_UnknownCoPro 135
2489 #define RDIError_UnknownCoProState 136
2490 #define RDIError_BadCoProState 137
2491 #define RDIError_BadPointType 138
2492 #define RDIError_UnimplementedType 139
2493 #define RDIError_BadPointSize 140
2494 #define RDIError_UnimplementedSize 141
2495 #define RDIError_NoMorePoints 142
2496 #define RDIError_BreakpointReached 143
2497 #define RDIError_WatchpointAccessed 144
2498 #define RDIError_NoSuchPoint 145
2499 #define RDIError_ProgramFinishedInStep 146
2500 #define RDIError_UserInterrupt 147
2501 #define RDIError_CantSetPoint 148
2502 #define RDIError_IncompatibleRDILevels 149
2504 #define RDIError_CantLoadConfig 150
2505 #define RDIError_BadConfigData 151
2506 #define RDIError_NoSuchConfig 152
2507 #define RDIError_BufferFull 153
2508 #define RDIError_OutOfStore 154
2509 #define RDIError_NotInDownload 155
2510 #define RDIError_PointInUse 156
2511 #define RDIError_BadImageFormat 157
2512 #define RDIError_TargetRunning 158
2513 #define RDIError_DeviceWouldNotOpen 159
2514 #define RDIError_NoSuchHandle 160
2515 #define RDIError_ConflictingPoint 161
2517 #define RDIError_LittleEndian 240
2518 #define RDIError_BigEndian 241
2519 #define RDIError_SoftInitialiseError 242
2521 #define RDIError_InsufficientPrivilege 253
2522 #define RDIError_UnimplementedMessage 254
2523 #define RDIError_UndefinedMessage 255
This page took 0.08093 seconds and 4 git commands to generate.