/* Allocates memory to hold all the EBC stacks. */
EFI_STATUS InitEBCStack(VOID)
/* Allocates memory to hold all the EBC stacks. */
EFI_STATUS InitEBCStack(VOID)
{
  for (mStackNum = 0; mStackNum < MAX_STACK_NUM; mStackNum++) {
    mStackBuffer[mStackNum]      = AllocatePool (STACK_POOL_SIZE);
    mStackBufferIndex[mStackNum] = NULL;
    if (mStackBuffer[mStackNum] == NULL) {
      break;
    }
  }
  if (mStackNum == 0) {
    return EFI_OUT_OF_RESOURCES;
  }
  return EFI_SUCCESS;
}