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

RTEMS osal queue mixed sizes #1279

Closed
thesamprice opened this issue Aug 20, 2022 · 0 comments · Fixed by #1283
Closed

RTEMS osal queue mixed sizes #1279

thesamprice opened this issue Aug 20, 2022 · 0 comments · Fixed by #1283

Comments

@thesamprice
Copy link

thesamprice commented Aug 20, 2022

Describe the bug
Im using queues to send variable length messages.
RTEMS queue get returns an error if the message queue returned size is not the max buffer size.
https://github.com/nasa/osal/blob/main/src/os/rtems/src/os-impl-queues.c#L235

This doesn't match the posix implementation.
https://github.com/nasa/osal/blob/main/src/os/posix/src/os-impl-queues.c#L194

The above logic in shared/src/osapi-queue.c uses OS_QUEUE_INVALID_SIZE If the queue size is greater than the buffer provided.

        if (size < queue->max_size)
        {
            /*
            ** The buffer that the user is passing in is potentially too small
            */
            *size_copied = 0;
            return_code  = OS_QUEUE_INVALID_SIZE;
        }

To Reproduce
Steps to reproduce the behavior:
Visual inspection.

Expected behavior
Follow the posix logic.

Code snips
See above

System observed on:
MIcroblaze

Additional context
Add any other context about the problem here.

Reporter Info
Sam Price

thesamprice pushed a commit to thesamprice/osal that referenced this issue Aug 20, 2022
thesamprice pushed a commit to thesamprice/osal that referenced this issue Aug 31, 2022
thesamprice pushed a commit to thesamprice/osal that referenced this issue Aug 31, 2022
thesamprice pushed a commit to thesamprice/osal that referenced this issue Aug 31, 2022
thesamprice pushed a commit to thesamprice/osal that referenced this issue Sep 29, 2022
dzbaker added a commit that referenced this issue Oct 11, 2022
Fix #1279, rtems queue multi-size, mimic posix logic
@dmknutsen dmknutsen added this to the Draco milestone Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants