Home | History | Annotate | Download | only in ia64

Lines Matching refs:script

69 cache_match (struct ia64_script *script, unw_word_t ip, unw_word_t pr)
71 if (ip == script->ip && ((pr ^ script->pr_val) & script->pr_mask) == 0)
154 struct ia64_script *script = cache->buckets + c->hint;
161 if (cache_match (script, ip, pr))
162 return script;
168 script = cache->buckets + index;
171 if (cache_match (script, ip, pr))
175 (script - cache->buckets);
176 return script;
178 if (script->coll_chain >= IA64_UNW_HASH_SIZE)
180 script = cache->buckets + script->coll_chain;
185 script_init (struct ia64_script *script, unw_word_t ip)
187 script->ip = ip;
188 script->hint = 0;
189 script->count = 0;
190 script->abi_marker = 0;
196 struct ia64_script *script, *prev, *tmp;
201 script = cache->buckets + head;
202 cache->lru_head = script->lru_chain;
204 /* re-insert script at the tail of the LRU chain: */
208 /* remove the old script from the hash table (if it's there): */
209 if (script->ip)
211 index = hash (script->ip);
216 if (tmp == script)
227 /* old script wasn't in the hash-table */
233 /* enter new script in the hash table */
235 script->coll_chain = cache->hash[index];
236 cache->hash[index] = script - cache->buckets;
238 script_init (script, ip);
239 return script;
243 script_finalize (struct ia64_script *script, struct cursor *c,
246 script->pr_mask = sr->pr_mask;
247 script->pr_val = sr->pr_val;
248 script->pi = c->pi;
252 script_emit (struct ia64_script *script, struct ia64_script_insn insn)
254 if (script->count >= IA64_MAX_SCRIPT_LEN)
256 Dprintf ("%s: script exceeds maximum size of %u instructions!\n",
260 script->insn[script->count++] = insn;
265 struct ia64_script *script)
375 script_emit (script, insn);
383 script_emit (script, insn);
434 /* Build an unwind script that unwinds from state OLD_STATE to the
438 build_script (struct cursor *c, struct ia64_script *script)
461 script_emit (script, insn);
464 compile_reg (&sr, IA64_REG_PSP, sr.curr.reg + IA64_REG_PSP, script);
486 compile_reg (&sr, IA64_REG_PRI_UNAT_MEM, pri_unat, script);
493 compile_reg (&sr, regorder[i], sr.curr.reg + regorder[i], script);
495 script->abi_marker = sr.abi_marker;
496 script_finalize (script, c, &sr);
517 run_script (struct ia64_script *script, struct cursor *c)
526 c->pi = script->pi;
527 ip = script->insn;
528 limit = script->insn + script->count;
530 c->abi_marker = script->abi_marker;
622 struct ia64_script script;
628 script_init (&script, c->ip);
629 if ((ret = build_script (c, &script)) < 0)
632 Dprintf ("%s: failed to build unwind script for ip %lx\n",
636 return run_script (&script, c);
643 struct ia64_script *script = NULL;
653 Debug (1, "contention on script-cache; doing uncached lookup\n");
657 script = script_lookup (cache, c);
658 Debug (8, "ip %lx %s in script cache\n", (long) c->ip,
659 script ? "hit" : "missed");
661 if (!script || (script->count == 0 && !script->pi.unwind_info))
667 if (!script)
669 script = script_new (cache, c->ip);
670 if (!script)
672 Dprintf ("%s: failed to create unwind script\n", __FUNCTION__);
677 cache->buckets[c->prev_script].hint = script - cache->buckets;
679 if (script->count == 0)
680 ret = build_script (c, script);
682 assert (script->count > 0);
684 c->hint = script->hint;
685 c->prev_script = script - cache->buckets;
690 Dprintf ("%s: failed to locate/build unwind script for ip %lx\n",
695 ret = run_script (script, c);
720 struct ia64_script *script;
729 script = script_lookup (cache, c);
730 if (script)
733 script = script_new (cache, c->ip);
734 if (!script)
736 Dprintf ("%s: failed to create unwind script\n", __FUNCTION__);
741 script->pi = c->pi;
752 struct ia64_script *script;
759 script = script_lookup (cache, c);
760 if (script)
761 c->pi = script->pi;
764 return script ? 0 : -UNW_ENOINFO;