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

core: move scheduler defines #15481

Merged
merged 11 commits into from
Nov 23, 2020
Merged

Conversation

kaspar030
Copy link
Contributor

@kaspar030 kaspar030 commented Nov 20, 2020

Contribution description

This PR moves some defines that clearly belong to scheduler/threading into from kernel_types.h to sched.h.

Testing procedure

Only moved code, successful CI run should be sufficient.

Issues/PRs references

@kaspar030 kaspar030 added Area: core Area: RIOT kernel. Handle PRs marked with this with care! Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Nov 20, 2020
@kaspar030 kaspar030 requested review from benpicco and maribu November 20, 2020 10:54
@benpicco
Copy link
Contributor

Looks like kernel_types.h is empty now safe for those SSIZE_MAX shenanigans.
But SSIZE_MAX is not used anywhere in the code, so we might as well delete that too.

@kaspar030
Copy link
Contributor Author

Looks like kernel_types.h is empty now safe for those SSIZE_MAX shenanigans.
But SSIZE_MAX is not used anywhere in the code, so we might as well delete that too.

hah, but kernel_types.h is included by 53 files. Merge this one and I open another PR for the removal of kernel_types.h?

@benpicco
Copy link
Contributor

benpicco commented Nov 20, 2020

sure, but you might as well drop SSIZE_MAX while you are touching this file.

@kaspar030
Copy link
Contributor Author

kaspar030 commented Nov 20, 2020

sure, but you might as well drop SSIZE_MAX while you are touching this file.

well, IMO one thing at a time makes things easier to handle... do you mind?

I pushed a commit adding an include of inttypes.h to sched.h.

benpicco
benpicco previously approved these changes Nov 20, 2020
Copy link
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

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

Sure, just thought this would be a trivial removal either way.
But if CI is happy, this should be good.

@kaspar030
Copy link
Contributor Author

I fixed the remaining warts, some files needed to replace a "kernel_types.h" with "sched.h", some were missing "limits.h" now.

@benpicco
Copy link
Contributor

Just squash that single fixup so Murdock doesn't have to run twice

@kaspar030 kaspar030 force-pushed the refactor_thread_defines branch from 4cd9138 to d6b6c0e Compare November 23, 2020 15:56
ndn.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/face-table.h b/face-table.h
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you do a PR to https://github.com/named-data-iot/ndn-riot as a follow-up?
It feels a bit silly to carry downstream patches to a project that targets RIOT exclusively.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably do the same for the other two patches in pkg/ndn-riot/patches, those also stem from previous API changes in RIOT

/**
* Unique process identifier
*/
typedef int16_t kernel_pid_t;
Copy link
Contributor

Choose a reason for hiding this comment

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

What meaning do negative pids have?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there's a KERNEL_PID_UNDEF that's -1? Anyhow, this is all copied and otherwise unchanged.

Copy link
Contributor

Choose a reason for hiding this comment

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

You just moved KERNEL_PID_UNDEF 😉

It's 0 - so that's why I'm wondering what negative PIDs mean.

Copy link
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

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

simple cleanup, if Murdock is happy this should be good.

@benpicco
Copy link
Contributor

uncrustify is not happy :(

@kaspar030
Copy link
Contributor Author

kaspar030 commented Nov 23, 2020

uncrustify is not happy

I think this was it:

file does not have a C++ compatible header: 'core/include/kernel_types.h

@benpicco
Copy link
Contributor

Huh I thought you removed kernel_types.h - is it still used by anything after this?

@kaspar030
Copy link
Contributor Author

Huh I thought you removed kernel_types.h - is it still used by anything after this?

Yeah, I'm removing the remaining uses in #15482.

@benpicco benpicco merged commit b3b07e4 into RIOT-OS:master Nov 23, 2020
@kaspar030 kaspar030 deleted the refactor_thread_defines branch November 25, 2020 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: core Area: RIOT kernel. Handle PRs marked with this with care! CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants