Re: [PATCH 2/5] Associate target_dcache to address_space.

Tom Tromey
2013-10-28T20:49:21Z

>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:

Yao> 2013-10-24 Yao Qi <yao@codesourcery.com>
Yao> * progspace.h (struct address_space): Declare.
Yao> * target.c (target_dcache_aspace_key): New.
Yao> (target_dcache): Delete.
Yao> (struct target_dcache): New.
Yao> (target_dcache_alloc): New function.
Yao> (target_dcache_xfree): New function.
Yao> (target_dcache_get): New function.
Yao> (target_dcache_cleanup)): New function.
Yao> (target_dcache_invalidate): Update.
Yao> (memory_xfer_partial_1): Update.
Yao> (initialize_targets): Initialize target_dcache_aspace_key.

This is ok.

And, immediately contradicting myself, I think this is an improvement
regardless of whether the rest of the series goes in as-is or not.
That's because it removes a state-holding global in favor of a
parameterized approach. So, it would be fine by me if you wanted to
push in #1 and #2.

If you'd rather wait for the whole series to be done, that's also ok, as
it isn't urgent.

Yao> +
Yao> +static void
Yao> +target_dcache_cleanup (struct address_space *aspace, void *arg)
Yao> +{

This one needs a (short) intro comment.

Tom