From: David B. <dbr...@us...> - 2010-01-09 09:10:38
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via aafd3877e6fbc1745dbfc5d4f54a2c7efe8cc3d6 (commit) via 973cd9a299d904ab22bb089319beab65c339d783 (commit) via 2a76c1bcf94f8ed00c9e744a5405d0ac07cdc85a (commit) via ae710059291ba9830a9b20d899bdef6a5122dd73 (commit) from b800eb0336a190ed53da90a2b7216a35bfbfdb23 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit aafd3877e6fbc1745dbfc5d4f54a2c7efe8cc3d6 Author: Masaki Muranaka <mo...@mo...> Date: Sat Jan 9 15:41:31 2010 +0900 buildfix on MacOS Recent Apple gcc versions use __APPLE__ instead of __DARWIN__; accept that too. Also use #warning, not #warn; neither is standard, but most CPP versions require it to be spelled out. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/helper/command.c b/src/helper/command.c index ab82785..0ddcd01 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -1361,7 +1361,7 @@ struct command_context* command_init(const char *startup_tcl, Jim_Interp *interp HostOs = "winxx"; #elif defined(__linux__) HostOs = "linux"; -#elif defined(__DARWIN__) +#elif defined(__APPLE__) || defined(__DARWIN__) HostOs = "darwin"; #elif defined(__CYGWIN__) HostOs = "cygwin"; @@ -1370,7 +1370,7 @@ struct command_context* command_init(const char *startup_tcl, Jim_Interp *interp #elif defined(__ECOS) HostOs = "ecos"; #else -#warn unrecognized host OS... +#warning "Unrecognized host OS..." HostOs = "other"; #endif Jim_SetGlobalVariableStr(interp, "ocd_HOSTOS", commit 973cd9a299d904ab22bb089319beab65c339d783 Author: David Brownell <dbr...@us...> Date: Fri Jan 8 23:23:55 2010 -0800 PLD: usage/help updates Make "usage" messages use the same EBNF as the User's Guide; no angle brackets. Improve and correct various helptexts. Don't use "&function"; a function's name is its address. Remove a couple instances of pointless whitespace, shrink a few overlong lines. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/pld/pld.c b/src/pld/pld.c index 6a0bd93..5ed7596 100644 --- a/src/pld/pld.c +++ b/src/pld/pld.c @@ -76,7 +76,7 @@ COMMAND_HANDLER(handle_pld_device_command) /* register pld specific commands */ int retval; if (pld_drivers[i]->commands) { - retval = register_commands(CMD_CTX, NULL, + retval = register_commands(CMD_CTX, NULL, pld_drivers[i]->commands); if (ERROR_OK != retval) { @@ -89,10 +89,12 @@ COMMAND_HANDLER(handle_pld_device_command) c->driver = pld_drivers[i]; c->next = NULL; - retval = CALL_COMMAND_HANDLER(pld_drivers[i]->pld_device_command, c); + retval = CALL_COMMAND_HANDLER( + pld_drivers[i]->pld_device_command, c); if (ERROR_OK != retval) { - LOG_ERROR("'%s' driver rejected pld device", CMD_ARGV[0]); + LOG_ERROR("'%s' driver rejected pld device", + CMD_ARGV[0]); free(c); return ERROR_OK; } @@ -191,16 +193,16 @@ COMMAND_HANDLER(handle_pld_load_command) static const struct command_registration pld_exec_command_handlers[] = { { .name = "devices", - .handler = &handle_pld_devices_command, + .handler = handle_pld_devices_command, .mode = COMMAND_EXEC, .help = "list configured pld devices", }, { .name = "load", - .handler = &handle_pld_load_command, + .handler = handle_pld_load_command, .mode = COMMAND_EXEC, .help = "load configuration file into PLD", - .usage = "<device#> <file>", + .usage = "pld_num filename", }, COMMAND_REGISTRATION_DONE }; @@ -234,14 +236,14 @@ static const struct command_registration pld_config_command_handlers[] = { { .name = "device", .mode = COMMAND_CONFIG, - .handler = &handle_pld_device_command, + .handler = handle_pld_device_command, .help = "configure a PLD device", - .usage = "<driver> ...", + .usage = "driver_name [driver_args ... ]", }, { .name = "init", .mode = COMMAND_CONFIG, - .handler = &handle_pld_init_command, + .handler = handle_pld_init_command, .help = "initialize PLD devices", }, COMMAND_REGISTRATION_DONE @@ -251,7 +253,6 @@ static const struct command_registration pld_command_handler[] = { .name = "pld", .mode = COMMAND_ANY, .help = "programmable logic device commands", - .chain = pld_config_command_handlers, }, COMMAND_REGISTRATION_DONE diff --git a/src/pld/virtex2.c b/src/pld/virtex2.c index 77eb866..bbf6b66 100644 --- a/src/pld/virtex2.c +++ b/src/pld/virtex2.c @@ -237,9 +237,9 @@ static const struct command_registration virtex2_exec_command_handlers[] = { { .name = "read_stat", .mode = COMMAND_EXEC, - .handler = &virtex2_handle_read_stat_command, + .handler = virtex2_handle_read_stat_command, .help = "read status register", - .usage = "<device_id>", + .usage = "pld_num", }, COMMAND_REGISTRATION_DONE }; commit 2a76c1bcf94f8ed00c9e744a5405d0ac07cdc85a Author: David Brownell <dbr...@us...> Date: Fri Jan 8 23:18:46 2010 -0800 NAND: help/usage/doc updates Usage messages should use the same EBNF as the User's Guide; no angle brackets. Be more complete too ... some params were missing. Improve and correct various helptexts. Make user's guide refer to the NAND "driver" name, not the controller name; that's a bit more precise. Don't use "&function"; its name is its address. Line up struct initializers properly. Remove some blank lines. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 2e0143e..3adc33a 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -4673,7 +4673,7 @@ NAND chips must be declared in configuration scripts, plus some additional configuration that's done after OpenOCD has initialized. -@deffn {Config Command} {nand device} name controller target [configparams...] +@deffn {Config Command} {nand device} name driver target [configparams...] Declares a NAND device, which can be read and written to after it has been configured through @command{nand probe}. In OpenOCD, devices are single chips; this is unlike some @@ -4688,8 +4688,8 @@ configuration files, not interactively. @itemize @bullet @item @var{name} ... may be used to reference the NAND bank -in other commands. -@item @var{controller} ... identifies the controller driver +in most other NAND commands. A number is also available. +@item @var{driver} ... identifies the NAND controller driver associated with the NAND device being declared. @xref{NAND Driver List}. @item @var{target} ... names the target used when issuing diff --git a/src/flash/nand/at91sam9.c b/src/flash/nand/at91sam9.c index 5cfbb0a..92ab047 100644 --- a/src/flash/nand/at91sam9.c +++ b/src/flash/nand/at91sam9.c @@ -697,28 +697,30 @@ static const struct command_registration at91sam9_sub_command_handlers[] = { .handler = handle_at91sam9_cle_command, .mode = COMMAND_CONFIG, .help = "set command latch enable address line (default is 22)", - .usage = "<device_id> <address_line>", + .usage = "bank_id address_line", }, { .name = "ale", .handler = handle_at91sam9_ale_command, .mode = COMMAND_CONFIG, .help = "set address latch enable address line (default is 21)", - .usage = "<device_id> <address_line>", + .usage = "bank_id address_line", }, { .name = "rdy_busy", .handler = handle_at91sam9_rdy_busy_command, .mode = COMMAND_CONFIG, - .help = "set the input pin connected to RDY/~BUSY signal (no default)", - .usage = "<device_id> <base_pioc> <pin_num>", + .help = "set the GPIO input pin connected to " + "the RDY/~BUSY signal (no default)", + .usage = "bank_id pio_base_addr pin_num", }, { .name = "ce", .handler = handle_at91sam9_ce_command, .mode = COMMAND_CONFIG, - .help = "set the output pin connected to chip enable signal (no default)", - .usage = "<device_id> <base_pioc> <pin_num>", + .help = "set the GPIO output pin connected to " + "the chip enable signal (no default)", + .usage = "bank_id pio_base_addr pin_num", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/flash/nand/lpc3180.c b/src/flash/nand/lpc3180.c index 4268b66..51ab34b 100644 --- a/src/flash/nand/lpc3180.c +++ b/src/flash/nand/lpc3180.c @@ -878,10 +878,10 @@ COMMAND_HANDLER(handle_lpc3180_select_command) static const struct command_registration lpc3180_exec_command_handlers[] = { { .name = "select", - .handler = &handle_lpc3180_select_command, + .handler = handle_lpc3180_select_command, .mode = COMMAND_EXEC, - .help = "select <'mlc'|'slc'> controller (default is mlc)", - .usage = "<device_id> (mlc|slc)", + .help = "select MLC or SLC controller (default is MLC)", + .usage = "bank_id ['mlc'|'slc']", }, COMMAND_REGISTRATION_DONE }; @@ -896,17 +896,17 @@ static const struct command_registration lpc3180_command_handler[] = { }; struct nand_flash_controller lpc3180_nand_controller = { - .name = "lpc3180", - .commands = lpc3180_command_handler, - .nand_device_command = lpc3180_nand_device_command, - .init = lpc3180_init, - .reset = lpc3180_reset, - .command = lpc3180_command, - .address = lpc3180_address, - .write_data = lpc3180_write_data, - .read_data = lpc3180_read_data, - .write_page = lpc3180_write_page, - .read_page = lpc3180_read_page, - .controller_ready = lpc3180_controller_ready, - .nand_ready = lpc3180_nand_ready, - }; + .name = "lpc3180", + .commands = lpc3180_command_handler, + .nand_device_command = lpc3180_nand_device_command, + .init = lpc3180_init, + .reset = lpc3180_reset, + .command = lpc3180_command, + .address = lpc3180_address, + .write_data = lpc3180_write_data, + .read_data = lpc3180_read_data, + .write_page = lpc3180_write_page, + .read_page = lpc3180_read_page, + .controller_ready = lpc3180_controller_ready, + .nand_ready = lpc3180_nand_ready, +}; diff --git a/src/flash/nand/tcl.c b/src/flash/nand/tcl.c index 4f90c7b..29b4b69 100644 --- a/src/flash/nand/tcl.c +++ b/src/flash/nand/tcl.c @@ -446,68 +446,67 @@ COMMAND_HANDLER(handle_nand_raw_access_command) static const struct command_registration nand_exec_command_handlers[] = { { .name = "list", - .handler = &handle_nand_list_command, + .handler = handle_nand_list_command, .mode = COMMAND_EXEC, .help = "list configured NAND flash devices", }, { .name = "info", - .handler = &handle_nand_info_command, + .handler = handle_nand_info_command, .mode = COMMAND_EXEC, - .usage = "<bank>", - .help = "print info about a NAND flash device", + .usage = "[banknum | first_bank_num last_bank_num]", + .help = "print info about one or more NAND flash devices", }, { .name = "probe", - .handler = &handle_nand_probe_command, + .handler = handle_nand_probe_command, .mode = COMMAND_EXEC, - .usage = "<bank>", - .help = "identify NAND flash device <num>", - + .usage = "bank_id", + .help = "identify NAND flash device", }, { .name = "check_bad_blocks", - .handler = &handle_nand_check_bad_blocks_command, + .handler = handle_nand_check_bad_blocks_command, .mode = COMMAND_EXEC, - .usage = "<bank> [<offset> <length>]", - .help = "check NAND flash device <num> for bad blocks", + .usage = "bank_id [offset length]", + .help = "check all or part of NAND flash device for bad blocks", }, { .name = "erase", - .handler = &handle_nand_erase_command, + .handler = handle_nand_erase_command, .mode = COMMAND_EXEC, - .usage = "<bank> [<offset> <length>]", - .help = "erase blocks on NAND flash device", + .usage = "bank_id [offset length]", + .help = "erase all or subset of blocks on NAND flash device", }, { .name = "dump", - .handler = &handle_nand_dump_command, + .handler = handle_nand_dump_command, .mode = COMMAND_EXEC, - .usage = "<bank> <filename> <offset> <length> " - "[oob_raw | oob_only]", + .usage = "bank_id filename offset length " + "['oob_raw'|'oob_only']", .help = "dump from NAND flash device", }, { .name = "verify", - .handler = &handle_nand_verify_command, + .handler = handle_nand_verify_command, .mode = COMMAND_EXEC, - .usage = "<bank> <filename> <offset> " - "[oob_raw | oob_only | oob_softecc | oob_softecc_kw]", + .usage = "bank_id filename offset " + "['oob_raw'|'oob_only'|'oob_softecc'|'oob_softecc_kw']", .help = "verify NAND flash device", }, { .name = "write", - .handler = &handle_nand_write_command, + .handler = handle_nand_write_command, .mode = COMMAND_EXEC, - .usage = "<bank> <filename> <offset> " - "[oob_raw | oob_only | oob_softecc | oob_softecc_kw]", + .usage = "bank_id filename offset " + "['oob_raw'|'oob_only'|'oob_softecc'|'oob_softecc_kw']", .help = "write to NAND flash device", }, { .name = "raw_access", - .handler = &handle_nand_raw_access_command, + .handler = handle_nand_raw_access_command, .mode = COMMAND_EXEC, - .usage = "<num> ['enable'|'disable']", + .usage = "bank_id ['enable'|'disable']", .help = "raw access to NAND flash device", }, COMMAND_REGISTRATION_DONE @@ -614,6 +613,7 @@ static const struct command_registration nand_config_command_handlers[] = { .handler = &handle_nand_device_command, .mode = COMMAND_CONFIG, .help = "defines a new NAND bank", + .usage = "bank_id driver target [driver_options ...]", }, { .name = "drivers", commit ae710059291ba9830a9b20d899bdef6a5122dd73 Author: David Brownell <dbr...@us...> Date: Fri Jan 8 23:13:39 2010 -0800 Doc/examples: clarify usage messages Update/bugfix the "hello" example; emphasize using EBNF syntax, matching the User's Guide. Correct the Texinfo style guide to say EBNF, not BNF. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/manual/primer/commands.txt b/doc/manual/primer/commands.txt index 6169734..5f89d50 100644 --- a/doc/manual/primer/commands.txt +++ b/doc/manual/primer/commands.txt @@ -68,9 +68,9 @@ static const struct command_registration hello_command_handlers[] = { { .name = "hello", .mode = COMMAND_ANY, - .handler = &handle_hello_command, - .help = "print a warm greetings", - .usage = "[<name>]", + .handler = handle_hello_command, + .help = "print a warm greeting", + .usage = "[name]", }, { .chain = foo_command_handlers, @@ -84,7 +84,12 @@ int hello_register_commands(struct command_context_s *cmd_ctx) } @endcode -That's it! The command should now be registered and avaiable to scripts. +Note that the "usage" text should use the same EBNF that's found +in the User's Guide: literals in 'single quotes', sequences of +optional parameters in [square brackets], and alternatives in +(parentheses|with|vertical bars), and so forth. No angle brackets. + +That's it! The command should now be registered and available to scripts. @section primercmdchain Command Chaining diff --git a/doc/manual/style.txt b/doc/manual/style.txt index 71bb5f6..87b1e6b 100644 --- a/doc/manual/style.txt +++ b/doc/manual/style.txt @@ -308,7 +308,7 @@ For technical reference material: - Else it's a "Config Command" if it must be used before the configuration stage completes. - For a "Driver", list its name. - - Use BNF style regular expressions to define parameters: + - Use EBNF style regular expressions to define parameters: brackets around zero-or-one choices, parentheses around exactly-one choices. - Use \@option, \@file, \@var and other mechanisms where appropriate. diff --git a/src/hello.c b/src/hello.c index 0cd06ad..8cd5fab 100644 --- a/src/hello.c +++ b/src/hello.c @@ -58,14 +58,14 @@ static const struct command_registration foo_command_handlers[] = { .name = "bar", .handler = &handle_foo_command, .mode = COMMAND_ANY, - .usage = "<address> [enable|disable]", + .usage = "address ['enable'|'disable']", .help = "an example command", }, { .name = "baz", .handler = &handle_foo_command, .mode = COMMAND_ANY, - .usage = "<address> [enable|disable]", + .usage = "address ['enable'|'disable']", .help = "a sample command", }, { @@ -107,10 +107,10 @@ COMMAND_HANDLER(handle_hello_command) const struct command_registration hello_command_handlers[] = { { .name = "hello", - .handler = &handle_hello_command, + .handler = handle_hello_command, .mode = COMMAND_ANY, .help = "prints a warm welcome", - .usage = "[<name>]", + .usage = "[name]", }, { .name = "foo", ----------------------------------------------------------------------- Summary of changes: doc/manual/primer/commands.txt | 13 +++++++--- doc/manual/style.txt | 2 +- doc/openocd.texi | 6 ++-- src/flash/nand/at91sam9.c | 14 ++++++---- src/flash/nand/lpc3180.c | 34 +++++++++++++------------- src/flash/nand/tcl.c | 50 ++++++++++++++++++++-------------------- src/hello.c | 8 +++--- src/helper/command.c | 4 +- src/pld/pld.c | 21 ++++++++-------- src/pld/virtex2.c | 4 +- 10 files changed, 82 insertions(+), 74 deletions(-) hooks/post-receive -- Main OpenOCD repository |