Skip to content
  • Soby Mathew's avatar
    Multi-console: Deprecate the `finish_console_register` macro · cc5859ca
    Soby Mathew authored
    
    
    The `finish_console_register` macro is used by the multi console
    framework to register the `console_t` driver callbacks. It relied
    on weak references to the `ldr` instruction to populate 0 to the
    callback in case the driver has not defined the appropriate
    function. Use of `ldr` instruction to load absolute address to a
    reference makes the binary position dependant. These instructions
    should be replaced with adrp/adr instruction for position independant
    executable(PIE). But adrp/adr instructions don't work well with weak
    references as described in GNU ld bugzilla issue 22589.
    
    This patch defines a new version of `finish_console_register` macro
    which can spcify which driver callbacks are valid and deprecates the
    old one. If any of the argument is not specified, then the macro
    populates 0 for that callback. Hence the functionality of the previous
    deprecated macro is preserved. The USE_FINISH_CONSOLE_REG_2 define
    is used to select the new variant of the macro and will be removed
    once the deprecated variant is removed.
    
    All the upstream console drivers have been migrated to use the new
    macro in this patch.
    
    NOTE: Platforms be aware that the new variant of the
    `finish_console_register` should be used and the old variant is
    deprecated.
    
    Change-Id: Ia6a67aaf2aa3ba93932992d683587bbd0ad25259
    Signed-off-by: default avatarSoby Mathew <soby.mathew@arm.com>
    cc5859ca