1# zx_system_mexec
2
3## NAME
4
5zx_system_mexec - Soft reboot the system with a new kernel and bootimage
6
7## SYNOPSIS
8
9```
10#include <zircon/syscalls.h>
11
12zx_status_t zx_system_mexec(zx_handle_t resource,
13                            zx_handle_t kernel_vmo,
14                            zx_handle_t bootimage_vmo);
15```
16
17## DESCRIPTION
18
19**zx_system_mexec**() accepts two vmo handles: *kernel_vmo* should contain a
20kernel image and *bootimage_vmo* should contain an initrd whose address shall
21be passed to the new kernel as a kernel argument.
22
23To supplant the running kernel, a *resource* of *ZX_RSRC_KIND_ROOT* must be
24supplied.
25
26Upon success, *zx_system_mexec* shall supplant the currently running kernel
27image with the kernel image contained within *kernel_vmo*, load the ramdisk
28contained within *bootimage_vmo* to a location in physical memory and branch
29directly into the new kernel while providing the address of the loaded initrd
30to the new kernel.
31
32## RIGHTS
33
34TODO(ZX-2399)
35
36## RETURN VALUE
37
38**zx_system_mexec**() shall not return upon success.
39