mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
Add validation for icache/dcache arguments - arguments different from off/on/flush are currently silently ignored.
Signed-off-by: Eric Perie <eric.perie@yahoo.com>
This commit is contained in:
@@ -22,7 +22,7 @@ void __weak invalidate_icache_all(void)
|
|||||||
static int do_icache(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
static int do_icache(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
{
|
{
|
||||||
switch (argc) {
|
switch (argc) {
|
||||||
case 2: /* on / off */
|
case 2: /* on / off / flush */
|
||||||
switch (parse_argv(argv[1])) {
|
switch (parse_argv(argv[1])) {
|
||||||
case 0:
|
case 0:
|
||||||
icache_disable();
|
icache_disable();
|
||||||
@@ -33,6 +33,8 @@ static int do_icache(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||||||
case 2:
|
case 2:
|
||||||
invalidate_icache_all();
|
invalidate_icache_all();
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
return CMD_RET_USAGE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1: /* get status */
|
case 1: /* get status */
|
||||||
@@ -54,7 +56,7 @@ void __weak flush_dcache_all(void)
|
|||||||
static int do_dcache(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
static int do_dcache(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
{
|
{
|
||||||
switch (argc) {
|
switch (argc) {
|
||||||
case 2: /* on / off */
|
case 2: /* on / off / flush */
|
||||||
switch (parse_argv(argv[1])) {
|
switch (parse_argv(argv[1])) {
|
||||||
case 0:
|
case 0:
|
||||||
dcache_disable();
|
dcache_disable();
|
||||||
@@ -65,6 +67,8 @@ static int do_dcache(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||||||
case 2:
|
case 2:
|
||||||
flush_dcache_all();
|
flush_dcache_all();
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
return CMD_RET_USAGE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1: /* get status */
|
case 1: /* get status */
|
||||||
|
Reference in New Issue
Block a user