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
Merged

kernel: make user-kernel boundary in Chip #1191

merged 1 commit into from
Oct 29, 2018

Conversation

bradjc
Copy link
Contributor

@bradjc bradjc 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
Copy link
Contributor Author

bradjc commented Oct 24, 2018

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

@bradjc bradjc added the release-blocker Issue or PR that must be resolved before the next release label Oct 25, 2018
Copy link
Member

@ppannuto ppannuto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

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.
Copy link
Member

@ppannuto ppannuto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

alevy commented Oct 29, 2018

bors r+

bors bot added a commit that referenced this pull request Oct 29, 2018
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 <[email protected]>
@bors
Copy link
Contributor

bors bot commented Oct 29, 2018

Build succeeded

@bors bors bot merged commit 0891b60 into master Oct 29, 2018
@bors bors bot deleted the new-mpu-new-chip branch October 29, 2018 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-blocker Issue or PR that must be resolved before the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants