ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not allocate the gpe_event_info table\n")); 
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not allocate the gpe_event_info table\n")); 
acpi_ev_create_gpe_info_blocks (	struct acpi_gpe_block_info      *gpe_block){	struct acpi_gpe_register_info   *gpe_register_info = NULL;	struct acpi_gpe_event_info      *gpe_event_info = NULL;	struct acpi_gpe_event_info      *this_event;	struct acpi_gpe_register_info   *this_register;	acpi_native_uint                i;	acpi_native_uint                j;	acpi_status                     status;	ACPI_FUNCTION_TRACE ("ev_create_gpe_info_blocks");	/* Allocate the GPE register information block */	gpe_register_info = ACPI_MEM_CALLOCATE (			  (acpi_size) gpe_block->register_count *			  sizeof (struct acpi_gpe_register_info));	if (!gpe_register_info) {		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,			"Could not allocate the gpe_register_info table\n"));		return_ACPI_STATUS (AE_NO_MEMORY);	}	/*	 * Allocate the GPE event_info block. There are eight distinct GPEs	 * per register.  Initialization to zeros is sufficient.	 */	gpe_event_info = ACPI_MEM_CALLOCATE (			   ((acpi_size) gpe_block->register_count * ACPI_GPE_REGISTER_WIDTH) *			   sizeof (struct acpi_gpe_event_info));	if (!gpe_event_info) {		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not allocate the gpe_event_info table\n"));		status = AE_NO_MEMORY;		goto error_exit;	}	/* Save the new Info arrays in the GPE block */	gpe_block->register_info = gpe_register_info;	gpe_block->event_info  = gpe_event_info;	/*	 * Initialize the GPE Register and Event structures.  A goal of these	 * tables is to hide the fact that there are two separate GPE register sets	 * in a given gpe hardware block, the status registers occupy the first half,	 * and the enable registers occupy the second half.	 */	this_register = gpe_register_info;	this_event   = gpe_event_info;	for (i = 0; i < gpe_block->register_count; i++) {		/* Init the register_info for this GPE register (8 GPEs) */		this_register->base_gpe_number = (u8) (gpe_block->block_base_number +				   (i * ACPI_GPE_REGISTER_WIDTH));		ACPI_STORE_ADDRESS (this_register->status_address.address,				 (gpe_block->block_address.address				 + i));		ACPI_STORE_ADDRESS (this_register->enable_address.address,				 (gpe_block->block_address.address				 + i				 + gpe_block->register_count));		this_register->status_address.address_space_id = gpe_block->block_address.address_space_id;		this_register->enable_address.address_space_id = gpe_block->block_address.address_space_id;		this_register->status_address.register_bit_width = ACPI_GPE_REGISTER_WIDTH;		this_register->enable_address.register_bit_width = ACPI_GPE_REGISTER_WIDTH;		this_register->status_address.register_bit_offset = ACPI_GPE_REGISTER_WIDTH;		this_register->enable_address.register_bit_offset = ACPI_GPE_REGISTER_WIDTH;		/* Init the event_info for each GPE within this register */		for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) {			this_event->register_bit = acpi_gbl_decode_to8bit[j];			this_event->register_info = this_register;			this_event++;		}		/*		 * Clear the status/enable registers.  Note that status registers		 * are cleared by writing a '1', while enable registers are cleared		 * by writing a '0'.		 */		status = acpi_hw_low_level_write (ACPI_GPE_REGISTER_WIDTH, 0x00,				 &this_register->enable_address);		if (ACPI_FAILURE (status)) {			goto error_exit;		}		status = acpi_hw_low_level_write (ACPI_GPE_REGISTER_WIDTH, 0xFF,				 &this_register->status_address);		if (ACPI_FAILURE (status)) {			goto error_exit;		}		this_register++;	}	return_ACPI_STATUS (AE_OK);error_exit:	if (gpe_register_info) {		ACPI_MEM_FREE (gpe_register_info);	}	if (gpe_event_info) {		ACPI_MEM_FREE (gpe_event_info);	}	return_ACPI_STATUS (status);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/44f6c01242da4e162f28d8e1216a8c7a91174605/evgpeblk.c/buggy/drivers/acpi/events/evgpeblk.c