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

Horizon (Nintendo 3DS) pthread functions and non-portable extensions #2715

Merged
merged 6 commits into from
Mar 12, 2022

Commits on Mar 6, 2022

  1. Add some extensions to pthread for armv6k-nintendo-3ds

    The pthread_attr_t type can have priority and affinity values set.
    pthread_getpriority returns the priority of the current thread.
    
    These are needed to enable std thread support. std can't link directly
    with libctru so we go through pthread as an intermediate interface.
    AzureMarker committed Mar 6, 2022
    Configuration menu
    Copy the full SHA
    435f7c3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    eef23c7 View commit details
    Browse the repository at this point in the history
  3. Change wording to "ideal processor" and use "np" suffix

    Also adds a get version, to keep consistency.
    AzureMarker committed Mar 6, 2022
    Configuration menu
    Copy the full SHA
    cf92808 View commit details
    Browse the repository at this point in the history
  4. Replace pthread_getpriority nonstandard function with standard ones

    I chose the scheduler priorities based on
    https://man7.org/linux/man-pages/man7/sched.7.html
    
    I think the cooperative app cores are most like SCHED_FIFO, while the
    sys core is similar to SCHED_RR.
    
    However, I don't think our pthread implementation would be able to
    accurately return the right policy since we need to know what processor
    the thread is running on, and the only API to get that gets the ID for
    the current thread. Since the pthread function passes in a thread ID, we
    are unable to always get the processor ID and thus the policy.
    
    In this case, I think we should just always return (and accept in set)
    SCHED_FIFO. I don't think this will be used anyways.
    AzureMarker committed Mar 6, 2022
    Configuration menu
    Copy the full SHA
    9405ad6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d38b04a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b62064b View commit details
    Browse the repository at this point in the history