[lib][console] rename some console command types to be prefixed with console_

Some of the structures, notably 'cmd', in the lib console stuff are a
little too generically named and have collided with some other code
so prefix the names a bit more cleanly with console_

The change is largely mechanical, and folks with out of tree code can
easily switch by renaming:
cmd -> console_cmd
cmd_args -> console_cmd_args
cmd_block -> console_cmd_block
console_cmd -> console_cmd_func

Apologies if this breaks you but it should be pretty easy to fix.
This commit is contained in:
Travis Geiselbrecht
2020-07-25 15:59:58 -07:00
parent c629d762a3
commit 4edb93adde
51 changed files with 151 additions and 149 deletions

View File

@@ -15,7 +15,7 @@
void read_xyz(void);
STATIC_COMMAND_START
STATIC_COMMAND("read_xyz", "read xyz vectors", (console_cmd)&read_xyz)
STATIC_COMMAND("read_xyz", "read xyz vectors", (console_cmd_func)&read_xyz)
STATIC_COMMAND_END(accelerometer);
void read_xyz(void) {

View File

@@ -127,7 +127,7 @@ int tftp_callback(void *data, size_t len, void *arg) {
return 0;
}
static int loader(int argc, const cmd_args *argv) {
static int loader(int argc, const console_cmd_args *argv) {
static int any_slot = 0;
static int elf_slot = 1;

View File

@@ -91,7 +91,7 @@ error:
* a somewhat fugly pci config space examine/modify command. this should probably
* be broken up a bit.
*/
static int pci_config(int argc, const cmd_args *argv) {
static int pci_config(int argc, const console_cmd_args *argv) {
pci_location_t loc;
pci_config_t config;
uint32_t offset;
@@ -206,7 +206,7 @@ error:
return -2;
}
static int pci_cmd(int argc, const cmd_args *argv) {
static int pci_cmd(int argc, const console_cmd_args *argv) {
if (argc < 2) {
printf("pci commands:\n");
usage:

View File

@@ -274,7 +274,7 @@ static void validate_memset(void) {
}
}
static int string_tests(int argc, const cmd_args *argv) {
static int string_tests(int argc, const console_cmd_args *argv) {
src = memalign(64, BUFFER_SIZE + 256);
dst = memalign(64, BUFFER_SIZE + 256);
src2 = memalign(64, BUFFER_SIZE + 256);

View File

@@ -225,7 +225,7 @@ __NO_INLINE static void bench_sincos(void) {
#endif // WITH_LIB_LIBM
int benchmarks(int argc, const cmd_args *argv) {
int benchmarks(int argc, const console_cmd_args *argv) {
bench_set_overhead();
bench_memset();
bench_memcpy();

View File

@@ -50,7 +50,7 @@ static void bench_cache(size_t bufsize, uint8_t *buf) {
printf("took %llu usecs to clean %d bytes (hot)\n", t, bufsize);
}
static int cache_tests(int argc, const cmd_args *argv) {
static int cache_tests(int argc, const console_cmd_args *argv) {
uint8_t *buf;
buf = (uint8_t *)((argc > 1) ? argv[1].u : 0UL);

View File

@@ -25,7 +25,7 @@
} \
} while (0);
int cbuf_tests(int argc, const cmd_args *argv) {
int cbuf_tests(int argc, const console_cmd_args *argv) {
cbuf_t cbuf;
printf("running basic tests...\n");

View File

@@ -15,7 +15,7 @@
#include <kernel/event.h>
#include <platform.h>
int clock_tests(int argc, const cmd_args *argv) {
int clock_tests(int argc, const console_cmd_args *argv) {
ulong c;
lk_time_t t;
lk_bigtime_t t2;

View File

@@ -52,7 +52,7 @@ static int fibo_thread(void *argv) {
return retcode0 + retcode1;
}
int fibo(int argc, const cmd_args *argv) {
int fibo(int argc, const console_cmd_args *argv) {
if (argc < 2) {
printf("not enough args\n");

View File

@@ -70,7 +70,7 @@ static void arm_float_instruction_trap_test(void) {
}
#endif
static void float_tests(void) {
static int float_tests(int argc, const console_cmd_args *argv) {
printf("floating point test:\n");
/* test lazy fpu load on separate thread */
@@ -97,10 +97,12 @@ static void float_tests(void) {
/* test all the instruction traps */
arm_float_instruction_trap_test();
#endif
return 0;
}
STATIC_COMMAND_START
STATIC_COMMAND("float_tests", "floating point test", (console_cmd)&float_tests)
STATIC_COMMAND("float_tests", "floating point test", &float_tests)
STATIC_COMMAND_END(float_tests);
#endif // ARM_WITH_VFP || ARCH_ARM64

View File

@@ -10,15 +10,15 @@
#include <lk/console_cmd.h>
int cbuf_tests(int argc, const cmd_args *argv);
int fibo(int argc, const cmd_args *argv);
int port_tests(int argc, const cmd_args *argv);
int spinner(int argc, const cmd_args *argv);
int thread_tests(int argc, const cmd_args *argv);
int benchmarks(int argc, const cmd_args *argv);
int clock_tests(int argc, const cmd_args *argv);
int printf_tests(int argc, const cmd_args *argv);
int printf_tests_float(int argc, const cmd_args *argv);
int cbuf_tests(int argc, const console_cmd_args *argv);
int fibo(int argc, const console_cmd_args *argv);
int port_tests(int argc, const console_cmd_args *argv);
int spinner(int argc, const console_cmd_args *argv);
int thread_tests(int argc, const console_cmd_args *argv);
int benchmarks(int argc, const console_cmd_args *argv);
int clock_tests(int argc, const console_cmd_args *argv);
int printf_tests(int argc, const console_cmd_args *argv);
int printf_tests_float(int argc, const console_cmd_args *argv);
#endif

View File

@@ -152,7 +152,7 @@ out:
printf("done with tests\n");
}
static int mem_test(int argc, const cmd_args *argv) {
static int mem_test(int argc, const console_cmd_args *argv) {
if (argc < 2) {
printf("not enough arguments\n");
usage:

View File

@@ -707,7 +707,7 @@ int group_waiting(void) {
#define RUN_TEST(t) result = t(); if (result) goto fail
int port_tests(int argc, const cmd_args *argv) {
int port_tests(int argc, const console_cmd_args *argv) {
int result;
int count = 3;
while (count--) {

View File

@@ -15,7 +15,7 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
int printf_tests(int argc, const cmd_args *argv) {
int printf_tests(int argc, const console_cmd_args *argv) {
printf("printf tests\n");
printf("numbers:\n");
@@ -111,7 +111,7 @@ int printf_tests(int argc, const cmd_args *argv) {
#include "float_test_vec.c"
int printf_tests_float(int argc, const cmd_args *argv) {
int printf_tests_float(int argc, const console_cmd_args *argv) {
printf("floating point printf tests\n");
for (size_t i = 0; i < float_test_vec_size; i++) {

View File

@@ -578,7 +578,7 @@ static void spinlock_test(void) {
#undef COUNT
}
int thread_tests(int argc, const cmd_args *argv) {
int thread_tests(int argc, const console_cmd_args *argv) {
mutex_test();
semaphore_test();
event_test();
@@ -603,7 +603,7 @@ static int spinner_thread(void *arg) {
return 0;
}
int spinner(int argc, const cmd_args *argv) {
int spinner(int argc, const console_cmd_args *argv) {
if (argc < 2) {
printf("not enough args\n");
printf("usage: %s <priority> <rt>\n", argv[0].str);