xen/arm: domain: Fix MISRA C 2012 Rule 8.7 violation
authorXenia Ragiadakou <burzalodowa@gmail.com>
Thu, 28 Jul 2022 16:21:51 +0000 (19:21 +0300)
committerStefano Stabellini <stefano.stabellini@amd.com>
Fri, 29 Jul 2022 23:01:10 +0000 (16:01 -0700)
commit2ce6a719a0cbfec5b57a2d257123146be1853f4a
tree6beac25e071d8ee7473d3b9c98003fbc5ab81a09
parent7451fdeb696df1fec33d7e5d6de8fa6676afee27
xen/arm: domain: Fix MISRA C 2012 Rule 8.7 violation

The function idle_loop() is referenced only in domain.c.
Change its linkage from external to internal by adding the storage-class
specifier static to its definitions.

Add the function as a 'fake' input operand to the inline assembly statement,
to make the compiler aware that the function is used.
Fake means that the function is not actually used as an operand by the asm code.
That is because there is not a suitable gcc arm32 asm constraint for labels.

Declare return_to_new_vcpu32() and return_to_new_vcpu64() that are also
referenced by this inline asm statement.

Also, this patch resolves indirectly a MISRA C 2012 Rule 8.4 violation warning.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
[add noreturn]
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
xen/arch/arm/domain.c
xen/arch/arm/include/asm/current.h