util: Add an abstraction layer for call types in the m5 utility.
authorGabe Black <gabeblack@google.com>
Fri, 27 Mar 2020 08:52:27 +0000 (01:52 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 28 Apr 2020 01:07:43 +0000 (01:07 +0000)
commit26454e8072e607d54ac67c42b33355d7c94d6d60
tree7ed4e349ee2ce591524c227036ab10711f4f66ae
parent1708a71e5b9234b6d391e8c5084f23bf9579a3dc
util: Add an abstraction layer for call types in the m5 utility.

These make the calling code in m5.c a little bit more generic. Each call
type will have a function to check the arguments and see if that type is
being requested and/or has any additional options set in the arguments.
If so, those are processed, and argc and argv are adjusted.

Then another function returns the appropriate dispatch table to use for
that invocation scheme. This is behind a function instead of, for
instance, a global variable because it gives the call type a little bit
more control over what's happening, for instance if it would use
different implementations in slightly different circumstances.

Change-Id: I661cf202ec657466496767cbdf331fe27995ab26
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27241
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
util/m5/src/addr_call_type.c [new file with mode: 0644]
util/m5/src/addr_call_type.h [new file with mode: 0644]
util/m5/src/call_type.h [new file with mode: 0644]
util/m5/src/inst_call_type.c [new file with mode: 0644]
util/m5/src/inst_call_type.h [new file with mode: 0644]
util/m5/src/semi_call_type.c [new file with mode: 0644]
util/m5/src/semi_call_type.h [new file with mode: 0644]