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

kernel: make user-kernel boundary in Chip #1191

Merged
merged 1 commit into from Oct 29, 2018

Conversation

@bradjc
Copy link
Contributor

commented Oct 17, 2018

Pull Request Overview

This pull request adds a new trait type to the Chip trait that represents the code that handles switching between kernelspace and userspace. Because this is a hardware feature, it makes sense to include it with the chip so that a user doesn't accidentally choose the wrong arch for a given MCU.

pub trait Chip {
    type MPU: mpu::MPU;
    type UserspaceKernelBoundary: syscall::UserspaceKernelBoundary;
    type SysTick: systick::SysTick;
    ...

This also simplifies main.rs as now setting up processes and the kernel only requires passing in the chip.

Testing Strategy

This pull request was tested by running a hail kernel.

TODO or Help Wanted

n/a

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make formatall.

@bradjc bradjc force-pushed the new-mpu-new-chip branch from 6282006 to 4561a1c Oct 19, 2018

@bradjc bradjc referenced this pull request Oct 19, 2018

Closed

Tracking: Make Tock Architecture Agnostic #985

9 of 9 tasks complete
@bradjc

This comment has been minimized.

Copy link
Contributor Author

commented Oct 24, 2018

This should be rejected or merged before release testing (obviously I vote merged!).

@ppannuto
Copy link
Member

left a comment

From a skim of the changes, it's not immediately obvious why, but presumably after the rebase, something broke and this doesn't work for me. From minimal debugging, it looks like it hangs at the first syscall? (tested hail+blink, hail+c_hello)

kernel: make user-kernel boundary in Chip
This removes the burden that the board author has to think about this,
since once the chip has been decided, the architecture has been decided
as well.

@ppannuto ppannuto force-pushed the new-mpu-new-chip branch from 4561a1c to 0891b60 Oct 26, 2018

@ppannuto
Copy link
Member

left a comment

Turns out this just needed to be rebased further to pick up the fix the from #1196.

Tested and working on hail+blink/c_hello/accel_leds. Looks good overall.

@alevy

This comment has been minimized.

Copy link
Member

commented Oct 29, 2018

bors r+

bors bot added a commit that referenced this pull request Oct 29, 2018

Merge #1191
1191: kernel: make user-kernel boundary in Chip r=alevy a=bradjc



### Pull Request Overview

This pull request adds a new trait type to the `Chip` trait that represents the code that handles switching between kernelspace and userspace. Because this is a hardware feature, it makes sense to include it with the chip so that a user doesn't accidentally choose the wrong arch for a given MCU.

```rust
pub trait Chip {
    type MPU: mpu::MPU;
    type UserspaceKernelBoundary: syscall::UserspaceKernelBoundary;
    type SysTick: systick::SysTick;
    ...
```

This also simplifies main.rs as now setting up processes and the kernel only requires passing in the chip.

### Testing Strategy

This pull request was tested by running a hail kernel.


### TODO or Help Wanted

n/a


### Documentation Updated

- [x] Updated the relevant files in `/docs`, or no updates are required.

### Formatting

- [x] Ran `make formatall`.


Co-authored-by: Brad Campbell <bradjc5@gmail.com>
@bors

This comment has been minimized.

Copy link
Contributor

commented Oct 29, 2018

@bors bors bot merged commit 0891b60 into master Oct 29, 2018

4 checks passed

bors Build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details

@bors bors bot deleted the new-mpu-new-chip branch Oct 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.