示例#1
0
/*
 * Look for an ACPI System Resource Affinity Table ("SRAT")
 */
static void
parse_srat(void *dummy)
{
	int error;

	if (resource_disabled("srat", 0))
		return;

	srat_physaddr = acpi_find_table(ACPI_SIG_SRAT);
	if (srat_physaddr == 0)
		return;

	/*
	 * Make a pass over the table to populate the cpus[] and
	 * mem_info[] tables.
	 */
	srat = acpi_map_table(srat_physaddr, ACPI_SIG_SRAT);
	error = 0;
	srat_walk_table(srat_parse_entry, &error);
	acpi_unmap_table(srat);
	srat = NULL;
	if (error || check_domains() != 0 || check_phys_avail() != 0) {
		srat_physaddr = 0;
		return;
	}

	renumber_domains();

	/* Point vm_phys at our memory affinity table. */
	mem_affinity = mem_info;
}
示例#2
0
文件: srat.c 项目: mulichao/freebsd
/*
 * Look for an ACPI System Resource Affinity Table ("SRAT")
 */
static int
parse_srat(void)
{
	int error;

	if (resource_disabled("srat", 0))
		return (-1);

	srat_physaddr = acpi_find_table(ACPI_SIG_SRAT);
	if (srat_physaddr == 0)
		return (-1);

	/*
	 * Make a pass over the table to populate the cpus[] and
	 * mem_info[] tables.
	 */
	srat = acpi_map_table(srat_physaddr, ACPI_SIG_SRAT);
	error = 0;
	srat_walk_table(srat_parse_entry, &error);
	acpi_unmap_table(srat);
	srat = NULL;
	if (error || check_domains() != 0 || check_phys_avail() != 0 ||
	    renumber_domains() != 0) {
		srat_physaddr = 0;
		return (-1);
	}

#ifdef VM_NUMA_ALLOC
	/* Point vm_phys at our memory affinity table. */
	vm_ndomains = ndomain;
	mem_affinity = mem_info;
#endif

	return (0);
}
示例#3
0
static const response* sender(str* s, str* params)
{
  const response* r;
  const char* domains;

  if (s->len != 0) {
    if ((r = check_fqdn(s)) != 0)
      return r;
  }
  if ((domains = session_getenv("SENDER_DOMAINS")) != 0)
    return check_domains(s, domains);
  return 0;
  (void)params;
}
示例#4
0
static int
parse_srat(void)
{
	int error;

	/*
	 * Make a pass over the table to populate the cpus[] and
	 * mem_info[] tables.
	 */
	srat = acpi_map_table(srat_physaddr, ACPI_SIG_SRAT);
	error = 0;
	srat_walk_table(srat_parse_entry, &error);
	acpi_unmap_table(srat);
	srat = NULL;
	if (error || check_domains() != 0 || check_phys_avail() != 0 ||
	    renumber_domains() != 0) {
		srat_physaddr = 0;
		return (-1);
	}

	return (0);
}