blob: e64e9194f3ce007722cd24b76e3e4b2059f7c5b1 [file] [log] [blame]
#include <u.h>
#include <libc.h>
#include "9proc.h"
static Lock privlock;
static ulong privmap;
int
privalloc(void)
{
int i;
lock(&privlock);
for(i=0; i<NPRIV; i++)
if((privmap&(1<<i)) == 0){
privmap |= (1<<i);
unlock(&privlock);
return i;
}
unlock(&privlock);
return -1;
}
void**
privmem(int i)
{
Uproc *up;
up = _p9uproc(0);
return &up->priv[i];
}