
//Typical code for saving the context
void save_pcb(struct pcb_struct *pcb,struct trap_state *ts,int curr_time)
{
  update_timer_fields(pcb,0,curr_time);
  pcb->eax=ts->eax;
  pcb->ebx=ts->ebx;
  pcb->ecx=ts->ecx;
  pcb->edx=ts->edx;
  pcb->esi=ts->esi;
  pcb->edi=ts->edi;
  pcb->ebp=ts->ebp;
  pcb->eflags=ts->eflags;  
  pcb->eip=ts->eip;
};

