This change updates the `help` console command to list the available
commands alphabetically, but only when we're not panicking. This makes
`help`'s helping more helpful.
This will allow in the future multiple instances of it to be active at
at a time. Place the current console in a new TLS slot per thread so
threads created as a side effect of console commands can properly run
commands.
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.
No need to malloc this memory if it's always going to be initialized
anyway. Add history disabling switch to a few targets to make sure both
builds are tested.
Nothing was using console_register_commands so just move the command
block into a read only section. Remove the linked list stuff but add a
block name to print in its place.
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.
Almost nothing changes here except moving braces to the same line as the
function declaration. Everything else is largely whitespace changes and
a few dangling files with tab indents.
See scripts/codestyle
Ran everything through scripts/codestyle.space, which uses astyle
to generally follow K&R style.
Biggest non whitespace change is pulling brackets down on function
declarations, which I'm pretty ambivalent about, but astyle insists
on taking a stance
This fixes a bug in x86-64 where it was trying to default align
input sections on 16 byte boundaries, which was screwing up the
padding between structures.
This allows for individual modules to extend the main linker script,
primarily to add their own sections to interate over.
Remove the main shared_* linker scripts.
This picks up the major work of allowing multiple heap implementations
and enable dlmalloc as an alternate heap to the simple existing one
(now called 'miniheap').
Also added a novm page allocator for memory management on systems too small
or missing an mmu to have a vm. Not much more than a simple bitmap allocator
that the heap pulls from. Allows for other heaps and/or users of physical
memory to coexist and span multiple banks of memory.
-Remove top level DEBUG=<N> define
-Rename DEBUGLEVEL to LK_DEBUGLEVEL to be clear.
-Fix the places that used DEBUGLEVEL and the few spots that #ifdef
on DEBUG.
To be more consistent, rename make variable INCLUDES to GLOBAL_INCLUDES.
Also remove the need to put -I in front of each field, the make system
will do that for you.
To fix your module makefiles:
-Change INCLUDES -> GLOBAL_INCLUDES
-Remove -I prefix
During a standard boot command_lock receives the same address
each time and in the case of reset this means it will fail the
mutex check. Changing to calloc ensures the state has been cleared
on reset.