Add trap table setting function to client interface

git-svn-id: svn://coreboot.org/openbios/openbios-devel@203 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Blue Swirl
2008-07-16 11:48:43 +00:00
parent 8dcbb5e313
commit 5f3b249026

View File

@@ -179,6 +179,19 @@ NODE_METHODS(mmu) = {
{ "map", mmu_map },
};
/*
( addr -- ? )
*/
static void
set_trap_table(void)
{
unsigned long addr;
addr = POP();
asm("wrpr %0, %%tba\n"
: : "r" (addr));
}
static void cpu_generic_init(const struct cpudef *cpu)
{
unsigned long iu_version;
@@ -244,6 +257,11 @@ static void cpu_generic_init(const struct cpudef *cpu)
fword("encode-int");
push_str("mmu");
fword("property");
// Trap table
push_str("/packages/client-iface");
fword("find-device");
bind_func("SUNW,set-trap-table", set_trap_table);
}
static const struct cpudef sparc_defs[] = {