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

Have a way to yield from a task #98

Merged
merged 1 commit into from
Dec 8, 2022
Merged

Have a way to yield from a task #98

merged 1 commit into from
Dec 8, 2022

Conversation

bjoernQ
Copy link
Contributor

@bjoernQ bjoernQ commented Dec 6, 2022

Closes #10

This adds a way to yield from a task that would otherwise just sitting waiting (because it's waiting for something to happen in another task).

This should improve pings and throughput

fn Software1(_level: u32, context: &mut Context) {
let intr = 1 << 29;
unsafe {
core::arch::asm!("wsr.227 {0}", in(reg) intr, options(nostack)); // 227 = "intclear"
Copy link
Member

Choose a reason for hiding this comment

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

Is there really not a mnemonic for int clear? If not I'll file a bug.

pub fn yield_task() {
let intr = 1 << 29;
unsafe {
core::arch::asm!("wsr.226 {0}", in(reg) intr, options(nostack)); // 226 = "intset"
Copy link
Member

Choose a reason for hiding this comment

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

Ditto above

@bjoernQ
Copy link
Contributor Author

bjoernQ commented Dec 6, 2022

Seems there is intclear but apparently not intset

Copy link
Member

@jessebraham jessebraham left a comment

Choose a reason for hiding this comment

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

LGTM

@jessebraham jessebraham merged commit 4d8243f into main Dec 8, 2022
@bjoernQ bjoernQ deleted the improve-scheduler branch December 16, 2022 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the Preemt-Code to make it possible to yield
3 participants