Page MenuHomeFreeBSD

Properly define static mutex in mlx4 core
Needs ReviewPublic

Authored by hselasky on Dec 18 2017, 3:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 7 2024, 10:38 PM
Unknown Object (File)
Dec 20 2023, 4:00 AM
Unknown Object (File)
Oct 17 2023, 8:01 AM
Unknown Object (File)
Jul 6 2023, 6:46 PM
Unknown Object (File)
Jun 26 2023, 12:24 PM
Unknown Object (File)
Jun 18 2023, 7:34 PM
Unknown Object (File)
Jun 15 2023, 6:48 PM
Unknown Object (File)
Mar 27 2023, 12:10 PM
Subscribers

Details

Reviewers
cperciva

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 13641

Event Timeline

(Continuing on from the email thread:)

Can you explain what you mean by safe?
DEFINE_MUTEX() is simply a wrapper for another SYSINIT. It has nothing to do with the function it is placed inside.

DEFINE_MUTEX is a wrapper for SYSINIT, and SYSINIT creates some structures, one of which is declared to be placed in the "set_sysinit_set" segment. Since the concept of placing symbols into different segments is not specified in either the C or POSIX standards, I don't know if there's any guarantee that function-scope symbols can be declared as being located in specific segments.

In any event, I've changed my WIP so that it doesn't break here, so there's no immediate problem; this is just a concern about the possibility of things breaking in the future.

Hi,

Try to look at the generated assembly code from the compiler. The section attributes should be clearly marked in the output.

Anyway, having the "static" outside the function is more clean code wise.

--HPS