Ejemplo n.º 1
0
static boolean
is_register_used(
   struct sanity_check_ctx *ctx,
   scan_register *reg)
{
   void *data = cso_hash_find_data_from_template(
      ctx->regs_used, scan_register_key(reg),
      reg, sizeof(scan_register));
   return  data ? TRUE : FALSE;
}
Ejemplo n.º 2
0
struct translate * translate_cache_find(struct translate_cache *cache,
                                        struct translate_key *key)
{
   unsigned hash_key = create_key(key);
   struct translate *translate = (struct translate*)
      cso_hash_find_data_from_template(cache->hash,
                                       hash_key,
                                       key, sizeof(*key));

   if (!translate) {
      /* create/insert */
      translate = translate_create(key);
      cso_hash_insert(cache->hash, hash_key, translate);
   }

   return translate;
}