1 /*
2  * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
3  *
4  */
5 
6 #include "config.h"
7 #include <xen/types.h>
8 
9 #include <public/sysctl.h>
10 
11 /*
12  * All of the .new_size and .old_addr are based on assumptions that the
13  * code for 'xen_minor_version' is compiled in specific way. Before
14  * running this test-case you MUST verify that the assumptions are
15  * correct (Hint: make debug and look in xen.s).
16  */
17 struct livepatch_func __section(".livepatch.funcs") livepatch_nop = {
18     .version = LIVEPATCH_PAYLOAD_VERSION,
19     .old_size = MINOR_VERSION_SZ,
20 
21 #ifdef CONFIG_X86
22     .old_addr = (void *)MINOR_VERSION_ADDR,
23     /* Everything but the last instruction: "req". */
24     .new_size = MINOR_VERSION_SZ-1,
25 #endif
26 
27 #ifdef CONFIG_ARM
28     .old_addr = (void *)MINOR_VERSION_ADDR,
29     /*
30      * On ARM64 we replace the first one: "mov w0, #0x8". While on
31      * ARM32 we replace all but the return instruction: "bx lr".
32      */
33     .new_size = MINOR_VERSION_SZ-4,
34 #endif
35 };
36 
37 /*
38  * Local variables:
39  * mode: C
40  * c-file-style: "BSD"
41  * c-basic-offset: 4
42  * tab-width: 4
43  * indent-tabs-mode: nil
44  * End:
45  */
46