Comments (8)
It would be great to have no_std
support. We could make use of this in @hermit-os.
How can we help to move this forward? Can we open a PR, or would you rather do that yourself, @andreeaflorescu? :)
from vm-fdt.
It would be great to have
no_std
support. We could make use of this in @hermit-os.How can we help to move this forward? Can we open a PR, or would you rather do that yourself, @andreeaflorescu? :)
Oh, I didn't get much time to work on that, so feel free to open a PR and I'll make time to review it. Here is my branch in case it helps with anything: https://github.com/andreeaflorescu/vm-fdt/commits/no_std
from vm-fdt.
Sounds great, I would support this as I might have a use for this in Rust Hypervisor Firmware.
from vm-fdt.
@danielverkamp what do you think? If this is needed sooner (before the error is stabilized), we can have it as an optional feature. I see that libc and serde also have a no_std option. The way that is implemented is by having std
as the default feature. I think this could easily work for this crate as well.
Examples:
- https://github.com/serde-rs/serde/blob/master/serde/Cargo.toml#L35
- https://github.com/rust-lang/libc/blob/master/Cargo.toml#L24
from vm-fdt.
I agree making it no_std
would be nice. I suppose since it still requires alloc
, it may not be a good fit for really limited embedded environments, but no_std
alone is a good improvement. I guess this would also justify a version bump.
The proposed change looks reasonable; the only minor concern I have is that each property_phandle()
call becomes an O(n)
operation (where n
is the number of existing phandles), since it uses a linear search in a Vec
rather than a HashSet
lookup, but this is probably fine for any reasonably-sized devicetree. (Perhaps we could remove the duplicate phandle checking to avoid that, although I don't have a strong opinion about it.)
from vm-fdt.
I agree making it
no_std
would be nice. I suppose since it still requiresalloc
, it may not be a good fit for really limited embedded environments, butno_std
alone is a good improvement. I guess this would also justify a version bump.
We can extend it once we have it as no_std to also have it as no_alloc I guess. I think we can have static allocation for the data blob, but this require some significant re-working of how it currently works, so I would leave it for the next iteration.
The proposed change looks reasonable; the only minor concern I have is that each
property_phandle()
call becomes anO(n)
operation (wheren
is the number of existing phandles), since it uses a linear search in aVec
rather than aHashSet
lookup, but this is probably fine for any reasonably-sized devicetree. (Perhaps we could remove the duplicate phandle checking to avoid that, although I don't have a strong opinion about it.)
Yes, in my branch I did a quick and dirty fix to get it to compile, I would improve that for the actual PR.
from vm-fdt.
I think having alloc
is very common for many no_std
users so I wouldn't worry about that too much for a first version.
from vm-fdt.
I opened #68.
from vm-fdt.
Related Issues (12)
- Provide a way to disable long running tests on dev machines HOT 1
- Write the `Usage` section of README
- Only allow property to be added after begin node
- Improve the vm-fdt abstractions for v0.2.0 HOT 1
- begin_node does not enforce limits defined in the specification HOT 2
- phandle property uniqueness HOT 1
- Remove/Move max_size parameter from finish function HOT 4
- Check that mem_reservations are valid HOT 2
- Unchecked arithmetic operations in `finish` HOT 1
- Unchecked conversions from usize to u32
- Publish vm-fdt to crates.io HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vm-fdt.