On 03/24/2018 06:57 AM, Laurent Vivier wrote: > Some files like signal.c are really hard to read > because all architectures are mixed in the same > file. > > This series moves from signal.c these parts to > the architecture dedicated directories in linux-user. > Moreover, this allows to compare easier functions > between architectures (it helps to debug problems). > Adding new functions for a new architecture will > be facilitated too. > > checkpatch.pl is not happy... but I only want to > move code from a file to another. I don't want > to change the content of the parts I move. > > v2: > - only move parts from signal.c > - link them instead of including them > - one patch by architecture > - add a first patch to prepare the change. > > The first patch adds signal-common.h to define > what is needed by the signal.c of the architectures. > It adds a "do-nothing" signal.c in each arch > directory and the rule needed to build them > in Makefile.objs. > > Then the process is simple... > > for each architecture: > - copy the arch specific code from signal.c > to <arch>/signal.c > - add includes (including signal-common.h) > - export setup_rt_frame() and setup_frame() > (remove static in <arch>/signal.c, > add the declaration in <arch>/target_signal.h) > > When the arch has 32bit and 64bit architectures, > it's a little bit more complicated: > - ppc/ppc64: nothing special to do, all is in ppc/, > there is no ppc64 directory, > - arm/aarch64: one file for arm, one file for aarch64 > - i386/x86_64, sparc/sparc64, mips/mips64: > update each target_signal.h, > include the 32bit signal.c file into the 64bit signal.c file > to avoid to duplicate code (and add a guard to not include > the 32bit target_signal.h)
Reviewed-by: Richard Henderson <richard.hender...@linaro.org> r~