shithub: powernv

ref: a691c9111a69257e206ce895d35396d0f6225929
dir: /mmu.c/

View raw version
#include "u.h"
#include "../port/lib.h"
#include "mem.h"
#include "dat.h"
#include "fns.h"

void
mmu1init(void)
{
}

uintptr
paddr(void *va)
{
	if((uintptr)va >= KZERO)
		return (uintptr)va-KZERO;
	panic("paddr: va=%#p pc=%#p", va, getcallerpc(&va));
}

uintptr
cankaddr(uintptr pa)
{
	if(pa < (uintptr)-KZERO)
		return -KZERO - pa;
	return 0;
}

void*
kaddr(uintptr pa)
{
	if(pa < (uintptr)-KZERO)
		return (void*)(pa + KZERO);
	panic("kaddr: pa=%#p pc=%#p", pa, getcallerpc(&pa));
}

static void*
kmapaddr(uintptr pa)
{
	return nil;
}

KMap*
kmap(Page *p)
{
	return kmapaddr(p->pa);
}

void
kunmap(KMap*)
{
}

void
kmapinval(void)
{
}

static void*
rampage(void)
{
	uintptr pa;

	if(conf.npage)
		return mallocalign(BY2PG, BY2PG, 0, 0);

	pa = conf.mem[0].base;
	assert((pa % BY2PG) == 0);
	conf.mem[0].base += BY2PG;
	return KADDR(pa);
}

static void
l1map(uintptr va, uintptr pa, uintptr pe, uintptr attr)
{
}

void
kmapram(uintptr base, uintptr limit)
{
}

uintptr
mmukmap(uintptr va, uintptr pa, usize size)
{
	return 0;
}

void*
vmap(uvlong pa, vlong size)
{
	return nil;
}

void
vunmap(void *, vlong)
{
}

static uintptr*
mmuwalk(uintptr va, int level)
{
	return nil;
}

static Proc *asidlist[256];

static int
allocasid(Proc *p)
{
	return 0;
}

static void
freeasid(Proc *p)
{
}

void
putasid(Proc *p)
{
}

void
putmmu(uintptr va, uintptr pa, Page *pg)
{
}

static void
mmufree(Proc *p)
{
}

void
mmuswitch(Proc *p)
{
}

void
mmurelease(Proc *p)
{
}

void
flushmmu(void)
{
}

void
checkmmu(uintptr, uintptr)
{
}