Пример #1
0
void Representation::clearGroupReferences()
{
	if (!checkAwake("clearGroupReference"))
	{
		m_groups.clear();
	}
}
Пример #2
0
void Representation::setGroupReference(const std::string& group)
{
	if (!checkAwake("setGroupReference"))
	{
		clearGroupReferences();
		m_groups.insert(group);
	}
}
Пример #3
0
bool Representation::removeGroupReference(const std::string& name)
{
	bool result = false;
	if (!checkAwake("removeGroupReference"))
	{
		result = (m_groups.erase(name) != 0u);
	}
	return result;
}
Пример #4
0
void Representation::addGroupReferences(const std::vector<std::string>& groups)
{
	if (!checkAwake("addGroupReferences"))
	{
		for (auto it = groups.cbegin(); it != groups.cend(); ++it)
		{
			addGroupReference(*it);
		}
	}
}
Пример #5
0
bool Representation::addGroupReference(const std::string& name)
{
	bool result = false;
	if (!checkAwake("addGroupReference"))
	{
		auto insertion = m_groups.insert(name);
		result = insertion.second;
	}
	return result;
}
Пример #6
0
void schedule_process()
{
	PCB  *next_process=NULL;
  // Add current process to runableQ
  
  ///-----------------WAIT() calls------------------///
  //check if a process is sleeping and is ready to be scheduled now :)
  checkAwake();
  //------------------------------------------------///

  runnableTaskQ = moveTaskToEndOfList(runnableTaskQ);
  next_process = runnableTaskQ->task;
  printtoend("In schedule------- Running : Next :: ", running->pid, next_process->pid ); 
  //uint64_t tem = 0x28; 
  //Setting CR3 .. CHANGING PAGE TABLES
  _ptcr3(next_process->cr3);
  running = next_process;
  tss.rsp0 = (uint64_t) &(next_process->kernel_stack[255]);
  // __asm volatile("mov %0,%%rax;"::"r"(tem));
  // __asm volatile("ltr %ax");
  __asm volatile(
    "movq %0, %%rsp;\n\t"
    "popq %%r15\n\t"
    "popq %%r14\n\t"
    "popq %%r13\n\t"
    "popq %%r12\n\t"
    "popq %%r11\n\t" 
    "popq %%r10\n\t" 
    "popq %%r9\n\t"  
    "popq %%r8\n\t"
    "popq %%rbp\n\t"
    "popq %%rdi\n\t"
    "popq %%rsi\n\t"
    "popq %%rdx\n\t"
    "popq %%rcx\n\t"
    "popq %%rbx\n\t"
    "popq %%rax\n\t"
    :
    :"r"(&(next_process->kernel_stack[234]))
    :"memory"
  );
  __asm volatile(
    "iretq"
  );
}