• Alessandro Rubini's avatar
    shell: reorganize parsing using .cmd ELF section · a9ce831d
    Alessandro Rubini authored
    This commit creates a .cmd section, so there is no global list of
    commands in shell.c any more, and no ifdef in the code for conditional
    commands.  Also, (unrelated) makes shell errors slightly more friendly.
    
    The technique is widely used, in the Linux kernel and all boot
    loaders, as well as a lot of my own personal code, so this is safe
    (and tested).
    
    As a side effect, this allows (in later commits) to move the "verbose"
    ppsi-specific command back to ppsi/arch-wrpc/ where it really belongs.
    It allows new commands to be easily added by just adding their
    respective file to the build.
    
    Even though this increases code size by around 50 lines, it makes it
    more modular and only costs 8 bytes in the final executable (in my
    configuration: 128 bytes less of text and 136 bytes more of data).
    Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    a9ce831d
Name
Last commit
Last update
..
cmd_calib.c Loading commit data...
cmd_gui.c Loading commit data...
cmd_init.c Loading commit data...
cmd_ip.c Loading commit data...
cmd_mac.c Loading commit data...
cmd_mode.c Loading commit data...
cmd_pll.c Loading commit data...
cmd_ptp.c Loading commit data...
cmd_ptrack.c Loading commit data...
cmd_sdb.c Loading commit data...
cmd_sfp.c Loading commit data...
cmd_stat.c Loading commit data...
cmd_time.c Loading commit data...
cmd_verbose.c Loading commit data...
cmd_version.c Loading commit data...
environ.c Loading commit data...
shell.c Loading commit data...
shell.mk Loading commit data...