Page MenuHomeFreeBSD

acpica: Add a thread safe acpi_get_name
Needs ReviewPublic

Authored by andrew on Mon, Oct 12, 4:11 PM.
Tags
None
Referenced Files
F175816647: D60655.id189620.diff
Tue, Oct 13, 2:55 PM
F175805430: D60655.id.diff
Tue, Oct 13, 12:22 PM
F175794397: D60655.diff
Tue, Oct 13, 10:10 AM
F175794000: D60655.id189620.diff
Tue, Oct 13, 10:05 AM
F175769378: D60655.diff
Tue, Oct 13, 5:09 AM
F175748464: D60655.id189620.diff
Tue, Oct 13, 12:31 AM
F175744488: D60655.diff
Mon, Oct 12, 11:44 PM
Unknown Object (File)
Mon, Oct 12, 8:23 PM
Subscribers

Details

Reviewers
olce
jhb
markj
obiwac
Group Reviewers
arm64
Summary

The current acpi_name uses a static buffer to store the node name. This
is unsafe when two threads call this as the second will trash the
value of the first.

Add a version where the caller passes in the buffer and length so they
are safe from other threads.

Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 78073
Build 74956: arc lint + arc unit

Event Timeline

sys/dev/acpica/acpi.c
4330–4333

maybe update this comment to point to acpi_get_name() instead

4356–4358

I know our acpi code is currently a little inconsistent regarding this, but I do think i'd prefer if this returned -1 on failure and 0 on success