• Jeffrey Lee's avatar
    More flexible handling of atomics on pre-ARMv6K · afa04ff1
    Jeffrey Lee authored
    For pre-ARMv6K, we generally have two sets of atomic routines available:
    
    * Fast routines which use a SWP spinlock, but are unsafe for use from
    interrupt handlers and the like
    * Safe routines which disable IRQs, but (in usermode) are much slower
    due to requiring SWI calls to enable/disable IRQs.
    
    Currently CLib decides which set of routines to use: modules get the
    slow & safe ones, while applications get the fast & unsafe ones.
    
    This change gives control of that choice to the program, by introducing
    the _kernel_init_flags variable. The stub code will (weakly) import this
    symbol and pass the value to CLib when calling the init SWI. CLib will
    then use the value to decide whether to fill the stubs with the safe or
    unsafe versions of the routines.
    
    With this change, the default is now to use the slow & safe routines,
    for both modules and applications. This is to ensure that code which is
    written/tested for ARMv6K+ machines won't run into unexpected issues
    when r...
    afa04ff1
VersionNum 679 Bytes