1# zx_system_mexec
2
3## NAME
4
5<!-- Updated by update-docs-from-abigen, do not edit. -->
6
7system_mexec - Soft reboot the system with a new kernel and bootimage
8
9## SYNOPSIS
10
11<!-- Updated by update-docs-from-abigen, do not edit. -->
12
13```
14#include <zircon/syscalls.h>
15
16zx_status_t zx_system_mexec(zx_handle_t resource,
17                            zx_handle_t kernel_vmo,
18                            zx_handle_t bootimage_vmo);
19```
20
21## DESCRIPTION
22
23`zx_system_mexec()` accepts two vmo handles: *kernel_vmo* should contain a
24kernel image and *bootimage_vmo* should contain an initrd whose address shall
25be passed to the new kernel as a kernel argument.
26
27To supplant the running kernel, a *resource* of **ZX_RSRC_KIND_ROOT** must be
28supplied.
29
30Upon success, `zx_system_mexec()` shall supplant the currently running kernel
31image with the kernel image contained within *kernel_vmo*, load the ramdisk
32contained within *bootimage_vmo* to a location in physical memory and branch
33directly into the new kernel while providing the address of the loaded initrd
34to the new kernel.
35
36## RIGHTS
37
38<!-- Updated by update-docs-from-abigen, do not edit. -->
39
40*resource* must have resource kind **ZX_RSRC_KIND_ROOT**.
41
42*kernel_vmo* must be of type **ZX_OBJ_TYPE_VMO** and have **ZX_RIGHT_READ**.
43
44*bootimage_vmo* must be of type **ZX_OBJ_TYPE_VMO** and have **ZX_RIGHT_READ**.
45
46## RETURN VALUE
47
48`zx_system_mexec()` shall not return upon success.
49
50## SEE ALSO
51
52
53[system_mexec_payload_get](system_mexec_payload_get.md).
54