From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Date: Fri, 3 Apr 2020 14:35:56 +0300 Subject: [PATCH v3 12/29] dm: core: Add basic ACPI support In-Reply-To: <20200330171226.v3.12.Ia5e9ba1f146567b18e9183395484bf04d2e5ba6a@changeid> References: <20200330231305.130488-1-sjg@chromium.org> <20200330171226.v3.12.Ia5e9ba1f146567b18e9183395484bf04d2e5ba6a@changeid> Message-ID: <20200403113556.GS1922688@smile.fi.intel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, Mar 30, 2020 at 05:12:48PM -0600, Simon Glass wrote: > ACPI (Advanced Configuration and Power Interface) is a standard for > specifying information about a platform. It is a little like device > tree but the bindings are part of the specification and it supports an > interpreted bytecode language. > > Driver model does not use ACPI for U-Boot's configuration, but it is > convenient to have it support generation of ACPI tables for passing to > Linux, etc. > > As a starting point, add an optional set of ACPI operations to each > device. Initially only a single operation is available, to obtain the > ACPI name for the device. More operations are added later. > > Enable ACPI for sandbox to ensure build coverage and so that we can add > tests. ... > +int acpi_copy_name(char *out_name, const char *name) > +{ > + strncpy(out_name, name, ACPI_NAME_MAX); memcpy()? > + out_name[ACPI_NAME_LEN] = '\0'; I dunno if compiler is clever enough to catch this and avoid any warnings. Also it seems above should also have _LEN, and not _MAX. > + return 0; > +} -- With Best Regards, Andy Shevchenko