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

posix: options: add XSI_REALTIME option group #83303

Conversation

@cfriedt cfriedt requested a review from ycsin December 21, 2024 15:23
@cfriedt cfriedt force-pushed the issues/82004/posix-create-xsi-realtime-option-group branch 2 times, most recently from da74584 to 3a0cd37 Compare December 21, 2024 15:36
@cfriedt cfriedt force-pushed the issues/82004/posix-create-xsi-realtime-option-group branch 5 times, most recently from 57c39c1 to 4271c7a Compare December 22, 2024 16:24
@cfriedt cfriedt force-pushed the issues/82004/posix-create-xsi-realtime-option-group branch 2 times, most recently from c66b962 to 561d6c0 Compare December 23, 2024 02:23
@cfriedt cfriedt marked this pull request as ready for review December 23, 2024 10:52
@zephyrbot zephyrbot added the area: POSIX POSIX API Library label Dec 23, 2024
@cfriedt cfriedt requested a review from ycsin December 23, 2024 12:13
ycsin
ycsin previously approved these changes Dec 24, 2024
Copy link
Member

@ycsin ycsin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cfriedt
Copy link
Member Author

cfriedt commented Dec 24, 2024

Reviewers might want to take a look workarounds for some weird corner cases

  • demand paging / default ram backend instead of no implementation (@npitre)
  • xtensa linker script syntax error (@ceolin)
  • 32-bit x86 and userspace issue (@dcpleung)

The latter two should be reproducible by undoing the workaround commits.

@cfriedt
Copy link
Member Author

cfriedt commented Jan 7, 2025

I'll see if I can separate this PR into smaller, more manageable ones.

Currently, it's blocking #81859, #79454, and others and should have reviews by @dcpleung @ceolin and @npitre on the topics mentioned above.

@cfriedt cfriedt force-pushed the issues/82004/posix-create-xsi-realtime-option-group branch from 561d6c0 to ec1234e Compare January 7, 2025 12:58
@cfriedt
Copy link
Member Author

cfriedt commented Jan 7, 2025

  • rebase on main

@cfriedt cfriedt force-pushed the issues/82004/posix-create-xsi-realtime-option-group branch from 318ec45 to 28baf38 Compare January 22, 2025 12:30
@cfriedt cfriedt force-pushed the issues/82004/posix-create-xsi-realtime-option-group branch 4 times, most recently from 287ed0e to 565214f Compare January 28, 2025 03:15
#
# SPDX-License-Identifier: Apache-2.0

config XOPEN_STREAMS
Copy link
Member Author

@cfriedt cfriedt Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be deprecated and renamed XSI_STREAMS. That's a change for another PR though.

Comment on lines +7 to +8
depends on POSIX_SINGLE_PROCESS
depends on POSIX_TIMERS
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that XSI_SINGLE_PROCESS should select these other options, similarly to how it's done for XSI_REALTIME. That's a change for another PR though.

@cfriedt cfriedt force-pushed the issues/82004/posix-create-xsi-realtime-option-group branch 3 times, most recently from 9b8b32a to 1966a6d Compare January 28, 2025 13:41
@cfriedt cfriedt added area: Documentation and removed area: X86 x86 Architecture (32-bit) labels Jan 28, 2025
@cfriedt cfriedt assigned cfriedt and unassigned dcpleung Jan 28, 2025
@cfriedt cfriedt force-pushed the issues/82004/posix-create-xsi-realtime-option-group branch from 1966a6d to be5622f Compare January 28, 2025 14:24
For the REALTIME_MINIMAL Application Environment Profile, uncomment
the POSIX_MEMLOCK, POSIX_MEMLOCK_RANGE, POSIX_MEMORY_PROTECTION,
POSIX_MAPPED_FILES, and POSIX_SHARED_MEMORY_OBJECTS options.

These should have been uncommented back when Kconfig options for
those features were added, so this can probably be called a
Kconfig bug.

Signed-off-by: Chris Friedt <[email protected]>
Since XSI is composed of several distinct POSIX Option Groups
split Kconfig.xsi into separate files - one for each Option
Group.

Signed-off-by: Chris Friedt <[email protected]>
@cfriedt cfriedt force-pushed the issues/82004/posix-create-xsi-realtime-option-group branch from be5622f to 4928880 Compare January 28, 2025 23:48
@cfriedt
Copy link
Member Author

cfriedt commented Jan 28, 2025

@ycsin - should be green shortly (finally 😅)

Comment on lines 78 to 79
if (NOT CONFIG_TC_PROVIDES_POSIX_MEMORY_PROTECTION)
zephyr_library_sources_ifdef(CONFIG_POSIX_MEMORY_PROTECTION mprotect.c)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (NOT CONFIG_TC_PROVIDES_POSIX_MEMORY_PROTECTION)
zephyr_library_sources_ifdef(CONFIG_POSIX_MEMORY_PROTECTION mprotect.c)
if(NOT CONFIG_TC_PROVIDES_POSIX_MEMORY_PROTECTION)
zephyr_library_sources_ifdef(CONFIG_POSIX_MEMORY_PROTECTION mprotect.c)

(for a future PR)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch - we should probably have a cmake linter in GH actions

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nordicjm - created #84876

@@ -154,6 +142,15 @@ if (NOT CONFIG_TC_PROVIDES_POSIX_THREADS)
)
endif()

if (NOT CONFIG_TC_PROVIDES_XSI_REALTIME)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (NOT CONFIG_TC_PROVIDES_XSI_REALTIME)
if(NOT CONFIG_TC_PROVIDES_XSI_REALTIME)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

Add a POSIX Option Group called XSI_REALTIME (with Kconfig
option CONFIG_XSI_REALTIME).

When XSI_REALTIME is selected (or when required POSIX Options
are enabled), define _XOPEN_REALTIME to be something other
than -1 (_XOPEN_VERSION seemed appropriate).

Signed-off-by: Chris Friedt <[email protected]>
Mark the XSI_REALTIME Option Group as supported, such that the
_XOPEN_REALTIME feature test macro may be tested.

Signed-off-by: Chris Friedt <[email protected]>
@cfriedt cfriedt force-pushed the issues/82004/posix-create-xsi-realtime-option-group branch from 4928880 to 16443cb Compare January 29, 2025 15:18
@cfriedt cfriedt requested a review from nordicjm January 29, 2025 15:39
Copy link
Member

@ycsin ycsin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cfriedt
Copy link
Member Author

cfriedt commented Feb 2, 2025

@nordicjm - would you consider giving a second approval?

@kartben kartben merged commit 1237c86 into zephyrproject-rtos:main Feb 3, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

posix: create XSI_REALTIME option group
6 participants