view include/os/pcb.h @ 144:cf569b2ab76c

Removed a magic number
author Jonathan Pevarnek <pevarnj@gmail.com>
date Thu, 22 Sep 2011 16:12:27 -0400
parents 2a35ea7e123b
children
line wrap: on
line source

#ifndef __PCB_H
#define __PCB_H

#include <os/psw.h>
#include <os/svc.h>

typedef struct {
	u64 registers[NUM_GPRS];
	Psw psw;
} PCB;

static inline void setcontext_pcb(PCB *pcb)
{
	setcontext(&(pcb->psw), pcb->registers);
}

static inline void savecontext_pcb(PCB *pcb)
{
	savecontext(&(pcb->psw), pcb->registers);
}

static inline void swapcontext_pcb(PCB *old, PCB *new)
{
	swapcontext(&(old->psw), old->registers, &(new->psw), new->registers);
}

#endif