Skip to content

Does this transition_to_single_core_main work on the rpi4? #137

Description

@nihalpasham

I guess this is more of a question than an issue but I've found that the rpi4 doesnt produce the expected result when using atomic operations.

So, I have 2 atomic operations lined up one after the other. I'd have expected an Ok(1) after the compare and swap.

    info!("kernel_state: {:?}", state::state_manager().0.load(Ordering::Acquire));
    info!("compare and swap {:?}", state::state_manager().0
            .compare_exchange(
                state::StateManager::INIT,
                state::StateManager::SINGLE_CORE_MAIN,
                Ordering::Acquire,
                Ordering::Relaxed,
            ));

but instead I get an error.

[    0.481485] kernel_state: 0
[    0.484178] compare and swap Err(1)

Question:
The MMU is disabled. I'm not familiar with atomic instructions but for atomic operations to work on the rpi4, must the MMU be enabled. Is this correct? I was going to test this by enabling the MMU but just wanted to check before I head down this road.

Note:

Activity

  1. andre-richter commented on Jan 8, 2022

    @andre-richter
    Member

    MMU must be enabled.

    See: #132

  2. nihalpasham commented on Jan 8, 2022

    @nihalpasham
    Author

    Thank you. I must say - (for an opensource tutorial) the turn around time on a response here is awesome (something I wish more projects emulated).

    Thanks again 👍

  3. locked and limited conversation to collaborators on Jan 9, 2022
  4. converted this issue into a discussion #140 on Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions