static void *smm_stub_place_stacks(char *base, size_t size,
				   struct smm_loader_params *params)
{
	size_t total_stack_size;
	char *stacks_top;

	/* If stack space is requested assume the space lives in the lower
	 * half of SMRAM. */
	total_stack_size = params->per_cpu_stack_size *
			   params->num_concurrent_stacks;
	printk(BIOS_DEBUG, "%s: cpus: %zx : stack space: needed -> %zx\n",
		__func__, params->num_concurrent_stacks,
		total_stack_size);
	printk(BIOS_DEBUG, "  available -> %zx : per_cpu_stack_size : %zx\n",
		size, params->per_cpu_stack_size);

	/* There has to be at least one stack user. */
	if (params->num_concurrent_stacks < 1)
		return NULL;

	/* Total stack size cannot fit. */
	if (total_stack_size > size)
		return NULL;

	/* Stacks extend down to SMBASE */
	stacks_top = &base[total_stack_size];
	printk(BIOS_DEBUG, "%s: exit, stack_top %p\n", __func__, stacks_top);

	return stacks_top;
}
static void *smm_stub_place_stacks(char *base, size_t size,
				   struct smm_loader_params *params)
{
	size_t total_stack_size;
	char *stacks_top;

	 
	total_stack_size = params->per_cpu_stack_size *
			   params->num_concurrent_stacks;
	printk(BIOS_DEBUG, "%s: cpus: %zx : stack space: needed -> %zx\n",
		__func__, params->num_concurrent_stacks,
		total_stack_size);
	printk(BIOS_DEBUG, "  available -> %zx : per_cpu_stack_size : %zx\n",
		size, params->per_cpu_stack_size);

	 
	if (params->num_concurrent_stacks < 1)
		return NULL;

	 
	if (total_stack_size > size)
		return NULL;

	 
	stacks_top = &base[total_stack_size];
	printk(BIOS_DEBUG, "%s: exit, stack_top %p\n", __func__, stacks_top);

	return stacks_top;
}