Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2f7ddcf authored by Lin Ming's avatar Lin Ming Committed by Len Brown
Browse files

ACPICA: New: AcpiInstallMethod - install a single control method



This interface enables the override or creation of a single
control method. Useful to repair a bug or install a missing method.

Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent e0be6f5a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -205,6 +205,7 @@ struct acpi_namespace_node {
#define ANOBJ_METHOD_LOCAL              0x08	/* Node is a method local */
#define ANOBJ_SUBTREE_HAS_INI           0x10	/* Used to optimize device initialization */
#define ANOBJ_EVALUATED                 0x20	/* Set on first evaluation of node */
#define ANOBJ_ALLOCATED_BUFFER          0x40	/* Method AML buffer is dynamic (install_method) */

#define ANOBJ_IS_EXTERNAL               0x08	/* i_aSL only: This object created via External() */
#define ANOBJ_METHOD_NO_RETVAL          0x10	/* i_aSL only: Method has no return value */
+1 −1
Original line number Diff line number Diff line
@@ -483,7 +483,7 @@ typedef enum {

#define AML_METHOD_ARG_COUNT        0x07
#define AML_METHOD_SERIALIZED       0x08
#define AML_METHOD_SYNCH_LEVEL      0xF0
#define AML_METHOD_SYNC_LEVEL       0xF0

/* METHOD_FLAGS_ARG_COUNT is not used internally, define additional flags */

+1 −1
Original line number Diff line number Diff line
@@ -502,7 +502,7 @@ acpi_ex_create_method(u8 * aml_start,
		 * ACPI 2.0: sync_level = sync_level in method declaration
		 */
		obj_desc->method.sync_level = (u8)
		    ((method_flags & AML_METHOD_SYNCH_LEVEL) >> 4);
		    ((method_flags & AML_METHOD_SYNC_LEVEL) >> 4);
	}

	/* Attach the new object to the method Node */
+4 −2
Original line number Diff line number Diff line
@@ -120,9 +120,11 @@ static struct acpi_exdump_info acpi_ex_dump_event[2] = {
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(event.os_semaphore), "OsSemaphore"}
};

static struct acpi_exdump_info acpi_ex_dump_method[8] = {
static struct acpi_exdump_info acpi_ex_dump_method[9] = {
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_method), NULL},
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.param_count), "ParamCount"},
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.method_flags), "Method Flags"},
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.param_count),
	 "Parameter Count"},
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.sync_level), "Sync Level"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(method.mutex), "Mutex"},
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.owner_id), "Owner Id"},
+9 −0
Original line number Diff line number Diff line
@@ -213,6 +213,15 @@ void acpi_ns_detach_object(struct acpi_namespace_node *node)
		return_VOID;
	}

	if (node->flags & ANOBJ_ALLOCATED_BUFFER) {

		/* Free the dynamic aml buffer */

		if (obj_desc->common.type == ACPI_TYPE_METHOD) {
			ACPI_FREE(obj_desc->method.aml_start);
		}
	}

	/* Clear the entry in all cases */

	node->object = NULL;
Loading