#include <sys/types.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/user.h>
#include <sys/proc.h>
#include <sys/vmmac.h>
#include <sys/map.h>
#include <machine/trap.h>
#include <machine/mmu.h>
#include <machine/pte.h>
#include <machine/psl.h>
#include <machine/vm_hat.h>
#include <vm/as.h>
#include <vm/seg.h>

struct proc *p;
struct as *as;
struct ctx *ctx;

maskToBitNum(mask)
long mask;
{
	/* XXX assume 8 bit bytes */

	register int bn = 0;
	for (bn=0; bn<sizeof(long)*8; bn++)
	 { if (mask & (1<<bn))
	    { return (bn);
	    }
	 }
	return (-1);
}

main ()
{
	printf ("#define PSR_PIL_START %d\n", maskToBitNum(PSR_PIL));
	printf ("#define P_UAREA 0x%x\n", &p->p_uarea);
	printf ("#define P_AS 0x%x\n", &p->p_as);
	printf ("#define A_HAT_CTX 0x%x\n", &as->a_hat.hat_ctx);
	printf ("#define C_NUM 0x%x\n", &ctx->c_num);
	exit(0);
}
