Skip to contentSkip to conversation

ACPICA: Move GPE functions to new file evxfgpe.c

PATCH In review Lin Ming 1 participant 1 message Dec 13, 2010

Subsystems (2)
lore
Share & tools
lore

Lin Ming

author
#0 lore raw

PATCH v2 1/8 ACPICA: Move GPE functions to new file evxfgpe.c

Create a new file evxfgpe.c and move GPE specific functions to it.

---
 drivers/acpi/acpica/Makefile    |    2 +-
 drivers/acpi/acpica/acevents.h  |    4 +
 drivers/acpi/acpica/evgpeutil.c |   39 +++
 drivers/acpi/acpica/evxfevnt.c  |  600 --------------------------------------
 drivers/acpi/acpica/evxfgpe.c   |  610 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 654 insertions(+), 601 deletions(-)
 create mode 100644 drivers/acpi/acpica/evxfgpe.c
drivers/acpi/acpica/Makefile +1 -1
index a7e1d1a..eec2ead 100644
@@ -14,7 +14,7 @@ acpi-y := dsfield.o   dsmthdat.o  dsopcode.o  dswexec.o  dswscope.o \
 
 acpi-y += evevent.o  evregion.o  evsci.o    evxfevnt.o \
 	 evmisc.o   evrgnini.o  evxface.o  evxfregn.o \
-	 evgpe.o    evgpeblk.o evgpeinit.o  evgpeutil.o
+	 evgpe.o    evgpeblk.o evgpeinit.o  evgpeutil.o evxfgpe.o
 
 acpi-y += exconfig.o  exfield.o  exnames.o   exoparg6.o  exresolv.o  exstorob.o\
 	 exconvrt.o  exfldio.o  exoparg1.o  exprep.o    exresop.o   exsystem.o\
drivers/acpi/acpica/acevents.h +4 -0
index a6f99cc..43f15c8 100644
@@ -138,6 +138,10 @@ acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback, void *context);
 
 u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info);
 
+acpi_status
+acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
+		       struct acpi_gpe_block_info *gpe_block, void *context);
+
 struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number);
 
 acpi_status acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt);
drivers/acpi/acpica/evgpeutil.c +39 -0
index 19a0e51..10e4774 100644
@@ -154,6 +154,45 @@ u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info)
 
 /*******************************************************************************
  *
+ * FUNCTION:    acpi_ev_get_gpe_device
+ *
+ * PARAMETERS:  GPE_WALK_CALLBACK
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Matches the input GPE index (0-current_gpe_count) with a GPE
+ *              block device. NULL if the GPE is one of the FADT-defined GPEs.
+ *
+ ******************************************************************************/
+
+acpi_status
+acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
+		       struct acpi_gpe_block_info *gpe_block, void *context)
+{
+	struct acpi_gpe_device_info *info = context;
+
+	/* Increment Index by the number of GPEs in this block */
+
+	info->next_block_base_index += gpe_block->gpe_count;
+
+	if (info->index < info->next_block_base_index) {
+		/*
+		 * The GPE index is within this block, get the node. Leave the node
+		 * NULL for the FADT-defined GPEs
+		 */
+		if ((gpe_block->node)->type == ACPI_TYPE_DEVICE) {
+			info->gpe_device = gpe_block->node;
+		}
+
+		info->status = AE_OK;
+		return (AE_CTRL_END);
+	}
+
+	return (AE_OK);
+}
+
+/*******************************************************************************
+ *
  * FUNCTION:    acpi_ev_get_gpe_xrupt_block
  *
  * PARAMETERS:  interrupt_number     - Interrupt for a GPE block
drivers/acpi/acpica/evxfevnt.c +0 -600

626 lines not on this page · raw message

drivers/acpi/acpica/evxfgpe.c new file +610 -0

610 lines not on this page · raw message

Signature · 1 line
1.5.3