Skip to content

Stop ElXVirtualTimer and ElXPhysicalTimer from implementing Send.#170

Open
jonathanpallant wants to merge 1 commit into
mainfrom
timers-no-longer-send
Open

Stop ElXVirtualTimer and ElXPhysicalTimer from implementing Send.#170
jonathanpallant wants to merge 1 commit into
mainfrom
timers-no-longer-send

Conversation

@jonathanpallant
Copy link
Copy Markdown
Contributor

These are core-local types and we need to try and stop people moving them into threads running on other cores, at the expense of stopping people moving them into threads running on the same core.

If this causes you an issue, you can just unsafely conjure up the values on demand, or use raw CP15 sycalls from the aarch32_cpu::register module.

These are core-local types and we need to try and stop people moving
them into threads running on other cores, at the expense of stopping
people moving them into threads running on the same core.

If this causes you an issue, you can just unsafely conjure up the values
on demand, or use raw CP15 sycalls from the aarch32_cpu::register module.
Comment on lines +15 to +17
pub struct El0PhysicalTimer {
_phantom: PhantomData<*const u8>,
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If the goal is to make El0PhysicalTimer non-Send, wouldn't it be better (easier to understand) to do it explicitly?

Suggested change
pub struct El0PhysicalTimer {
_phantom: PhantomData<*const u8>,
}
pub struct El0PhysicalTimer();
impl !Send for El0PhysicalTimer {}

That way, the modifications to the constructor methods wouldn't be needed either.

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.

2 participants