1 from core
import ADDR
, REG
2 from archutils
import *
8 ALL_REGS
= {REG("r0"), REG("sp"), REG("rtoc")} |
reg_range("r", 3, 31)
11 def call_params(addr
):
12 return reg_range("r", 3, 10)
15 def param_filter(regs
):
16 # Assume for now that all parameters will be passed in registers.
17 # This must be good enough to cover the most usage cases.
18 # The following cases will break it:
19 # - functions accepting more then 8 params
20 # - functions accepting floating-point params
21 # - variadic functions
22 return reg_continuous_subrange(regs
, reg_range("r", 3, 10))
30 # Assuming there is no floating-point stuff
35 return reg_range("r", 13, 31) |
{REG("sp")}
39 return call_ret(addr
) |
(ALL_REGS
- call_save(addr
))