Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

arm64/sysreg: Move generation of RES0/RES1/UNKN to function

The RESx and UNKN define generation happens in two places
(EndSysreg and EndSysregFields), and was using nearly identical
code. Split this out into a function, and call that instead, rather
then keeping the dupliated code.

There are no changes to the generated sysregs as part of this change.

Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

authored by

Sascha Bischoff and committed by
Catalin Marinas
a0b130ee fe2ef469

+14 -12
+14 -12
arch/arm64/tools/gen-sysreg.awk
··· 66 66 define(prefix, reg "_" field "_SIGNED", sign) 67 67 } 68 68 69 + # Print the Res0, Res1, Unkn masks 70 + function define_resx_unkn(prefix, reg, res0, res1, unkn) { 71 + if (res0 != null) 72 + define(prefix, reg "_RES0", "(" res0 ")") 73 + if (res1 != null) 74 + define(prefix, reg "_RES1", "(" res1 ")") 75 + if (unkn != null) 76 + define(prefix, reg "_UNKN", "(" unkn ")") 77 + if (res0 != null || res1 != null || unkn != null) 78 + print "" 79 + } 80 + 69 81 # Parse a "<msb>[:<lsb>]" string into the global variables @msb and @lsb 70 82 function parse_bitdef(reg, field, bitdef, _bits) 71 83 { ··· 155 143 if (next_bit >= 0) 156 144 fatal("Unspecified bits in " reg) 157 145 158 - define(prefix, reg "_RES0", "(" res0 ")") 159 - define(prefix, reg "_RES1", "(" res1 ")") 160 - define(prefix, reg "_UNKN", "(" unkn ")") 161 - print "" 146 + define_resx_unkn(prefix, reg, res0, res1, unkn) 162 147 163 148 reg = null 164 149 res0 = null ··· 210 201 if (next_bit >= 0) 211 202 fatal("Unspecified bits in " reg) 212 203 213 - if (res0 != null) 214 - define(prefix, reg "_RES0", "(" res0 ")") 215 - if (res1 != null) 216 - define(prefix, reg "_RES1", "(" res1 ")") 217 - if (unkn != null) 218 - define(prefix, reg "_UNKN", "(" unkn ")") 219 - if (res0 != null || res1 != null || unkn != null) 220 - print "" 204 + define_resx_unkn(prefix, reg, res0, res1, unkn) 221 205 222 206 reg = null 223 207 op0 = null