summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2016-08-25 15:10:55 -0700
committerBill Richardson <wfrichar@chromium.org>2016-08-31 17:20:26 +0000
commit8c4421759d127f23d9745c6b495e5d69e171b9a6 (patch)
treefeec0fdee8a19e56ac86c894c3fd69cf85b3bcfe
parentada6b3d5d5c058d38b7a73da48d3173c6c453da0 (diff)
downloadchrome-ec-8c4421759d127f23d9745c6b495e5d69e171b9a6.tar.gz
Cr50: Mark several console commands as safe
Even when CONFIG_RESTRICTED_CONSOLE_COMMANDS is enabled, there are many commands that can't do anything dangerous. This marks some of those commands as safe to use, even when restrictions are enforced. I'm only marking commands that are used by the Cr50, since that's the only board that has restrictions. BUG=chrome-os-partner:55322 BRANCH=none TEST=make buildall, test on Cr50 hardware Change-Id: I6289d332830175b6adcb6b20cb4c21d01d27a25e Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/376188 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--chip/g/gpio.c12
-rw-r--r--common/console.c6
-rw-r--r--common/console_output.c6
-rw-r--r--common/flash.c6
-rw-r--r--common/gpio_commands.c6
-rw-r--r--common/panic_output.c6
-rw-r--r--common/shared_mem.c6
-rw-r--r--common/system.c18
-rw-r--r--common/timer.c12
-rw-r--r--core/cortex-m/task.c6
10 files changed, 42 insertions, 42 deletions
diff --git a/chip/g/gpio.c b/chip/g/gpio.c
index 5fd8ed0982..0ec603d18b 100644
--- a/chip/g/gpio.c
+++ b/chip/g/gpio.c
@@ -435,9 +435,9 @@ static int command_pinmux(int argc, char **argv)
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(pinmux, command_pinmux,
- "",
- "Display pinmux info");
+DECLARE_SAFE_CONSOLE_COMMAND(pinmux, command_pinmux,
+ "",
+ "Display pinmux info");
static const char * const int_str[] = {
"LOW", "FALLING", "HIGH", "RISING",
@@ -478,6 +478,6 @@ static int command_gpiocfg(int argc, char **argv)
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(gpiocfg, command_gpiocfg,
- "",
- "Display GPIO configs");
+DECLARE_SAFE_CONSOLE_COMMAND(gpiocfg, command_gpiocfg,
+ "",
+ "Display GPIO configs");
diff --git a/common/console.c b/common/console.c
index 785f71ce56..a935028e30 100644
--- a/common/console.c
+++ b/common/console.c
@@ -766,7 +766,7 @@ static int command_history(int argc, char **argv)
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(history, command_history,
- NULL,
- "Print console history");
+DECLARE_SAFE_CONSOLE_COMMAND(history, command_history,
+ NULL,
+ "Print console history");
#endif
diff --git a/common/console_output.c b/common/console_output.c
index 7354ea4392..1102294fd7 100644
--- a/common/console_output.c
+++ b/common/console_output.c
@@ -146,6 +146,6 @@ static int command_ch(int argc, char **argv)
}
return EC_SUCCESS;
};
-DECLARE_CONSOLE_COMMAND(chan, command_ch,
- "[ save | restore | <mask> ]",
- "Save, restore, get or set console channel mask");
+DECLARE_SAFE_CONSOLE_COMMAND(chan, command_ch,
+ "[ save | restore | <mask> ]",
+ "Save, restore, get or set console channel mask");
diff --git a/common/flash.c b/common/flash.c
index d35701d70d..cdd4219394 100644
--- a/common/flash.c
+++ b/common/flash.c
@@ -698,9 +698,9 @@ static int command_flash_info(int argc, char **argv)
ccputs("\n");
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(flashinfo, command_flash_info,
- NULL,
- "Print flash info");
+DECLARE_SAFE_CONSOLE_COMMAND(flashinfo, command_flash_info,
+ NULL,
+ "Print flash info");
#ifdef CONFIG_CMD_FLASH
static int command_flash_erase(int argc, char **argv)
diff --git a/common/gpio_commands.c b/common/gpio_commands.c
index 57bd1602fc..32bd896c0c 100644
--- a/common/gpio_commands.c
+++ b/common/gpio_commands.c
@@ -132,9 +132,9 @@ static int command_gpio_get(int argc, char **argv)
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(gpioget, command_gpio_get,
- "[name]",
- "Read GPIO value(s)");
+DECLARE_SAFE_CONSOLE_COMMAND(gpioget, command_gpio_get,
+ "[name]",
+ "Read GPIO value(s)");
static int command_gpio_set(int argc, char **argv)
{
diff --git a/common/panic_output.c b/common/panic_output.c
index bfd7f7a51f..b278ac1acb 100644
--- a/common/panic_output.c
+++ b/common/panic_output.c
@@ -218,9 +218,9 @@ static int command_panicinfo(int argc, char **argv)
}
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(panicinfo, command_panicinfo,
- NULL,
- "Print info from a previous panic");
+DECLARE_SAFE_CONSOLE_COMMAND(panicinfo, command_panicinfo,
+ NULL,
+ "Print info from a previous panic");
/*****************************************************************************/
/* Host commands */
diff --git a/common/shared_mem.c b/common/shared_mem.c
index adcc577696..3157f69e38 100644
--- a/common/shared_mem.c
+++ b/common/shared_mem.c
@@ -60,7 +60,7 @@ static int command_shmem(int argc, char **argv)
ccprintf("Max: %6d\n", max_used);
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(shmem, command_shmem,
- NULL,
- "Print shared memory stats");
+DECLARE_SAFE_CONSOLE_COMMAND(shmem, command_shmem,
+ NULL,
+ "Print shared memory stats");
#endif
diff --git a/common/system.c b/common/system.c
index 8e26503193..b216603157 100644
--- a/common/system.c
+++ b/common/system.c
@@ -852,9 +852,9 @@ static int command_sysinfo(int argc, char **argv)
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(sysinfo, command_sysinfo,
- NULL,
- "Print system info");
+DECLARE_SAFE_CONSOLE_COMMAND(sysinfo, command_sysinfo,
+ NULL,
+ "Print system info");
#ifdef CONFIG_CMD_SCRATCHPAD
static int command_scratchpad(int argc, char **argv)
@@ -998,9 +998,9 @@ static int command_version(int argc, char **argv)
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(version, command_version,
- NULL,
- "Print versions");
+DECLARE_SAFE_CONSOLE_COMMAND(version, command_version,
+ NULL,
+ "Print versions");
static int command_sysjump(int argc, char **argv)
{
@@ -1081,9 +1081,9 @@ static int command_system_lock(int argc, char **argv)
force_locked = 1;
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(syslock, command_system_lock,
- NULL,
- "Lock the system, even if WP is disabled");
+DECLARE_SAFE_CONSOLE_COMMAND(syslock, command_system_lock,
+ NULL,
+ "Lock the system, even if WP is disabled");
#ifdef CONFIG_LOW_POWER_IDLE
/**
diff --git a/common/timer.c b/common/timer.c
index 1648a9aeaa..0daf501b9c 100644
--- a/common/timer.c
+++ b/common/timer.c
@@ -306,9 +306,9 @@ static int command_get_time(int argc, char **argv)
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(gettime, command_get_time,
- NULL,
- "Print current time");
+DECLARE_SAFE_CONSOLE_COMMAND(gettime, command_get_time,
+ NULL,
+ "Print current time");
#ifdef CONFIG_CMD_TIMERINFO
int command_timer_info(int argc, char **argv)
@@ -317,7 +317,7 @@ int command_timer_info(int argc, char **argv)
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(timerinfo, command_timer_info,
- NULL,
- "Print timer info");
+DECLARE_SAFE_CONSOLE_COMMAND(timerinfo, command_timer_info,
+ NULL,
+ "Print timer info");
#endif
diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c
index 7b80c1584a..aaa263581c 100644
--- a/core/cortex-m/task.c
+++ b/core/cortex-m/task.c
@@ -606,9 +606,9 @@ int command_task_info(int argc, char **argv)
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(taskinfo, command_task_info,
- NULL,
- "Print task info");
+DECLARE_SAFE_CONSOLE_COMMAND(taskinfo, command_task_info,
+ NULL,
+ "Print task info");
#ifdef CONFIG_CMD_TASKREADY
static int command_task_ready(int argc, char **argv)