-# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
-#
# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
# Utility code shared across multiple tests.
An open file handle to the file.
"""
- for i in xrange(100):
+ for i in range(100):
fh = attempt_to_open_file(fn)
if fh:
return fh
Nothing.
"""
- for i in xrange(100):
+ for i in range(100):
fh = attempt_to_open_file(fn)
if not fh:
return
ram_base = -1
raise Exception('Failed to find RAM bank start in `bdinfo`')
+ # We don't want ram_base to be zero as some functions test if the given
+ # address is NULL (0). Let's add 2MiB then (size of an ARM LPAE/v8 section).
+
+ if ram_base == 0:
+ ram_base += 1024 * 1024 * 2
+
return ram_base
class PersistentFileHelperCtxMgr(object):