-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add initial libstd support for Xous #104101
Conversation
r? @m-ou-se (rustbot has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
Please let me know if there is anything I should do in order to make this merge easier, please let me know. This is my first relatively major change to libstd. Note that this will not build unless you have the latest |
766e1f8
to
b535859
Compare
Some changes occurred in compiler/rustc_codegen_gcc cc @antoyo These commits modify compiler targets. Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @Folyd, @jsha Some changes occurred in src/librustdoc/clean/types.rs cc @camelid A change occurred in the Ayu theme. cc @Cldfire Some changes occurred in HTML/CSS themes. |
f4db122
to
2664881
Compare
☔ The latest upstream changes (presumably #103723) made this pull request unmergeable. Please resolve the merge conflicts. |
2664881
to
3b3a32f
Compare
I rebased to the latest |
This does not affect the bootstrap code, do @rustbot label -A-bootstrap. |
I'm in the process of reworking this so that it passes tests. I've gotten libunwind functioning, and now I can actually run the Rust libstd test suite. I've discovered some issues in the TLS implementation, as well as potential issues in the Condvar or Mutex implementation. I will work on those issues and remove the |
☔ The latest upstream changes (presumably #107405) made this pull request unmergeable. Please resolve the merge conflicts. |
@xobs any updates on this? |
3b3a32f
to
3978372
Compare
The xous filesystem support is not yet ready for merging. Signed-off-by: Sean Cross <[email protected]>
Xous does not yet support spawning processes. Signed-off-by: Sean Cross <[email protected]>
Don't add the origin rpath when calling the linker. This is unnecessary on Xous since there is no dynamic linker, and Xous can use an ordinary bare-metal linker with no rpath options. As part of this patch, the logic was inverted so that the "else" clause contains everything except "windows" and "xous". Signed-off-by: Sean Cross <[email protected]>
Basic alloc support on Xous is supported by the `dlmalloc` crate. This necessitates bumping the dlmalloc version to 0.2.4. Signed-off-by: Sean Cross <[email protected]>
Xous does not properly handle invalid instructions. Instead, call `__rust_abort` and exit normally. Signed-off-by: Sean Cross <[email protected]>
Xous has a concept of `services` that provide various features. Processes may connect to these services by name or by address. Most services require a name server in order to connect. Add a file with the most common services, and provide a way to connect to a service by querying the name server. Signed-off-by: Sean Cross <[email protected]>
Add support for stdout. This enables basic console printing via `println!()`. Output is written to the log server. Signed-off-by: Sean Cross <[email protected]>
Add support for determining the current time. This connects to the ticktimer server in order to get the system uptime. Signed-off-by: Sean Cross <[email protected]>
Add initial support for threads on Xous. This includes thread creation and joining. Signed-off-by: Sean Cross <[email protected]>
Add an implementation of thread local storage. This uses a container that is pointed to by the otherwise-unsed `$tp` register. This container is allocated on-demand, so threads that use no TLS will not allocate this extra memory. Signed-off-by: Sean Cross <[email protected]>
Add support for Condvar, Mutex, and RWLock. These are all backed by the ticktimer server. Signed-off-by: Sean Cross <[email protected]>
The Xous operating system has no libc, and relies on `compiler_builtins` to supply basic functions such as `memcpy`. Bump the version to 0.1.101 to pull in a version of this crate with the flag enabled for Xous. Signed-off-by: Sean Cross <[email protected]>
Xous passes slice pointers around in order to manipulate memory. This is feature-gated behind `slice_ptr_len`. Xous is currently the only target to use this feature, so gate it behind an OS flag. Signed-off-by: Sean Cross <[email protected]>
00b5e8d
to
6c32a64
Compare
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but @m-ou-se may want to take a look at it too. If not r=me.
What are the next steps to getting this merged? |
☀️ Test successful - checks-actions |
Finished benchmarking commit (ae9c330): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 631.926s -> 631.537s (-0.06%) |
This patchset adds some minimal support to the tier-3 target
riscv32imac-unknown-xous-elf
. The following features are supported:Additionally, internal support for the various Xous primitives surrounding IPC have been added as part of the Xous FFI. These may be exposed as part of
std::os::xous::ffi
in the future, however for now they are not public.This represents the minimum viable product. A future patchset will add support for networking and filesystem support.