MCPcopy Index your code
hub / github.com/cirosantilli/linux-kernel-module-cheat / _init_env

Method _init_env

common.py:411–682  ·  view source on GitHub ↗

Update the kwargs from the command line with values derived from them.

(self, env)

Source from the content-addressed store, hash-verified

409 return super().__call__(**kwargs)
410
411 def _init_env(self, env):
412 '''
413 Update the kwargs from the command line with values derived from them.
414 '''
415 def join(*paths):
416 return os.path.join(*paths)
417 if env['emulator'] in env['emulator_short_to_long_dict']:
418 env['emulator'] = env['emulator_short_to_long_dict'][env['emulator']]
419 if not env['_args_given']['userland_build_id']:
420 env['userland_build_id'] = env['default_build_id']
421 if not env['_args_given']['gem5_build_id']:
422 if env['_args_given']['gem5_worktree']:
423 env['gem5_build_id'] = env['gem5_worktree']
424 else:
425 env['gem5_build_id'] = consts['default_build_id']
426 env['is_arm'] = False
427 if env['arch'] == 'arm':
428 env['armv'] = 7
429 env['mcpu'] = 'cortex-a15'
430 env['buildroot_toolchain_prefix'] = 'arm-buildroot-linux-uclibcgnueabihf'
431 env['crosstool_ng_toolchain_prefix'] = 'arm-unknown-eabi'
432 env['ubuntu_toolchain_prefix'] = 'arm-linux-gnueabihf'
433 env['is_arm'] = True
434 elif env['arch'] == 'aarch64':
435 env['armv'] = 8
436 env['mcpu'] = 'cortex-a57'
437 env['buildroot_toolchain_prefix'] = 'aarch64-buildroot-linux-uclibc'
438 env['crosstool_ng_toolchain_prefix'] = 'aarch64-unknown-elf'
439 env['ubuntu_toolchain_prefix'] = 'aarch64-linux-gnu'
440 env['is_arm'] = True
441 elif env['arch'] == 'x86_64':
442 env['crosstool_ng_toolchain_prefix'] = 'x86_64-unknown-elf'
443 env['gem5_arch'] = 'X86'
444 env['buildroot_toolchain_prefix'] = 'x86_64-buildroot-linux-uclibc'
445 env['ubuntu_toolchain_prefix'] = 'x86_64-linux-gnu'
446 if env['emulator'] == 'gem5':
447 if not env['_args_given']['machine']:
448 env['machine'] = 'TODO'
449 else:
450 if not env['_args_given']['machine']:
451 env['machine'] = 'pc'
452 if env['is_arm']:
453 env['gem5_arch'] = 'ARM'
454 if env['emulator'] == 'gem5':
455 if not env['_args_given']['machine']:
456 if env['dp650']:
457 env['machine'] = 'VExpress_GEM5_V1_DPU'
458 else:
459 env['machine'] = 'VExpress_GEM5_V1'
460 else:
461 if not env['_args_given']['machine']:
462 env['machine'] = 'virt'
463 if env['arch'] == 'arm':
464 # highmem=off needed since v3.0.0 due to:
465 # http://lists.nongnu.org/archive/html/qemu-discuss/2018-08/msg00034.html
466 env['machine2'] = 'highmem=off'
467 elif env['arch'] == 'aarch64':
468 env['machine2'] = 'gic_version=3'

Callers 1

mainMethod · 0.95

Calls 2

resolve_executableMethod · 0.95
joinMethod · 0.80

Tested by

no test coverage detected