]> git.karo-electronics.de Git - karo-tx-linux.git/commit
arm64: signal: factor frame layout and population into separate passes
authorDave Martin <Dave.Martin@arm.com>
Thu, 15 Jun 2017 14:03:40 +0000 (15:03 +0100)
committerWill Deacon <will.deacon@arm.com>
Tue, 20 Jun 2017 11:42:59 +0000 (12:42 +0100)
commitbb4891a6c3551f27fa4d548b87a66c258bdb100b
treed7d055e51c37de17a5136d2a81fb144d4505c3ec
parent47ccb02868cead34578d953b5fe0cdd58394605e
arm64: signal: factor frame layout and population into separate passes

In preparation for expanding the signal frame, this patch refactors
the signal frame setup code in setup_sigframe() into two separate
passes.

The first pass, setup_sigframe_layout(), determines the size of the
signal frame and its internal layout, including the presence and
location of optional records.  The resulting knowledge is used to
allocate and locate the user stack space required for the signal
frame and to determine which optional records to include.

The second pass, setup_sigframe(), is called once the stack frame
is allocated in order to populate it with the necessary context
information.

As a result of these changes, it becomes more natural to represent
locations in the signal frame by a base pointer and an offset,
since the absolute address of each location is not known during the
layout pass.  To be more consistent with this logic,
parse_user_sigframe() is refactored to describe signal frame
locations in a similar way.

This change has no effect on the signal ABI, but will make it
easier to expand the signal frame in future patches.

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/signal.c