Skip to content

Commit

Permalink
cdl_utils: remove unmaintained python library
Browse files Browse the repository at this point in the history
simpleeval is no longer maintained. As the python setuptool has dropped
python 2 support completely, it is unable to install simpleeval from
source. Replacing it with the builtin eval(). It only takes input from
camkes template, which is somewhat trusted. Simple sanity check is also
added to filter out unexpected inputs.

Signed-off-by: Siwei Zhuang <[email protected]>
  • Loading branch information
szhuang committed Sep 27, 2021
1 parent 1995a52 commit 55507a1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions cdl_utils/capdl_linker.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# SPDX-License-Identifier: BSD-2-Clause
#

from simpleeval import EvalWithCompoundTypes
from capdl.Object import register_object_sizes, Untyped
from capdl.Allocator import ASIDTableAllocator, BestFitAllocator
from capdl import ELF, lookup_architecture, TCB, valid_architectures
Expand Down Expand Up @@ -63,11 +62,10 @@ def final_spec(args, obj_space, cspaces, addr_spaces, targets, architecture):
# We exclude TCBs that refer to a different CSpace
continue
funcs = {"get_vaddr": lambda x: elf.get_symbol_vaddr(x)}
s = EvalWithCompoundTypes(functions=funcs)
tcb.ip = s.eval(str(tcb.ip))
tcb.sp = s.eval(str(tcb.sp))
tcb.addr = s.eval(str(tcb.addr))
tcb.init = s.eval(str(tcb.init))
tcb.ip = eval(str(tcb.ip), {"__builtins__": None}, funcs)
tcb.sp = eval(str(tcb.sp), {"__builtins__": None}, funcs)
tcb.addr = eval(str(tcb.addr), {"__builtins__": None}, funcs)
tcb.init = eval(str(tcb.init), {"__builtins__": None}, funcs)
if not args.fprovide_tcb_caps:
del cspace.cnode[slot]
cspace.cnode.finalise_size(arch=arch)
Expand Down

0 comments on commit 55507a1

Please sign in to comment.