common/main: support bootdelay=0 for CONFIG_AUTOBOOT_KEYED
Support bootdelay=0 in abortboot for the CONFIG_AUTOBOOT_KEYED case similar to the CONFIG_ZERO_BOOTDELAY_CHECK support for the !CONFIG_AUTOBOOT_KEYED case. Do this by reversing the loop so we do at least one iteration before checking for timeout. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
This commit is contained in:
parent
94f9279f7b
commit
c3284b030b
common
|
@ -158,7 +158,19 @@ static __inline__ int abortboot(int bootdelay)
|
||||||
/* In order to keep up with incoming data, check timeout only
|
/* In order to keep up with incoming data, check timeout only
|
||||||
* when catch up.
|
* when catch up.
|
||||||
*/
|
*/
|
||||||
while (!abort && get_ticks() <= etime) {
|
do {
|
||||||
|
if (tstc()) {
|
||||||
|
if (presskey_len < presskey_max) {
|
||||||
|
presskey [presskey_len ++] = getc();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (i = 0; i < presskey_max - 1; i ++)
|
||||||
|
presskey [i] = presskey [i + 1];
|
||||||
|
|
||||||
|
presskey [i] = getc();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < sizeof(delaykey) / sizeof(delaykey[0]); i ++) {
|
for (i = 0; i < sizeof(delaykey) / sizeof(delaykey[0]); i ++) {
|
||||||
if (delaykey[i].len > 0 &&
|
if (delaykey[i].len > 0 &&
|
||||||
presskey_len >= delaykey[i].len &&
|
presskey_len >= delaykey[i].len &&
|
||||||
|
@ -178,19 +190,8 @@ static __inline__ int abortboot(int bootdelay)
|
||||||
abort = 1;
|
abort = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} while (!abort && get_ticks() <= etime);
|
||||||
|
|
||||||
if (tstc()) {
|
|
||||||
if (presskey_len < presskey_max) {
|
|
||||||
presskey [presskey_len ++] = getc();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
for (i = 0; i < presskey_max - 1; i ++)
|
|
||||||
presskey [i] = presskey [i + 1];
|
|
||||||
|
|
||||||
presskey [i] = getc();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
# if DEBUG_BOOTKEYS
|
# if DEBUG_BOOTKEYS
|
||||||
if (!abort)
|
if (!abort)
|
||||||
puts("key timeout\n");
|
puts("key timeout\n");
|
||||||
|
|
Loading…
Reference in New Issue