[include][console] split lib/console.h into two

TL;DR most uses of lib/console.h -> lk/console_cmd.h

Move the part that lets a piece of code somewhere in the system to
define a console command from the actual lib/console api to start an
instance of the console. Move in almost every place the user of the
console command definition to the new header, lk/console_cmd.h which is
always in the include path.

Also remove most uses of testing for WITH_LIB_CONSOLE since you can
almost always just safely define it and then let the linker remove it.
This commit is contained in:
Travis Geiselbrecht
2019-07-13 16:56:33 -07:00
parent 35a8d555a3
commit 6cb02526b7
48 changed files with 88 additions and 179 deletions

View File

@@ -14,6 +14,8 @@
#include <kernel/thread.h>
#include <kernel/mutex.h>
#include <platform.h>
#include <lk/console_cmd.h>
#include <string.h>
struct dcc_state {
dcc_rx_callback_t rx_callback;
@@ -127,10 +129,6 @@ ssize_t arm_dcc_write(const uint32_t *buf, size_t len, lk_time_t timeout) {
return count;
}
#if WITH_LIB_CONSOLE
#include <lib/console.h>
#include <string.h>
static void dcc_rx_callback(uint32_t val) {
static int count = 0;
count += 4;
@@ -184,5 +182,3 @@ STATIC_COMMAND("dcc", "dcc stuff", &cmd_dcc)
#endif
STATIC_COMMAND_END(dcc);
#endif