view include/os/pcb.h @ 150:e72f984619c7

Consolidated a lot of the defines which relate to the memory layout There is a new file (include/os/memLayout.h) which now includes just about all the #defines
author Jonathan Pevarnek <pevarnj@gmail.com>
date Wed, 02 Nov 2011 09:55:09 -0400
parents cf569b2ab76c
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