def setup(profiler_cfg=None): machine = Machine() alloc = MemoryAlloc(machine.get_mem(), machine.get_ram_begin()) mgr = VLibManager(machine, alloc, profiler_cfg=profiler_cfg) # setup ctx map cpu = machine.get_cpu() mem = machine.get_mem() cpu_type = machine.get_cpu_type() segloader = SegmentLoader(alloc) exec_ctx = ExecLibCtx(machine, alloc, segloader, None) mgr.add_ctx('exec.library', exec_ctx) return machine, alloc, mgr
def setup(main_profiler=None, prof_names=None, prof_calls=False): machine = Machine() alloc = MemoryAlloc(machine.get_mem(), machine.get_ram_begin()) mgr = VLibManager(machine, alloc, main_profiler=main_profiler, prof_names=prof_names, prof_calls=prof_calls) # setup ctx map cpu = machine.get_cpu() mem = machine.get_mem() cpu_type = machine.get_cpu_type() segloader = SegmentLoader(alloc) exec_ctx = ExecLibCtx(machine, alloc, segloader, None) mgr.add_ctx('exec.library', exec_ctx) mgr.add_impl_cls('exec.library', ExecLibrary) mgr.add_impl_cls('vamostest.library', VamosTestLibrary) mgr.add_impl_cls('vamostestdev.device', VamosTestDevice) return machine, alloc, mgr
def setup(main_profiler=None, prof_names=None, prof_calls=False): machine = Machine() alloc = MemoryAlloc(machine.get_mem(), machine.get_ram_begin()) mgr = VLibManager(machine, alloc, main_profiler=main_profiler, prof_names=prof_names, prof_calls=prof_calls) # setup ctx map cpu = machine.get_cpu() mem = machine.get_mem() cpu_type = machine.get_cpu_type() segloader = SegmentLoader(alloc) exec_ctx = ExecLibCtx(machine, alloc, segloader, None) mgr.add_ctx('exec.library', exec_ctx) mgr.add_impl_cls('exec.library', ExecLibrary) mgr.add_impl_cls('vamostest.library', VamosTestLibrary) mgr.add_impl_cls('vamostestdev.device', VamosTestDevice) return machine, alloc, mgr
def setup(path_mgr=None, cfg=None, profiler_cfg=None): log_libmgr.setLevel(logging.INFO) log_exec.setLevel(logging.INFO) machine = Machine() # machine.show_instr(True) sp = machine.get_ram_begin() - 4 alloc = MemoryAlloc.for_machine(machine) segloader = SegmentLoader(alloc, path_mgr) mgr = LibManager(machine, alloc, segloader, cfg=cfg, profiler_cfg=profiler_cfg) # setup ctx map cpu = machine.get_cpu() mem = machine.get_mem() cpu_type = machine.get_cpu_type() exec_ctx = ExecLibCtx(machine, alloc, segloader, path_mgr) mgr.add_ctx('exec.library', exec_ctx) dos_ctx = DosLibCtx(machine, alloc, segloader, path_mgr, None, None) mgr.add_ctx('dos.library', dos_ctx) return machine, alloc, mgr, sp
def setup(path_mgr=None): log_libmgr.setLevel(logging.INFO) log_exec.setLevel(logging.INFO) machine = Machine() # machine.show_instr(True) sp = machine.get_ram_begin() - 4 alloc = MemoryAlloc.for_machine(machine) segloader = SegmentLoader(alloc, path_mgr) cfg = LibMgrCfg() mgr = LibManager(machine, alloc, segloader, cfg) # setup ctx map cpu = machine.get_cpu() mem = machine.get_mem() cpu_type = machine.get_cpu_type() exec_ctx = ExecLibCtx(machine, alloc, segloader, path_mgr, mgr) mgr.add_ctx("exec.library", exec_ctx) mgr.add_impl_cls("exec.library", ExecLibrary) dos_ctx = DosLibCtx(machine, alloc, segloader, path_mgr, None, None) mgr.add_ctx("dos.library", dos_ctx) mgr.add_impl_cls("dos.library", DosLibrary) mgr.add_impl_cls("vamostest.library", VamosTestLibrary) mgr.add_impl_cls("vamostestdev.device", VamosTestDevice) return machine, alloc, mgr, sp, cfg
def setup_env(main_profiler=None, prof_names=None, prof_calls=False): machine = Machine() alloc = MemoryAlloc(machine.get_mem(), machine.get_ram_begin()) mgr = VLibManager( machine, alloc, main_profiler=main_profiler, prof_names=prof_names, prof_calls=prof_calls, ) # setup ctx map cpu = machine.get_cpu() mem = machine.get_mem() cpu_type = machine.get_cpu_type() segloader = SegmentLoader(alloc) exec_ctx = ExecLibCtx(machine, alloc, segloader, None, None) # add extra attr to ctx mgr.set_ctx_extra_attr("foo", "bar") mgr.add_ctx("exec.library", exec_ctx) mgr.add_impl_cls("exec.library", ExecLibrary) mgr.add_impl_cls("vamostest.library", VamosTestLibrary) mgr.add_impl_cls("vamostestdev.device", VamosTestDevice) return machine, alloc, mgr
def setup(path_mgr=None): log_libmgr.setLevel(logging.INFO) log_exec.setLevel(logging.INFO) machine = Machine() # machine.show_instr(True) sp = machine.get_ram_begin() - 4 alloc = MemoryAlloc.for_machine(machine) segloader = SegmentLoader(alloc, path_mgr) cfg = LibMgrCfg() mgr = LibManager(machine, alloc, segloader, cfg) # setup ctx map cpu = machine.get_cpu() mem = machine.get_mem() cpu_type = machine.get_cpu_type() exec_ctx = ExecLibCtx(machine, alloc, segloader, path_mgr) mgr.add_ctx('exec.library', exec_ctx) mgr.add_impl_cls('exec.library', ExecLibrary) dos_ctx = DosLibCtx(machine, alloc, segloader, path_mgr, None, None) mgr.add_ctx('dos.library', dos_ctx) mgr.add_impl_cls('dos.library', DosLibrary) mgr.add_impl_cls('vamostest.library', VamosTestLibrary) mgr.add_impl_cls('vamostestdev.device', VamosTestDevice) return machine, alloc, mgr, sp, cfg