• Jeffrey Lee's avatar
    Support runtime selection of pagetable format · ba993cb5
    Jeffrey Lee authored
    Runtime selection between long descriptor and short descriptor page
    table format is now possible (with the decision based on whether the HAL
    registers any high RAM or not). The main source changes are as follows:
    
    * LongDesc and ShortDesc switches are in hdr.Options to control what
    kernel variant is built
    * PTOp and PTWhich macros introduced in hdr.ARMops to allow for
    invocation of functions / code blocks which are specific to the page
    table format. If the kernel is being built with only one page table
    format enabled, PTOp is just a BL instruction, ensuring there's no
    performance loss compared to the old code.
    * _LongDesc and _ShortDesc suffixes added to various function names, to
    allow both versions of the function to be included at once if runtime
    selection is enabled
    * Most of the kernel / MMU initialisation code in s.HAL is now encased
    in a big WHILE loop, allowing it to be duplicated if runtime switching
    is enabled (easier than adding dynamic branches all over the place, and
    only costs a few KB of ROM/RAM)
    * Some more functions (notably AccessPhysicalAddress,
    ReleasePhysicalAddress, and MapInIO) have been moved to s.ShortDesc /
    s.LongDesc since they were already 90% specific to page table format
    ba993cb5