| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unfortunately, to maintain API compatibility, `replace` needs to be a
regular borrow, so we need interior mutability with
`UnsafeCell`. Simultaneously, `HandlerArray` needs to be `const fn` so
it can be used where `lazy_static` isn't available, which means it
needs to initialize its array in one go without the help of
`MaybeUninit`. To do that, `Handler` must be `Copy`, but since it
contains an `UnsafeCell` now, it cannot be copy.
And thus we are boned. There are times when I think the premise of
rust is admirable, but implementation is impossible.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add feature flag for const-fn functionality, which simplifies some
things and lets this crate run on architectures where atomic CAS
isn't available (e.g., thumbv6).
* Remove `const fn` where necessary to compile under rust-stable.
* BREAKING CHANGE - Change signature of `Handler::replace` to take a
mutable borrow. This is required because the underlying type is
now a NonNull, which needs `mut`. The old behavior was never
desired, but a consequence of trying to avoid `Option` by using a
default handler.
* Use lazy_static crate for initialization of Handler/HandlerArray.
* Specify Sync for Handler. This is not amazing, since it isn't, but
it's necessary for initialization in static contexts inside
`lazy_static`. This should be fine, because any actual
manipulation of the handler is done in unsafe functions.
|
|
|
|
|
| |
To get this to work, either `FnMut` traits need to be allowed in
`const fn` in stable, or `Handler::new` needs to be non-`const`.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Create HandlerArray as a safe wrapper around Handler.
* Add Cargo features for HandlerArray size.
* Move Handler into sub-module.
* Add CriticalSection sub-module for architecture dependent support
of interrupt-free contexts.
* Add build rules to pull in cortex-m support for CriticalSection
automatically.
|
|
|