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
F175727833: D60655.id189620.diff
Mon, Oct 12, 8:23 PM
F175727812: D60655.id.diff
Mon, Oct 12, 8:23 PM
F175725975: D60655.diff
Mon, Oct 12, 8:03 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