1 /*
2  * Copyright (c) 2019 Amazon.com, Inc. or its affiliates. All rights reserved.
3  *
4  */
5 
6 #include <xen/lib.h>
7 #include <xen/types.h>
8 #include <xen/version.h>
9 #include <xen/livepatch.h>
10 #include <xen/livepatch_payload.h>
11 
12 #include <public/sysctl.h>
13 
14 static const char livepatch_exceptions_str[] = "xen_extra_version";
15 extern const char *xen_hello_world(void);
16 
17 #define EXPECT_BYTES_COUNT 6
18 
19 struct livepatch_func __section(".livepatch.funcs") livepatch_exceptions = {
20     .version = LIVEPATCH_PAYLOAD_VERSION,
21     .name = livepatch_exceptions_str,
22     .new_addr = xen_hello_world,
23     .old_addr = xen_extra_version,
24     .new_size = EXPECT_BYTES_COUNT,
25     .old_size = EXPECT_BYTES_COUNT,
26     .expect = {
27         .enabled = 1,
28         .len = EXPECT_BYTES_COUNT,
29         .data = { 0xDE, 0xAD, 0xC0, 0xDE, 0xBA, 0xBE }
30     },
31 
32 };
33 
34 /*
35  * Local variables:
36  * mode: C
37  * c-file-style: "BSD"
38  * c-basic-offset: 4
39  * tab-width: 4
40  * indent-tabs-mode: nil
41  * End:
42  */
43