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

percpu reg store this_task #13726

Merged
merged 3 commits into from
Oct 15, 2024
Merged

percpu reg store this_task #13726

merged 3 commits into from
Oct 15, 2024

Commits on Oct 11, 2024

  1. sched: add up_this_task and up_change_task macro stub

    reason:
    We can utilize percpu storage to hold information about the
    current running task. If we intend to implement this feature, we would
    need to define two macros that help us manage this percpu information
    effectively.
    
    up_this_task: This macro is designed to read the contents of the percpu
                  register to retrieve information about the current
                  running task.This allows us to quickly access
                  task-specific data without having to disable interrupts,
                  access global variables and obtain the current cpu index.
    
    up_update_task: This macro is responsible for updating the contents of
                    the percpu register.It is typically called during
                    initialization or when a context switch occurs to ensure
                    that the percpu register reflects the information of the
                    newly running task.
    
    Configuring NuttX and compile:
    $ ./tools/configure.sh -l qemu-armv8a:nsh_smp
    $ make
    Running with qemu
    $ qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic \
       -machine virt,virtualization=on,gic-version=3 \
       -net none -chardev stdio,id=con,mux=on -serial chardev:con \
       -mon chardev=con,mode=readline -kernel ./nuttx
    
    Signed-off-by: hujun5 <[email protected]>
    hujun260 committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    647fb1d View commit details
    Browse the repository at this point in the history
  2. arm64: add up_this_task and up_change_task macro impl

    Signed-off-by: hujun5 <[email protected]>
    hujun260 committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    d9dcd40 View commit details
    Browse the repository at this point in the history
  3. arm64: we need to initialize the percpu register storing the current …

    …task more earlier.
    
    A call stack looks like the following:
    sched_idletask
    syslog_write
    nx_vsyslog
    syslog
    getreg64
    gic_validate_redist_version
    arm64_gic_init
    arm64_gic_secondary_init
    arm64_boot_secondary_c_routine
    
    Signed-off-by: hujun5 <[email protected]>
    hujun260 committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    4195630 View commit details
    Browse the repository at this point in the history