X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/5ba3f43ea354af8ad55bea84372a2bc834d8757c..cb3231590a3c94ab4375e2228bd5e86b0cf1ad7e:/san/tools/generate_dynamic_blacklist.py diff --git a/san/tools/generate_dynamic_blacklist.py b/san/tools/generate_dynamic_blacklist.py index 3f4c06bed..c71d9c4fb 100755 --- a/san/tools/generate_dynamic_blacklist.py +++ b/san/tools/generate_dynamic_blacklist.py @@ -8,6 +8,8 @@ def type_map(x): re_comments=re.compile(r'#.*$') +nentries = 0 +extra_entries = 5 bl = file(sys.argv[1]) print r'struct blacklist_entry blacklist[] = {' @@ -35,12 +37,27 @@ for line in bl.readlines(): func = '"' + func + '"' if ty == "": - ty = "all"; + ty = "normal"; print """ {{ .kext_name = {}, .func_name = {}, .type_mask = {}, }},""".format(kext, func, type_map(ty)) + nentries += 1 + +# add space for new entries added at runtime +print '' +print r' /* Unused entries that can be populated at runtime */' +for i in xrange(0, extra_entries): + print """ {{ + .kext_name = {}, + .func_name = {}, + .type_mask = {}, + }},""".format("NULL", "NULL", 0) print r'};' +print + +print 'static size_t blacklist_entries = {};'.format(nentries) +print 'static const size_t blacklist_max_entries = {};'.format(nentries + extra_entries)