On Tue, 29 Apr 2014 15:51:07 +0530 Bharata B Rao <bharata....@gmail.com> wrote:
> On Tue, Apr 29, 2014 at 2:59 PM, Greg Kurz <gk...@linux.vnet.ibm.com> wrote: > > > On Tue, 29 Apr 2014 11:16:51 +0200 > > Alexander Graf <ag...@suse.de> wrote: > > > > > > On 28.04.14 13:29, Greg Kurz wrote: > > > > From: Bharata B Rao <bhar...@linux.vnet.ibm.com> > > > > > > > > Make DumpState and endian conversion routines available for > > arch-specific dump > > > > code by moving into dump.h. DumpState will be needed by arch-specific > > dump > > > > code to access target endian information from DumpState->ArchDumpInfo. > > Also > > > > break the dependency of dump.h from stubs/dump.c by creating a separate > > > > dump-arch.h. > > > > > > > > This patch doesn't change any functionality. > > > > > > > > Signed-off-by: Bharata B Rao <bhar...@linux.ibm.com> > > > > [ rebased on top of current master branch, > > > > Greg Kurz <gk...@linux.vnet.ibm.com> ] > > > > Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm.com> > > > > --- > > > > dump.c | 39 > > +++--------------------------------- > > > > include/sysemu/dump-arch.h | 28 ++++++++++++++++++++++++++ > > > > include/sysemu/dump.h | 48 > > +++++++++++++++++++++++++++++++++++--------- > > > > stubs/dump.c | 2 +- > > > > 4 files changed, 70 insertions(+), 47 deletions(-) > > > > create mode 100644 include/sysemu/dump-arch.h > > > > > > > > diff --git a/dump.c b/dump.c > > > > index 14b3d1d..13c9bf2 100644 > > > > --- a/dump.c > > > > +++ b/dump.c > > > > @@ -36,7 +36,7 @@ > > > > #define ELF_MACHINE_UNAME "Unknown" > > > > #endif > > > > > > > > -static uint16_t cpu_convert_to_target16(uint16_t val, int endian) > > > > +uint16_t cpu_convert_to_target16(uint16_t val, int endian) > > > > > > This is quite some heavy pollution of the global name space. > > > > > > > > > Alex > > > > > > > What about moving the declarations from dump.h to a PPC only header file > > then ? > > > > But they still remain global... > Yeah... I hadn't understood the true concern when I answered Alex. > These routines are used throughout generic dump.c and since now there is a > need for similar functionality in arch specific dump code, I thought it is > best to globalize and re-use from arch specific dump there. Wonder if there > will need for these routines in other archs as well in future ? > Or possibly other parts that also use ELF bits, like the loader for example... Anyway, I guess that prefixing with dump_ is enough for now. > Regards, > Bharata. -- Gregory Kurz kurzg...@fr.ibm.com gk...@linux.vnet.ibm.com Software Engineer @ IBM/Meiosys http://www.ibm.com Tel +33 (0)562 165 496 "Anarchy is about taking complete responsibility for yourself." Alan Moore.