Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xous: misc fixes + add network support #119408

Merged
merged 14 commits into from
Jan 22, 2024

Commits on Jan 13, 2024

  1. xous: ffi: fix lend_impl() return values

    The `ret1` and `ret2` return values from lend operations are returned in
    $a1 and $a2. This function incorrectly pulled them from $a6 and $a7,
    causing them to always be `0`.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Jan 13, 2024
    Configuration menu
    Copy the full SHA
    dee1c26 View commit details
    Browse the repository at this point in the history
  2. xous: ffi: correct size of freed memory

    The amount of memory allocated was multiplied by sizeof::<T>(), so the
    amount of memory to be freed should also be multiplied by sizeof::<T>().
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Jan 13, 2024
    Configuration menu
    Copy the full SHA
    944dc21 View commit details
    Browse the repository at this point in the history
  3. xous: std: thread_parking: fix deadlocks

    Fix a deadlock condition that can occur when a thread is awoken in
    between the point at which it checks its wake state and the point where
    it actually waits.
    
    This change will cause the waker to continuously send Notify messages
    until it actually wakes up the target thread.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    bunnie authored and xobs committed Jan 13, 2024
    Configuration menu
    Copy the full SHA
    118e8f7 View commit details
    Browse the repository at this point in the history
  4. std: xous: rework condvar to fix soundness issues

    Rework the Condvar implementation on Xous to ensure notifications are
    not missed. This involves keeping track of how many times a Condvar
    timed out and synchronizing based on that.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Jan 13, 2024
    Configuration menu
    Copy the full SHA
    626926f View commit details
    Browse the repository at this point in the history
  5. std: xous: pass entire memory range to flag updater

    When updating memory flags via `update_memory_flags()`, ensure we
    multiply the slice length by the element size to get the full memory
    size.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Jan 13, 2024
    Configuration menu
    Copy the full SHA
    f732d2b View commit details
    Browse the repository at this point in the history
  6. std: xous: use blocking_scalars for mutex unlock

    Use blocking scalars when unlocking a mutex. This ensures that mutexes
    are unlocked immediately rather than dangling.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Jan 13, 2024
    Configuration menu
    Copy the full SHA
    b5c1c47 View commit details
    Browse the repository at this point in the history
  7. std: xous: rewrite rwlock to be more robust

    Add more checks to RwLock on Xous. As part of this, ensure the variable
    is in a good state when unlocking.
    
    Additionally, use the global `yield_now()` rather than platform-specific
    `do_yield()`.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Jan 13, 2024
    Configuration menu
    Copy the full SHA
    eabd445 View commit details
    Browse the repository at this point in the history
  8. std: once: use queue implementation on Xous

    Use the global queue implementation of Once when running on Xous. This
    gets us a thread-safe implementation, rather than using the
    non-threadsafe `unsupported` implementation.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Jan 13, 2024
    Configuration menu
    Copy the full SHA
    762e58a View commit details
    Browse the repository at this point in the history
  9. std: xous: fix thread_local_key under tests

    When running tests, libstd gets implemented as a second library. Due to
    this fact, the `create()` and `destroy()` functions come from different
    libraries.
    
    To work around this, stash the `destroy_tls()` pointer in the first
    unused slot in the thread local storage pool. That way even if
    the destruction comes from a different version of libstd, the correct
    `DTORS` list will be consulted.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Jan 13, 2024
    Configuration menu
    Copy the full SHA
    007bf7a View commit details
    Browse the repository at this point in the history
  10. std: xous: share allocator symbol in tests

    When using the testing framework, a second copy of libstd is built and
    linked. Use a global symbol for the `DLMALLOC` variable and mark it as
    `extern` when building as a test.
    
    This ensures we only have a single allocator even when running tests.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Jan 13, 2024
    Configuration menu
    Copy the full SHA
    ef4f722 View commit details
    Browse the repository at this point in the history
  11. xous: net: initial commit of network support

    This is an initial commit of network support for Xous.
    
    On hardware, is backed by smoltcp running via a Xous server in a
    separate process space.
    
    This patch adds TCP and UDP client and server support as well as DNS
    resolution support using the dns Xous server.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Jan 13, 2024
    Configuration menu
    Copy the full SHA
    aa8acc2 View commit details
    Browse the repository at this point in the history
  12. std: xous: mark stdio structs as repr(C)

    Ensure these structs have a well-defined ABI layout.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Jan 13, 2024
    Configuration menu
    Copy the full SHA
    aa73860 View commit details
    Browse the repository at this point in the history
  13. std: xous: use constants for stdout and stderr

    Use constants for the opcodes when writing to stdout or stderr.
    
    There still is no stdin operation.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Jan 13, 2024
    Configuration menu
    Copy the full SHA
    99b0659 View commit details
    Browse the repository at this point in the history
  14. xous: thread: mark thread_main() as divergent

    The thread wrapper function never returns, so we can mark it as
    divergent.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Jan 13, 2024
    Configuration menu
    Copy the full SHA
    50e4fed View commit details
    Browse the repository at this point in the history