X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_hashtable.h;h=5acb89e847b2b0f5755100443c510778ff2e34de;hp=a51c53a2f623cd0fa4957cc99b5c433e7ca4c454;hb=362391accc505b29d938e9d0a21bf6a28a8cee34;hpb=24178516ccd9f46718b687d4c630415eb63ff595 diff --git a/palacios/include/palacios/vmm_hashtable.h b/palacios/include/palacios/vmm_hashtable.h index a51c53a..5acb89e 100644 --- a/palacios/include/palacios/vmm_hashtable.h +++ b/palacios/include/palacios/vmm_hashtable.h @@ -104,18 +104,18 @@ ulong_t hash_buffer(uchar_t * msg, uint_t length); #define DEFINE_HASHTABLE_INSERT(fnname, keytype, valuetype) \ - int fnname (struct hashtable * htable, keytype key, valuetype value) { \ - return hashtable_insert(htable, (addr_t)key, (addr_t)value); \ + static int fnname (struct hashtable * htable, keytype key, valuetype value) { \ + return hashtable_insert(htable, (addr_t)key, (addr_t)value); \ } #define DEFINE_HASHTABLE_SEARCH(fnname, keytype, valuetype) \ - valuetype * fnname (struct hashtable * htable, keytype key) { \ - return (valuetype *) (hashtable_search(htable, (addr_t)key)); \ + static valuetype * fnname (struct hashtable * htable, keytype key) { \ + return (valuetype *) (hashtable_search(htable, (addr_t)key)); \ } #define DEFINE_HASHTABLE_REMOVE(fnname, keytype, valuetype, free_key) \ - valuetype * fnname (struct hashtable * htable, keytype key) { \ - return (valuetype *) (hashtable_remove(htable, (addr_t)key, free_key)); \ + static valuetype * fnname (struct hashtable * htable, keytype key) { \ + return (valuetype *) (hashtable_remove(htable, (addr_t)key, free_key)); \ } @@ -154,6 +154,11 @@ addr_t hashtable_remove(struct hashtable * htable, addr_t key, int free_key); uint_t hashtable_count(struct hashtable * htable); +// Specialty functions for a counting hashtable +int hashtable_inc(struct hashtable * htable, addr_t key, addr_t value); +int hashtable_dec(struct hashtable * htable, addr_t key, addr_t value); + + /* ************ */ /* ITERATOR API */ /* ************ */