On 11/21/2017 01:00 PM, Peter Maydell wrote: > On 21 November 2017 at 15:57, Philippe Mathieu-Daudé <f4...@amsat.org> wrote: >> Hi Peter, >> >> On 11/21/2017 12:08 PM, Peter Maydell wrote: >>> The memory-internal.h header claims that it is for "obsolete >>> exec.c functions" which "will be removed soon". This statement >>> was added in 2011, six years ago, but the header is still here. >>> (Admittedly none of the prototypes added in commit 67d95c153bef55f6 >>> are still in the header.) >>> >>> It's convenient to have a place to put prototypes for functions >>> which are used internally to the various .c files of the memory >>> system or by the accel/tcg code, which is inevitably fairly >>> closely coupled. So keep the header but update the comments to >>> reflect what we're actually using it for. >> >> Until your NotDirtyInfo addition, the only prototype used was >> memory_region_access_valid() (in s390-pci-inst.c). >> >> Since "none of the prototypes added in commit 67d95c153bef55f6 are still >> in the header" we could restrict it out of include/exec/ (kinda 'revert' >> 022c62cbbc) and only keep memory_region_access_valid() + NotDirtyInfo >> exposed in include/exec/. > > I'm not sure what you're suggesting. I definitely think the > s390 usage is pretty nasty but I guess it would need some > rework to get rid of. For everything else, it's nice > to have somewhere to share these things. You could argue > for splitting the header into two, one for 'between memory.c > and exec.c' and one for 'between memory.c and cputlb.c', > but is it worth the effort?
Why not move memory_region_access_valid() + NotDirtyInfo in "exec/exec-all.h" and only use this to "share these things"?