Ejemplo n.º 1
0
extern EFI_STATUS addConfigurationTable(EFI_GUID const *pGuid, void *table, char const *alias)
{
    EFI_UINTN i = gST->NumberOfTableEntries;
    /* We only do adds, not modifications and deletes like InstallConfigurationTable */
    if(i >= MAX_CONFIGURATION_TABLE_ENTRIES)
        stop("Ran out of space for configuration tables.  Increase the reserved size in the code.\n");

    if(pGuid == NULL)
        return EFI_INVALID_PARAMETER;

    if(table != NULL)
    {
    	/* FIXME
        ((EFI_CONFIGURATION_TABLE_64 *)gST->ConfigurationTable)[i].VendorGuid = *pGuid;
        ((EFI_CONFIGURATION_TABLE_64 *)gST->ConfigurationTable)[i].VendorTable = (EFI_PTR64)table;

        ++gST->NumberOfTableEntries;
		  */
      Node *tableNode = DT__AddChild(gEfiConfigurationTableNode, mallocStringForGuid(pGuid));

      /* Use the pointer to the GUID we just stuffed into the system table */
	  	DT__AddProperty(tableNode, "guid", sizeof(EFI_GUID), (void*)pGuid);

      /* The "table" property is the 32-bit (in our implementation) physical address of the table */
  		DT__AddProperty(tableNode, "table", sizeof(void*) * 2, table);

      /* Assume the alias pointer is a global or static piece of data */
      if(alias != NULL)
        DT__AddProperty(tableNode, "alias", strlen(alias)+1, (char*)alias);

      return EFI_SUCCESS;
    }
    return EFI_UNSUPPORTED;
}
Ejemplo n.º 2
0
extern EFI_STATUS addConfigurationTable(EFI_GUID const *pGuid, void *table, char const *alias)
{
	EFI_UINTN i = 0;

	//Azi: as is, cpu's with em64t will use EFI64 on pre 10.6 systems,
	// wich seems to cause no problem. In case it does, force i386 arch.
	if (archCpuType == CPU_TYPE_I386)
	{
		i = gST32->NumberOfTableEntries;
	}
	else
	{
		i = gST64->NumberOfTableEntries;
	}

	// We only do adds, not modifications and deletes like InstallConfigurationTable
	if (i >= MAX_CONFIGURATION_TABLE_ENTRIES)
	{
		stop("Ran out of space for configuration tables.  Increase the reserved size in the code.\n");
	}

	if (pGuid == NULL)
	{
		return EFI_INVALID_PARAMETER;
	}

	if (table != NULL)
	{
		// FIXME
		//((EFI_CONFIGURATION_TABLE_64 *)gST->ConfigurationTable)[i].VendorGuid = *pGuid;
		//((EFI_CONFIGURATION_TABLE_64 *)gST->ConfigurationTable)[i].VendorTable = (EFI_PTR64)table;

		//++gST->NumberOfTableEntries;

		Node *tableNode = DT__AddChild(gEfiConfigurationTableNode, mallocStringForGuid(pGuid));

		// Use the pointer to the GUID we just stuffed into the system table
		DT__AddProperty(tableNode, "guid", sizeof(EFI_GUID), (void*)pGuid);

		// The "table" property is the 32-bit (in our implementation) physical address of the table
		DT__AddProperty(tableNode, "table", sizeof(void*) * 2, table);

		// Assume the alias pointer is a global or static piece of data
		if (alias != NULL)
		{
			DT__AddProperty(tableNode, "alias", strlen(alias)+1, (char*)alias);
		}

		return EFI_SUCCESS;
	}
	return EFI_UNSUPPORTED;
}