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

lib: posix: dynamic stack support for pthread_create #44727

Commits on Jul 21, 2023

  1. kernel: dynamic: remove unnecessary size assignment

    Previously, the kernel stack size was adjusted for no apparent
    reason.
    
    Signed-off-by: Christopher Friedt <[email protected]>
    cfriedt committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    43ffae2 View commit details
    Browse the repository at this point in the history
  2. kernel: dynamic: declare dynamic stubs when disabled

    With some of the recent work to disable unnecessary system
    calls, there is a scenario where `z_impl_k_thread_stack_free()`
    is not defined and an undefined symbol error occurs.
    
    Safety was very concerned that dynamic thread stack code might
    touch other code that does not malloc, so add a separate file
    for the stack alloc and free stubs.
    
    Signed-off-by: Christopher Friedt <[email protected]>
    cfriedt committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    e5e7992 View commit details
    Browse the repository at this point in the history
  3. pthread: facilitate dynamically allocated thread stacks

    This change allows users to call pthread_create() with
    the pthread_attr_t argument equal to NULL.
    
    If Zephyr is configured with `CONFIG_DYNAMIC_THREAD`, then a
    suitable thread stack will be allocated via
    k_thread_stack_alloc(). The allocated thread stack is
    automatically freed via k_thread_stack_free().
    
    This makes the Zephyr implementation of pthread_create()
    compliant with the normative spec.
    
    Signed-off-by: Christopher Friedt <[email protected]>
    cfriedt committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    d0da8c3 View commit details
    Browse the repository at this point in the history
  4. pthread: test: facilitate dynamically allocated thread stacks

    Tests for dynamically allocated POSIX thread stacks.
    
    Signed-off-by: Christopher Friedt <[email protected]>
    cfriedt committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    4a69113 View commit details
    Browse the repository at this point in the history