arm64/signal: Document our convention for choosing magic numbers
authorMark Brown <broonie@kernel.org>
Mon, 31 Oct 2022 19:24:50 +0000 (19:24 +0000)
committerWill Deacon <will@kernel.org>
Mon, 14 Nov 2022 15:08:15 +0000 (15:08 +0000)
Szabolcs Nagy has pointed out that most of our signal frame magic numbers
are chosen to be meaningful ASCII when dumped to aid manual parsing. This
seems sensible since it might help someone parsing things out, let's
document it so people implementing new signal contexts are aware of it and
are more likely to follow it.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20221031192450.826159-1-broonie@kernel.org
[will: Fixed typo and tweaked wording]
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/uapi/asm/sigcontext.h

index 4aaf31e3bf167c858101f541d1e2480004be1091..9525041e4a1488b1cef97e2d913b39d3c2177765 100644 (file)
@@ -62,6 +62,10 @@ struct sigcontext {
  * context. Such structures must be placed after the rt_sigframe on the stack
  * and be 16-byte aligned. The last structure must be a dummy one with the
  * magic and size set to 0.
+ *
+ * Note that the values allocated for use as magic should be chosen to
+ * be meaningful in ASCII to aid manual parsing, ZA doesn't follow this
+ * convention due to oversight but it should be observed for future additions.
  */
 struct _aarch64_ctx {
        __u32 magic;