smp: replace commands smp_on/smp_off with "smp [on|off]"

Seams over-engineered having two separate commands to turn SMP
on/off. Plus it is missing the possibility to dump the current
status of SMP and would be weird adding an additional command
for it. Moreover, such commands are replicated in few targets so
it would make sense centralizing them.

- Deprecate the commands "smp_on" and "smp_off".
- Add a new command "smp" that accepts optional parameters
  "[on|off]" and prints the SMP status when run without
  parameters. This replaces the two commands above.
- Put the deprecated and the new command handlers in smp.c
- Update the documentation, except for mips_m4k, since it is not
  available yet.
- Promote the macro foreach_smp_target to global context and use
  it where possible.

Change-Id: Ia72841c1a3bd6edd4db4cc809046322f498617e6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4615
Tested-by: jenkins
Reviewed-by: Graham Sanderson <graham.sanderson@gmail.com>
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
This commit is contained in:
Antonio Borneo
2018-07-19 11:50:56 +02:00
committed by Matthias Welwarsky
parent d496da2c20
commit 246782229f
7 changed files with 105 additions and 166 deletions
+7 -10
View File
@@ -1802,10 +1802,11 @@ displayed by the GDB session @pxref{usingopenocdsmpwithgdb,,Using OpenOCD SMP wi
The SMP behaviour can be disabled/enabled dynamically. On cortex_a following
command have been implemented.
@itemize @bullet
@item cortex_a smp_on : enable SMP mode, behaviour is as described above.
@item cortex_a smp_off : disable SMP mode, the current target is the one
@item cortex_a smp on : enable SMP mode, behaviour is as described above.
@item cortex_a smp off : disable SMP mode, the current target is the one
displayed in the GDB session, only this target is now controlled by GDB
session. This behaviour is useful during system boot up.
@item cortex_a smp : display current SMP mode.
@item cortex_a smp_gdb : display/fix the core id displayed in GDB session see
following example.
@end itemize
@@ -8940,12 +8941,8 @@ Initialize core debug
Enables debug by unlocking the Software Lock and clearing sticky powerdown indications
@end deffn
@deffn Command {cortex_a smp_off}
Disable SMP mode
@end deffn
@deffn Command {cortex_a smp_on}
Enable SMP mode
@deffn Command {cortex_a smp} [on|off]
Display/set the current SMP mode
@end deffn
@deffn Command {cortex_a smp_gdb} [core_id]
@@ -9156,8 +9153,8 @@ target code relies on. In a configuration file, the command would typically be c
However, normally it is not necessary to use the command at all.
@end deffn
@deffn Command {aarch64 smp_on|smp_off}
Enable and disable SMP handling. The state of SMP handling influences the way targets in an SMP group
@deffn Command {aarch64 smp} [on|off]
Display, enable or disable SMP handling mode. The state of SMP handling influences the way targets in an SMP group
are handled by the run control. With SMP handling enabled, issuing halt or resume to one core will trigger
halting or resuming of all cores in the group. The command @code{target smp} defines which targets are in the SMP
group. With SMP handling disabled, all targets need to be treated individually.