Lines Matching +full:addr +full:- +full:range

5 # SPDX-License-Identifier: Apache-2.0
14 - That the memory address points to a kernel object
16 - The kernel object is of the expected type for the API being invoked
18 - The kernel object is of the expected initialization state
20 - The calling thread has sufficient permissions on the object
33 - A gperf script to generate the hash table mapping kernel object memory
35 object type, initialization state, and any object-specific data.
37 - A header file containing generated macros for validating driver instances
40 - A code fragment included by kernel.h with one enum constant for
43 - The inner cases of a switch/case C statement, included by
45 instances to their human-readable representation in the
48 - The inner cases of a switch/case C statement, included by
74 # - The first item is None, or the name of a Kconfig that
78 # - The second item is a boolean indicating whether it is permissible for
79 # the object to be located in user-accessible memory.
81 # - The third items is a boolean indicating whether this item can be
91 # https://stackoverflow.com/questions/39980323/are-dictionaries-ordered-in-python-3-6
144 return "K_OBJ_DRIVER_" + subsys[:-11].upper()
146 # --- debug stuff ---
163 fileinfo = files[die.attributes["DW_AT_decl_file"].value - 1]
164 filename = fileinfo.name.decode("utf-8")
165 filedir = includes[fileinfo.dir_index - 1].decode("utf-8")
174 # -- ELF processing
190 def __init__(self, type_obj, addr): argument
191 self.addr = addr
214 def get_kobjects(self, addr): argument
215 return {addr: KobjectInstance(self, addr)}
233 def get_kobjects(self, addr): argument
240 # An array of stacks appears as a multi-dimensional array.
249 for i in range(num_members):
250 a = addr + (i * stacksize)
263 for i in range(num_members):
264 objs.update(mt.get_kobjects(addr + (i * mt.size)))
277 for i in range(1, len(member_offset)-1):
297 def get_kobjects(self, addr): argument
299 return mt.get_kobjects(addr + self.member_offset)
315 def get_kobjects(self, addr): argument
316 return type_env[self.child_type].get_kobjects(addr)
349 def get_kobjects(self, addr): argument
352 objs.update(member.get_kobjects(addr))
356 # --- helper functions for getting data from DIEs ---
376 return die.attributes["DW_AT_name"].value.decode("utf-8")
499 def addr_deref(elf, addr): argument
504 if start <= addr < end:
506 offset = addr - start
512 def device_get_api_addr(elf, addr): argument
515 return addr_deref(elf, addr + offset)
581 # Boot-time initialization function; not an actual device
621 addr = ((loc.value[1] << 0 ) | (loc.value[2] << 8) |
626 addr = ((loc.value[1] << 0 ) | (loc.value[2] << 8) |
632 addr += (loc.value[6])
634 if addr == 0:
635 # Never linked; gc-sections deleted it
639 objs = type_obj.get_kobjects(addr)
643 % (name, hex(addr), len(objs)))
651 for addr, ko in all_objs.items():
658 ((app_smem_start <= addr < app_smem_end)
659 or (app_smem_pinned_start <= addr < app_smem_pinned_end))):
661 % (ko.type_obj.name, hex(addr)))
665 (addr < user_stack_start or addr >= user_stack_end)):
666 debug("skip kernel-only stack at %s" % hex(addr))
687 ret[addr] = ko
692 apiaddr = device_get_api_addr(elf, addr)
696 % addr)
699 % (addr, apiaddr))
705 ret[addr] = ko
726 # -- GPERF generation logic
728 header = """%compare-lengths
729 %define lookup-function-name z_object_lookup
730 %language=ANSI-C
731 %global-table
732 %struct-type
745 # NULL-terminated.
778 for i in range(sys_mutex_counter):
780 if i != sys_mutex_counter - 1:
787 for i in range(futex_counter):
789 if i != futex_counter - 1:
824 if counter != (stack_counter - 1):
837 for i in range(0, thread_max_bytes):
842 # pre-initialized objects fall within this memory range, they are
890 for i in range(0, thread_max_bytes):
996 parser.add_argument("-k", "--kernel", required=False,
999 "-g", "--gperf-output", required=False,
1002 "-V", "--validation-output", required=False,
1005 "-K", "--kobj-types-output", required=False,
1008 "-S", "--kobj-otype-output", required=False,
1011 "-Z", "--kobj-size-output", required=False,
1013 parser.add_argument("-i", "--include-subsystem-list", required=False, action='append',
1016 -i file1 -i file2 ...''')
1018 parser.add_argument("-v", "--verbose", action="store_true",
1033 assert args.kernel, "--kernel ELF required for --gperf-output"
1045 .format(thread_counter, -(-thread_counter // 8)))