Dear All,
I want to read the cpu_list structure from solaris 10, and I get the
physical address using the following code:
logical_address_t cpu_list_vaddr = KernelVaddr_cpu_list;
translate_SimicsImp(cpu, xact, cpu_list_vaddr, 4);
physical_address_t cpu_list_paddr = xact->s.physical_address;
The translate_SimicsImp() function is implemented using the following code:
static void
translate_SimicsImp(conf_object_t* cpu, v9_memory_transaction_t* xact,
logical_address_t anAddress, int anASI){
memset(xact, 0, sizeof(v9_memory_transaction_t ));
xact->priv = 1;
xact->access_type = V9_Access_Normal;
xact->address_space = anASI;
xact->s.logical_address = anAddress;
xact->s.size = 4;
xact->s.type = Sim_Trans_Load;
xact->s.inquiry = 1;
xact->s.ini_type = Sim_Initiator_Other;
xact->s.exception = Sim_PE_No_Exception;
conf_object_t * theMMU;
mmu_interface_t * theMMUAPI;
attr_value_t mmu_obj;
mmu_obj = SIM_get_attribute(cpu, "mmu");
theMMU = mmu_obj.u.object;
ASSERT( theMMU );
theMMUAPI = (mmu_interface_t *)SIM_get_interface(theMMU, "mmu");
ASSERT( theMMUAPI );
exception_type_t except;
except = theMMUAPI->logical_to_physical(theMMU, xact ) ;
}
However, I cannot get the correct address, but I succeeded in reading the
num_cpu. Anyone knows the problem? Thanks a lot!
--
--
Best Regards
Shen Zhong