-
Notifications
You must be signed in to change notification settings - Fork 109
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
Create a libtock-platform crate including syscalls + async traits. #217
Labels
Comments
jrvanwhy
added a commit
to jrvanwhy/libtock-rs
that referenced
this issue
Jul 8, 2020
Currently, the crate is just a skeleton. I will add functionality in future PRs (I am merging an empty crate so that I can send PRs in parallel in the future). I will be replacing the system call layer in libtock_core::syscalls with a new layer in libtock_platform. libtock_core depends on libtock_platform and will re-export its functionality. This work is tracked at tock#217
jrvanwhy
added a commit
to jrvanwhy/libtock-rs
that referenced
this issue
Jul 10, 2020
Currently, the crate is just a skeleton. I will add functionality in future PRs (I am merging an empty crate so that I can send PRs in parallel in the future). I will be replacing the system call layer in libtock_core::syscalls with a new layer in libtock_platform. libtock_core depends on libtock_platform and will re-export its functionality. This work is tracked at tock#217
bors bot
added a commit
that referenced
this issue
Jul 17, 2020
220: Add the `libtock_platform` crate. r=bradjc a=jrvanwhy Currently, the crate is just a skeleton. I will add functionality in future PRs (I am merging an empty crate so that I can send PRs in parallel in the future). I will be replacing the system call layer in libtock_core::syscalls with a new layer in libtock_platform. libtock_core depends on libtock_platform and will re-export its functionality. This work is tracked at #217 Co-authored-by: Johnathan Van Why <jrvanwhy@google.com>
This was referenced Sep 23, 2020
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am splitting PR #211 into multiple pieces. This issue is to document, discuss, and track those refactoring efforts.
As a high-level overview, I would ilke to do the following:
libtock-core
into multiple crates that live in thecore/
directory.libtock-core
would remain as a crate that aggregates all the functionality, so that applications only need to use one crate directly. Examples and integration tests would live incore/examples
andcore/tests
, so they can depend onlibtock-core
's cumulative functionality.libtock-platform
crate should have unit tests that run on the host system via a trivialcargo test
. These tests are easier and faster to run that on-device tests, and can be run undercargo miri
for undefined behavior detection. This is the idea discussed at [RFC] Reorganize libtock-rs for testability #132 (comment)In particular, I intend to create a
libtock-platform
crate that contains the following:Syscalls
) representing raw system calls. There is no implementation of this trait inlibtock-platform
, aslibtock-platform
is OS-independent. Instead, separate crates (probablylibtock-runtime
and a testing crate) will provide implementations ofSyscalls
.Platform
struct that provides a higher-level interface over theSyscalls
trait, supporting an asynchronous execution model similar to that used by the Tock kernel.Platform
is not implemented yet. Its API is presented in the form of thePlatformApi
trait, which is currently partially written, so that otherlibtock-core
components can easily be generic over the platform type.ErrorCode
andReturnCode
types that form efficient abstractions around the kernel'sReturnCode
type.StaticCallback
,AsyncCall
, andCallback
. These should allow forlibtock-core
to provide a generic adapter for synchronous APIs and a futures-based adapter for synchronous APIs, plus prevent a recursion issue the Tock kernel has experienced.In future work, I will implement
libtock-runtime
, which will provide the realSyscalls
implementation and entry point forlibtock-core
. I will probably pull thepanic_handler
,start
implementation, and allocator into separate crates so that applications can switch between them.libtock-core
will pull in everything by default for clients that want the convenience.The text was updated successfully, but these errors were encountered: