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

_THREAD_QUEUED overlaps with x86 _EXC_ACTIVE in k_thread.thread_state #17361

Closed
ghost opened this issue Jul 5, 2019 · 1 comment · Fixed by #19261
Closed

_THREAD_QUEUED overlaps with x86 _EXC_ACTIVE in k_thread.thread_state #17361

ghost opened this issue Jul 5, 2019 · 1 comment · Fixed by #19261
Labels
area: X86 x86 Architecture (32-bit) bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@ghost
Copy link

ghost commented Jul 5, 2019

kernel/include/kernel_structs.h (line 53) says:

#define _THREAD_QUEUED (BIT(6))

and arch/x86/include/ia32/kernel_arch_data.h(line 60) says:

#define _EXC_ACTIVE (1 << 6)

These are both bit definitions for k_thread.thread_state. I think this is ... bad. Am I crazy?

@ghost ghost added bug The issue is a bug, or the PR is fixing a bug area: X86 x86 Architecture (32-bit) labels Jul 5, 2019
@ghost ghost changed the title _THREAD_STATE_QUEUED overlaps with x86 _EXC_ACTIVE in k_thread.thread_state _THREAD_QUEUED overlaps with x86 _EXC_ACTIVE in k_thread.thread_state Jul 5, 2019
@ghost
Copy link
Author

ghost commented Jul 5, 2019

A brief once-over of the scheduling code leads me to believe that this isn't an immediate problem, as I think _THREAD_QUEUED is only used when SMP. Should probably rectify this though, lest we be surprised in the future.

Note that fixing this probably will require widening thread_state because it's 8 bits, and at first glance it looks like we need 9.

@ghost ghost self-assigned this Jul 5, 2019
@ghost ghost added the priority: low Low impact/importance bug label Jul 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: X86 x86 Architecture (32-bit) bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

0 participants