-// return memhandler, or get directly accessable address and return 0
-static void *get_direct_memhandler(void *table,u_int addr,enum stub_type type,u_int *addr_host)
-{
- u_int l1,l2=0;
- l1=((u_int *)table)[addr>>12];
- if((l1&(1<<31))==0) {
- u_int v=l1<<1;
- *addr_host=v+addr;
- return NULL;
- }
- else {
- l1<<=1;
- if(type==LOADB_STUB||type==LOADBU_STUB||type==STOREB_STUB)
- l2=((u_int *)l1)[0x1000/4 + 0x1000/2 + (addr&0xfff)];
- else if(type==LOADH_STUB||type==LOADHU_STUB||type==STOREH_STUB)
- l2=((u_int *)l1)[0x1000/4 + (addr&0xfff)/2];
- else
- l2=((u_int *)l1)[(addr&0xfff)/4];
- if((l2&(1<<31))==0) {
- u_int v=l2<<1;
- *addr_host=v+(addr&0xfff);
- return NULL;
- }
- return (void *)(l2<<1);
- }
-}
-